Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

[PostgreSQL] Database replication

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Asynchronous flow copy [root@wallet01 ~] # su-postgres [postgres@wallet01 ~] $vi / var/lib/pgsql/9.6/data/pg_hba.confhost replication postgres 192.168.1.0 postgres@wallet01 24 md5 [postgres@wallet01 ~] $vi / var/lib/pgsql/9.6/data/postgresql.conflisten_addresses = '0.0.0.0'max_wal_senders = 5wal_level = hot_standby [postgres@wallet01 ~] $pg_ctl restartwaiting for server to shut down.... Doneserver stoppedserver starting [root@wallet02 ~] # su-postgres [postgres@wallet02 ~] $pg_basebackup-h 192.168.1.201-U postgres-F p-P-x-R-D / var/lib/pgsql/9.6/data Password: 2161085 kB 1 tablespace [postgres@wallet02 ~] $vi / var/lib/pgsql/9.6/data/postgresql.confhot_standby = on [postgres@wallet02 ~] $vi / var/lib/pgsql/9.6/data/recovery.confstandby_mode = 'on'primary_conninfo =' user=postgres password=postgres host=192.168.1.201 port=5432 sslmode=disable sslcompression=1 krbsrvname=postgres' [postgres@wallet02 ~] $pg_ctl startserver starting [postgres@wallet01 ~] $psqlpsql (9.6.12) Type "help" for help.postgres=# select pid,state,client_addr,sync_priority Sync_state from pg_stat_replication Pid | state | client_addr | sync_priority | sync_state-+-2055 | streaming | 192.168.1.202 | 0 | async (1 row)

Synchronous stream copy [root@wallet01 ~] # su-postgres [postgres@wallet01 ~] $vi / var/lib/pgsql/9.6/data/pg_hba.confhost replication postgres 192.168.1.0 postgres@wallet01 24 md5 [postgres@wallet01 ~] $vi / var/lib/pgsql/9.6/data/postgresql.confmax_wal_senders = 5 wal_level = hot_standbysynchronous_standby_names = 'wallet02 Wallet03' [root@wallet01 ~] # su-postgres [postgres@wallet01 ~] $pg_ctl reloadserver signaled [root@wallet02 ~] # su-postgres [postgres@wallet02 ~] $pg_basebackup-h 192.168.1.201-U postgres-F p-P-x-R-D / var/lib/pgsql/9.6/data Password: 2161085G 2161085 kB 1 tablespace [postgres@wallet02 ~] $vi / var/lib/pgsql/9.6/data/postgresql.confhot_standby = on [postgres@wallet02 ~] $vi / var/lib/pgsql/9.6/data/recovery.confstandby_mode = 'on'primary_conninfo =' application_name=wallet02 user=postgres password=postgres host=192.168.1.201 port=5432 sslmode=disable sslcompression=1' [postgres@wallet02 ~] $pg_ctl startserver starting [root@wallet03 ~] # su-postgres [postgres@wallet03 ~] $pg_basebackup-h 192.168 .100-U postgres-F p-P-x-R-D / var/lib/pgsql/9.6/data Password: 2161215 kB 1 tablespace [postgres@wallet03 ~] $vi / var/lib/pgsql/9.6/data/postgresql.confhot_standby = on [postgres@wallet03 ~] $vi / var/lib/pgsql/9.6/data/recovery.confstandby_mode = 'on'primary_conninfo =' application_name=wallet03 user=postgres password=postgres host=192.168.1.201 port=5432 sslmode=disable sslcompression=1' [postgres@wallet03 ~] $pg_ctl startserver starting [postgres@wallet01 ~] $psqlpsql (9.6.12) Type "help" for help.postgres=# select pid,state,client_addr,sync_priority Sync_state from pg_stat_replication Pid | state | client_addr | sync_priority | sync_state-+-1968 | streaming | 192.168.1.202 | 1 | sync 2018 | streaming | 192.168.1.203 | 2 | potential

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report