pgpool 之五 pgpool的 start、stop、reload、service

os: ubuntu 16.04
db: postgresql 9.6.8
pgpool: pgpool-II-3.7.7

pgpool start

$ which pgpool
/usr/pgpool-3.7.7/bin/pgpool
$ pgpool --help
$ pgpool -f /usr/pgpool-3.7.7/etc/pgpool.conf \
-F /usr/pgpool-3.7.7/etc/pcp.conf \
-a /usr/pgpool-3.7.7/etc/pool_hba.conf -n -D > /tmp/pgpool.log 2>&1 &

或者

$ pgpool -n -D >> /tmp/pgpool.log 2>&1 &

pgpool stop

$ which pgpool
/usr/pgpool-3.7.7/bin/pgpool
$ pgpool --help
$ pgpool -f /usr/pgpool-3.7.7/etc/pgpool.conf \
-F /usr/pgpool-3.7.7/etc/pcp.conf \
-a /usr/pgpool-3.7.7/etc/pool_hba.conf -m fast stop

或者

$ pgpool -m fast stop

pgpool reload

$ which pgpool
/usr/pgpool-3.7.7/bin/pgpool
$ pgpool --help
$ pgpool -f /usr/pgpool-3.7.7/etc/pgpool.conf \
-F /usr/pgpool-3.7.7/etc/pcp.conf \
-a /usr/pgpool-3.7.7/etc/pool_hba.conf reload

或者

$ pgpool reload

pgpool service

如果采用变异方式安装的 pgpool,强烈建议自己创建个 pgpool.service 的服务.

# vi /lib/systemd/system/pgpool.service

[Unit]
Description=Pgpool-II
After=syslog.target network.target

[Service]
User=postgres
Group=postgres
ExecStart=/usr/pgpool-3.7.7/bin/pgpool -f /usr/pgpool-3.7.7/etc/pgpool.conf -F /usr/pgpool-3.7.7/etc/pcp.conf -a /usr/pgpool-3.7.7/etc/pool_hba.conf -n
ExecStop=/usr/pgpool-3.7.7/bin/pgpool -f /usr/pgpool-3.7.7/etc/pgpool.conf -F /usr/pgpool-3.7.7/etc/pcp.conf -a /usr/pgpool-3.7.7/etc/pool_hba.conf -m fast stop
ExecReload=/usr/pgpool-3.7.7/bin/pgpool -f /usr/pgpool-3.7.7/etc/pgpool.conf -F /usr/pgpool-3.7.7/etc/pcp.conf -a /usr/pgpool-3.7.7/etc/pool_hba.conf reload
LimitNOFILE=65536
KillMode=process
KillSignal=SIGINT
Restart=on-abnormal
RestartSec=30s
TimeoutSec=0

[Install]
WantedBy=multi-user.target

# systemctl daemon-reload
# systemctl enable pgpool.service

参考:
http://www.pgpool.net/mediawiki/index.php/Downloads
http://www.pgpool.net/docs/latest/en/html/index.html

你可能感兴趣的:(#,postgresql,ha,pgpool)