首页 > 数据库 > > 连接数据库-确认连接信息
客户端工具通过CN连接数据库。因此连接前,需获取CN所在服务器的IP地址及CN的端口号信息。客户端工具可以通过任何一个CN连接数据库。
gs_om -t status --detail
[ Coordinator State ]
node node_ip instance state
-----------------------------------------------------------------------------
1 plat1 192.168..11 5001 /srv/BigData/mppdb/data1/coordinator Normal
2 plat2 192.168..12 5002 /srv/BigData/mppdb/data1/coordinator Normal
3 plat3 192.168..13 5003 /srv/BigData/mppdb/data1/coordinator Normal
如上部署了CN实例的服务器IP地址分别为192.168.10.11、192.168.10.12和192.168.0.13。CN数据路径为“/srv/BigData/mppdb/data1/coordinator”。
在2查到的CN数据路径下的postgresql.conf文件中查看端口号信息。示例如下:
cat /srv/BigData/mppdb/data1/coordinator/postgresql.conf | grep portport = 25308 # (change requires restart)
#comm_sctp_port = 1024 # Assigned by installation (change requires restart)
#comm_control_port = 10001 # Assigned by installation (change requires restart)
# supported by the operating system:
# e.g. 'localhost=10.145.130.2 localport=12211 remotehost=10.145.130.3 remoteport=12212, localhost=10.145.133.2 localport=12213 remotehost=10.145.133.3 remoteport=12214'
# e.g. 'localhost=10.145.130.2 localport=12311 remotehost=10.145.130.4 remoteport=12312, localhost=10.145.133.2 localport=12313 remotehost=10.145.133.4 remoteport=12314'
# %r = remote host and port
alarm_report_interval = 10
gtm_port = 6000 # Port of GTM
gtm_port1 = 6500 # Port1 of GTM
pooler_port = 8001
support_extended_features=true
25308为CN的端口号。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69959250/viewspace-3151850/ ,如需转载,请注明出处,否则将追究法律责任。