GBase 8c
其他
文章

GBase 8c 确认数据库连接

发表于2023-12-06 13:55:50124次浏览1个评论

客户端工具通过数据库主节点连接数据库。因此连接前,需获取数据库主节点所在服务器的IP地址及数据库主节点的端口号信息。

操作步骤

步骤1 以操作系统用户gbase登录数据库主节点。

步骤2 使用“gs_om -t status --detail”命令查询GBase 8c各实例情况。

 

$ gs_om -t status --detail

 [   Cluster State   ]



cluster_state   : Normal

redistributing  : No

current_az      : AZ_ALL



[  Datanode State   ]



    node       node_ip         port      instance                                           state

-----------------------------------------------------------------------------------------------------------------

1  gbase8c_7_6  host_ip        5600       6001 /home/gbase/clusters/gbase8c/datanode/dn_1   P Primary Normal

如上部署了数据库主节点实例的服务器IP地址分别为host_ip。数据库主节点数据路径为/home/gbase/clusters/gbase8c/datanode/dn_1。“P”表示安装时指定的角色为Primary,数据库安装后不在变化,从系统静态文件读取;“Primary”表示实例为主实例; “Normal”表示GBase 8c可用,且数据有冗余备份,所有进程都在运行,主备关系正常。

步骤3 确认数据库主节点的端口号。

在步骤2查到的数据库主节点数据路径下的postgresql.conf文件中查看端口号信息。示  例如下:

 

cat /home/gbase/clusters/gbase8c/datanode/dn_1/postgresql.conf | grep port

port = 5600                             # (change requires restart)

#ssl_renegotiation_limit = 0            # amount of data between renegotiations, no longer supported

                                        # supported by the operating system:

                                                # The heartbeat thread will not start if not set localheartbeatport and remoteheartbeatport.

                                                # e.g. 'localhost=10.145.130.2 localport=12211 localheartbeatport=12214 remotehost=10.145.130.3 remoteport=12212 remoteheartbeatport=12215, localhost=10.145.133.2 localport=12213 remotehost=10.145.133.3 remoteport=12214'

                                                # e.g. 'localhost=10.145.130.2 localport=12311 localheartbeatport=12214 remotehost=10.145.130.4 remoteport=12312 remoteheartbeatport=12215, localhost=10.145.133.2 localport=12313 remotehost=10.145.133.4 remoteport=12314'

                                                # e.g. 'localhost=10.145.130.2 localport=12311 localheartbeatport=12214 remotehost=10.145.130.5 remoteport=12312 remoteheartbeatport=12215, localhost=10.145.133.2 localport=12313 remotehost=10.145.133.5 remoteport=12314'

                                                # e.g. 'localhost=10.145.130.2 localport=12311 localheartbeatport=12214 remotehost=10.145.130.6 remoteport=12312 remoteheartbeatport=12215, localhost=10.145.133.2 localport=12313 remotehost=10.145.133.6 remoteport=12314'

                                                # e.g. 'localhost=10.145.130.2 localport=12311 localheartbeatport=12214 remotehost=10.145.130.7 remoteport=12312 remoteheartbeatport=12215, localhost=10.145.133.2 localport=12313 remotehost=10.145.133.7 remoteport=12314'

                                                # e.g. 'localhost=10.145.130.2 localport=12311 localheartbeatport=12214 remotehost=10.145.130.8 remoteport=12312 remoteheartbeatport=12215, localhost=10.145.133.2 localport=12313 remotehost=10.145.133.8 remoteport=12314'

                                                # e.g. 'localhost=10.145.130.2 localport=12311 localheartbeatport=12214 remotehost=10.145.130.9 remoteport=12312 remoteheartbeatport=12215, localhost=10.145.133.2 localport=12313 remotehost=10.145.133.9 remoteport=12314'

                                                # e.g. 'localhost=10.145.133.2 localport=12313 remotehost=10.145.133.9 remoteport=12314'

                                                # e.g. 'localhost=10.145.133.2 localport=12313 remotehost=10.145.133.9 remoteport=12314'

                                                # e.g. 'localhost=10.145.133.2 localport=12313 remotehost=10.145.133.9 remoteport=12314'

                                                # e.g. 'localhost=10.145.133.2 localport=12313 remotehost=10.145.133.9 remoteport=12314'

                                                # e.g. 'localhost=10.145.133.2 localport=12313 remotehost=10.145.133.9 remoteport=12314'

                                                # e.g. 'localhost=10.145.133.2 localport=12313 remotehost=10.145.133.9 remoteport=12314'

                                                # e.g. 'localhost=10.145.133.2 localport=12313 remotehost=10.145.133.9 remoteport=12314'

                                        #   %r = remote host and port

alarm_report_interval = 10

5600为数据库主节点的端口号。

----结束

评论

登录后才可以发表评论
崔哥发表于 7个月前
拂拭残碑,敕飞字,依稀堪读。慨当初,倚飞何重,后来何酷。岂是功成身合死,可怜事去言难赎。最无辜,堪恨更堪悲,风波狱。岂不念,疆圻蹙。岂不念,徽钦辱,念徽钦既返,此身何属。千载休谈南渡错,当时自怕中原复。笑区区、一桧亦何能,逢其欲。