Before performing the setup of the database multiplexing mode, ensure that the prerequisite streaming replication feature has been set up correctly.
Perform the following procedure:
On the primary server, ensure that single-row searches can be performed using the pg_stat_replication statistics view.
An example output of the psql command is shown below.
Example)
postgres=# select * from pg_stat_replication; -[ RECORD 1 ]----+------------------------------ pid | 10651 usesysid | 10 usename | fsep application_name | standby client_addr | 192.0.2.210 client_hostname | client_port | 55098 backend_start | 2022-03-23 11:17:49.628793+09 backend_xmin | state | streaming sent_lsn | 0/3000060 write_lsn | 0/3000060 flush_lsn | 0/3000060 replay_lsn | 0/3000060 write_lag | flush_lag | replay_lag | sync_priority | 1 sync_state | sync reply_time | 2022-03-23 11:23:27.703366+09
Confirm the search results of step 1.
Ensure that the connection established with the intended standby server is in synchronous mode.
Item | Required value |
---|---|
application_name | Value specified for synchronous_standby_names parameter in the postgresql.conf file of the primary server. |
client_addr | IP address of the standby server. |
state | "streaming". |
sync_state | "sync". |
See
Refer to "The Statistics Collector" in "Server Administration" in the PostgreSQL Documentation for information on the pg_stat_replication statistics view.
Note that the pg_stat_replication statistics view may change in the future.