暗黑模式
Install
https://www.pgpool.net/mediawiki/index.php/Apt\_Repository
Configuring pgpool
env
1
bash
mkdir -p /var/log/pgpool/oiddir
chown -R postgres:postgres /var/log/pgpool
1
2
2
# pool_passwd
synapse_user:clear-text-passwd
1
2
2
bash
# primary pg
sudo -u postgres psql GRANT pg_monitor TO synapse_user;
1
2
2
bash
# standby pg
sudo systemctl stop postgresql
sudo -u postgres rm -rf /var/lib/postgresql/17/main/* # or backup
# -R
sudo -u postgres pg_basebackup -h 1.2.3.4 -U postgres -D /var/lib/postgresql/17/main -Fp -Xs -R -P
sudo systemctl start postgresql
1
2
3
4
5
6
2
3
4
5
6
pg_basebackup
:-R
- create
/var/lib/postgresql/17/main/standby.signal
- write
primary_conninfo
to/var/lib/postgresql/17/main/postgresql.auto.conf
- create
SQL like commands
bash
psql -h localhost -p 9999 -U synapse_user -d synapse -c "SHOW POOL_NODES;"
1
https://www.pgpool.net/docs/latest/en/html/sql-commands.html