Rate This Document
Findability
Accuracy
Completeness
Readability

Adding a Kunpeng Node to the Primary/Secondary Deployment

After the primary database is backed up and restored, configure the Kunpeng server as the secondary database server, and ensure that the data is synchronized with the primary database.

Before the primary/secondary switchover, the "primary database" in this section refers to the x86 primary database. After the primary/secondary switchover, the "primary database" refers to the new Kunpeng primary database.

Verify that the connection between the primary database and the Kunpeng secondary database has been established.

  1. Switch to the postgres user on the Kunpeng secondary database server.
    su - postgres
  2. Configure the connection information about the primary database.

    Modify the postgresql.conf file to set the parameters required for connecting to the primary database.

    1. Open the postgresql.conf file.
      vi /data/pg-13.2/data/postgresql.conf
    2. Press i to enter the insert mode, and add parameters to the end of the file as follows to specify the IP address, port number, user name, and password of the primary database server.
      primary_conninfo = 'host = IP address of the primary database server address port = Listening port number used by the primary database service user = backup  password = 123456'

    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  3. Enable the secondary database mode.
    To assign the Kunpeng server as a secondary database, create a standby.signal file.
    1. Create the file.
      vi /data/pg-13.2/data/standby.signal
    2. Press i to enter the insert mode and add the following parameter to the file to declare the Kunpeng server as the secondary database:
      standby_mode = on
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  4. Restart the Kunpeng secondary database to apply the modifications and start the synchronization.
    /usr/local/pgsql-13.2/bin/pg_ctl -D /data/pg-13.2/data -l logfile start

  5. Verify the synchronization status.
    1. On the secondary database server, ensure that the walreceiver process is running properly.
      ps -ax | grep postgres

    2. On the primary database server, ensure that the walsender process is running properly.
      ps -ax | grep postgres

    3. Log in to the primary database on the primary database server.
      /usr/local/pgsql-13.2/bin/psql -U postgres
    4. Run the SQL statement to check the status of the Kunpeng secondary database.
      select * from pg_stat_replication;

      If the following information is displayed, the Kunpeng node is successfully added to the primary/secondary deployment.