Configuring a Remote Connection

Before the remote connection, you need to enable the client to access the database and configure the remote connection on the server where the database primary node is deployed.

Procedure

Perform the following steps on the host where openGauss resides.

  1. Log in as the OS user omm to the primary node of the database.

  2. Configure the client authentication mode. For details, see Configuring Client Access Authentication.

  3. Configure listen_addresses. listen_addresses indicates the IP address or host name of the database primary node used for remote client connection.

    1. Run the following command to check the listen_addresses value of the database primary node:

      gs_guc check -I all -c "listen_addresses"
      

      Information similar to the following is displayed:

      expected guc information: plat1: listen_addresses=NULL: [/gaussdb/data/data_cn/postgresql.conf]
      gs_guc check: plat1: listen_addresses='localhost, 192.168.0.100': [/gaussdb/data/data_cn/postgresql.conf]
      
      Total GUC values: 1. Failed GUC values: 0.
      The value of parameter listen_addresses is same on all instances.
          listen_addresses='localhost, 192.168.0.100'
      
    2. Run the following command to append the IP addresses to be added to listen_addresses. Use commas (,) to separate multiple IP addresses. For example, add the IP address 10.11.12.13.

      gs_guc set -I all -c "listen_addresses='localhost,192.168.0.100,10.11.12.13'"
      
  4. Run the following command to restart the openGauss:

    gs_om -t stop && gs_om -t start
    
Feedback
编组 3备份
    openGauss 2024-05-06 00:44:54
    cancel