Help Center/ Data Replication Service/ FAQs/ Real-Time Synchronization/ Configuring Remote Connection to a GaussDB Database/ Configuration Method for a Synchronization Task from GaussDB Distributed in Multi-Task Mode
Updated on 2025-07-24 GMT+08:00

Configuration Method for a Synchronization Task from GaussDB Distributed in Multi-Task Mode

You can modify the configuration file or use gs_guc to configure a task from GaussDB Distributed in multi-task mode.

Modifying the Configuration File

  1. Log in to all CN nodes of the distributed GaussDB instance.
  2. Query the location of the configuration file.

    find / -name "pg_hba.conf"
    Or
    find / -name "gs_hba.conf"

  3. Open the pg_hba.conf or gs_hba.conf file and add the following configurations:

    host all <user> 0.0.0.0/0 sha256

  4. Log in to all DN nodes of the distributed GaussDB instance.
  5. Query the location of the configuration file.

    find / -name "pg_hba.conf"
    Or
    find / -name "gs_hba.conf"

  6. Open the pg_hba.conf or gs_hba.conf file and add the following configurations:

    host all <user> 0.0.0.0/0 sha256
    host replication <user> 0.0.0.0/0 sha256

  7. Run the following statement as a system administrator on the source database or restart the DB instance to apply the change:

    select pg_reload_conf();

Using gs_guc

  1. For a cloud database, run the following command to access the sandbox. For a self-built database, run the source gauss_env_file command to configure the environment variable file.

    Log in to any database node, switch to user Ruby, and run the su - Ruby command.

    1. Versions earlier than 2.0 (V500R002C00)
      /usr/sbin/chroot /var/chroot /bin/bash
      source /etc/profile && source ~/.bashrc
    2. 2.0 (V500R002C00) and later versions
      chroot /var/chroot
      source /etc/profile; source /home/Ruby/.bashrc ;source /home/Ruby/gauss_env_file

    To change a GaussDB instance on Huawei Cloud, you need to contact the database oncall personnel.

  2. 1) Common connections

    Connect all users and IP addresses to CNs and DNs via common connections.

    gs_guc reload -Z datanode -Z coordinator -N all -I all -h "host all all 0.0.0.0/0 sha256"

    Connect a specified user and an IP address to CNs and DNs via common connections.

    gs_guc reload -Z datanode -Z coordinator -N all -I all -h "host all <user> <ip>/32 sha256"

    2) Logical replication connections

    Connect all users and IP addresses to DNs via replication connections.

    gs_guc reload -Z datanode -N all -I all -h "host replication all 0.0.0.0/0 sha256"

    Connect a specified user and an IP address to DNs via replication connections.

    gs_guc reload -Z datanode -N all -I all -h "host replication <user> <ip>/32 sha256