## 配置(主库)
初始化:
su - postgres
/usr/pgsql-9.6/bin/initdb --encoding=utf8 -D /var/lib/pgsql/9.6/data
**修改配置:**
vi /var/lib/pgsql/9.6/data/pg_hba.conf
local all all peer
host all all 127.0.0.1/32 ident
host all all 192.168.200.0/24 md5
host all all 192.168.10.0/24 md5
host replication repl 192.168.200.26/32 md5
vi /var/lib/pgsql/9.6/data/postgresql.conf
listen_addresses = ‘0.0.0.0’
max_connections = 5000
shared_buffers = 32GB
wal_level = ‘hot_standby’
max_wal_senders = 1
wal_keep_segments=64
log_timezone = ‘PRC’
timezone = ‘PRC’
启动:
service postgresql-9.6 start
创建同步用户:
##psql -U postgres
su - postgres
psql -c “CREATE USER repl REPLICATION LOGIN CONNECTION LIMIT 1 E