Confirming Connection Information
You can use a client tool to connect to a database through the primary node of the database. Before the connection, obtain the IP address of the primary node of the database and the port number of the server where the primary node of the database is deployed.
Procedure
Log in as the OS user omm to the primary node of the database.
Run the gs_om-t status--detail command to query instances in the openGauss cluster.
gs_om -t status --detail
[ DBnode State ] node node_ip instance state ----------------------------------------------------------------------------- 1 plat1 192.168.0.11 5001 /srv/BigData/gaussdb/data1/dbnode P Primary Normal
For example, the server IP addresses where the primary node of the database is deployed are 192.168.10.11. The data path of the primary node of the database is /srv/BigData/gaussdb/data1/dbnode. “P” indicates that the initial role of the node is primary, and it not change after installation. “Primary” indicates that the instance is the primary instance; “Normal” indicates that opengauss is available. For details about the other parameters, see “Server Tools” > gs_om" in the Tool Refrence.
Confirm the port number of the primary node of the database.
View the port number in the postgresql.conf file in the data path of the database primary node obtained in 2. The command is as follows:
cat /srv/BigData/gaussdb/data1/dbnode/postgresql.conf | grep port
port = 8000 # (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 support_extended_features=true
8000 is the port number of the database primary node.