确认连接信息
客户端工具通过数据库主节点连接数据库。因此连接前,需获取数据库主节点所在服务器的IP地址及数据库主节点的端口号信息。
操作步骤
- 以操作系统用户omm登录数据库主节点。
- 使用“gs_om -t status –detail”命令查询openGauss各实例情况。
1. gs_om -t status --detail
``` 1. [ DBnode State ]
- node node_ip instance state
-
- 1 plat1 192.168.0.11 5001 /srv/gaussdb/data1/dbnode P Primary Normal ```
如上部署了数据库主节点实例的服务器IP地址为192.168.0.11。数据库主节点数据路径为“/srv/gaussdb/data1/dbnode”。“P”表示安装时指定的角色为Primary,数据库安装后不再变化,从系统静态文件读取;“Primary”表示实例为主实例;“Normal”表示openGauss可用,且数据有冗余备份,所有进程都在运行,主备关系正常。 3. 确认数据库主节点的端口号。
在步骤 2中查到的数据库主节点数据路径下的postgresql.conf文件中查看端口号信息。示例如下:
1. cat /srv/gaussdb/data1/dbnode/postgresql.conf | grep port
1. port = 8000 # (change requires restart)
2. #comm_sctp_port = 1024 # Assigned by installation (change requires restart)
3. #comm_control_port = 10001 # Assigned by installation (change requires restart)
4. # supported by the operating system:
5. # 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'
6. # 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'
7. # %r = remote host and port
8. alarm_report_interval = 10
9. support_extended_features=true
8000为数据库主节点的端口号。
