all:
@echo "make push"
- PAGER= psql -h 10.200.1.60 -c 'show pool_nodes' postgres postgres
+ PAGER= psql -h 10.200.1.60 -p 9999 -c 'show pool_nodes' postgres postgres
PAGER= psql -h $(PRIMARY) -c 'SELECT * from pg_stat_replication' postgres postgres
init:
restart:
#ssh root@10.200.1.61 systemctl restart postgresql-9.6
#ssh root@10.200.1.62 systemctl restart postgresql-9.6
- ssh root@10.200.1.61 rm /var/log/pgpool/pgpool_status
ssh root@10.200.1.61 systemctl restart pgpool
- ssh root@10.200.1.62 rm /var/log/pgpool/pgpool_status
ssh root@10.200.1.62 systemctl restart pgpool
status:
fix:
ssh root@10.200.1.60 /etc/pgpool-II/online-recovery.sh
+
+clean:
+ ssh root@10.200.1.61 rm -Rfv /etc/pgpool-II/
+ ssh root@10.200.1.61 'yes | yum reinstall http://www.pgpool.net/yum/rpms/3.6/redhat/rhel-7-x86_64/pgpool-II-pg96-3.6.5-1pgdg.rhel7.x86_64.rpm'
+ ssh root@10.200.1.61 'systemctl enable pgpool'
+
+ ssh root@10.200.1.62 rm -Rfv /etc/pgpool-II/
+ ssh root@10.200.1.62 'yes | yum reinstall http://www.pgpool.net/yum/rpms/3.6/redhat/rhel-7-x86_64/pgpool-II-pg96-3.6.5-1pgdg.rhel7.x86_64.rpm'
+ ssh root@10.200.1.62 'systemctl enable pgpool'
This version is work-in-progress using Centos7 and upstream packages. It doesn't require psmisc package, making Centos7 minimal installation sufficient for scripts to run, since it uses systemd to manage postgresql-9.6 installed in /var/lib/pgsql/9.6/data/
-Hardware configuration is 2 nodes:
+Hardware configuration is 2 nodes with 3 IP addresses:
+
+10.200.1.60 edozvola-db-pgpool <- virtual IP with pgpool listening on port 9999
10.200.1.61 edozvola-db-01
10.200.1.62 edozvola-db-02
# - Debug -
#log_error_verbosity = default # terse, default, or verbose messages
-log_error_verbosity = verbose
#client_min_messages = notice # values in order of decreasing detail:
# debug5
# -Connection to up stream servers -
-trusted_servers = 'edozvola-db-01,edozvola-db-02'
+trusted_servers = ''
# trusted server list which are used
# to confirm network connection
# (hostA,hostB,hostC,...)
# - Virtual IP control Setting -
-delegate_IP = '10.210.1.60'
+delegate_IP = '10.200.1.60'
# delegate IP address
# If this is empty, virtual IP never bring up.
# (change requires restart)
arping_path = '/etc/pgpool-II/sbin'
# arping command path
# (change requires restart)
-arping_cmd = 'arping -U $_IP_$ -w 1'
+arping_cmd = 'arping -U $_IP_$ -w 1 -I eth0'
+# XXX arping doesn't work without explicit interface!
# arping command
# (change requires restart)
# -- common --
-wd_monitoring_interfaces_list = '' # Comma separated list of interfaces names to monitor.
+wd_monitoring_interfaces_list = 'any' # Comma separated list of interfaces names to monitor.
# if any interface from the list is active the watchdog will
# consider the network is fine
# 'any' to enable monitoring on all interfaces except loopback
# must be at end
ssh root@$1 rpm -q pgpool-II-pg96 && return
- yes | ssh root@$1 yum install $2 http://www.pgpool.net/yum/rpms/3.6/redhat/rhel-7-x86_64/pgpool-II-pg96-3.6.5-1pgdg.rhel7.x86_64.rpm
+ yes | ssh root@$1 yum install http://www.pgpool.net/yum/rpms/3.6/redhat/rhel-7-x86_64/pgpool-II-pg96-3.6.5-1pgdg.rhel7.x86_64.rpm
}
install 10.200.1.61
ssh root@10.200.1.61 systemctl restart pgpool
ssh root@10.200.1.62 systemctl restart pgpool
-psql -h 10.200.1.61 -p 9999 -c 'show pool_nodes' postgres postgres
-