pgpool_II节点状态问题(pgpool_status)
环境:
OS:Centos 7
PG:14
pgpool:4.4
通过vip登录发现主节点状态一直是down,重启该节点的pgpool_II也没有用
[postgres@pg2 pgpool-II]$ psql -h 192.168.1.199 -p 9999 -U postgres
postgres=# show pool_nodes;
-[ RECORD 1 ]----------+--------------------
node_id | 0
hostname | 192.168.1.108
port | 5432
status | down
pg_status | up
lb_weight | 0.333333
role | standby
pg_role | primary
select_cnt | 0
load_balance_node | false
replication_delay | 0
replication_state |
replication_sync_state |
last_status_change | 2022-12-20 00:36:49
-[ RECORD 2 ]----------+--------------------
node_id | 1
hostname | 192.168.1.109
port | 5432
status | up
pg_status | up
lb_weight | 0.333333
role | standby
pg_role | standby
select_cnt | 0
load_balance_node | true
replication_delay | 0
replication_state |
replication_sync_state |
last_status_change | 2022-12-20 00:44:45
-[ RECORD 3 ]----------+--------------------
node_id | 2
hostname | 192.168.1.104
port | 5432
status | up
pg_status | up
lb_weight | 0.333333
role | standby
pg_role | standby
select_cnt | 0
load_balance_node | false
replication_delay | 0
replication_state |
replication_sync_state |
last_status_change | 2022-12-20 00:36:49
解决办法:
停掉每个节点的pgpool_II,删除每个节点的状态文件,然后重启动pgpool_II
1.停掉
[root@pg1 tmp]# systemctl stop pgpool
2.删除状态文件
[root@pg1 tmp]# pwd
/tmp
[root@pg1 tmp]# rm pgpool_status
rm: remove regular file ‘pgpool_status’? y
3.重启动
[root@pg1 tmp]# systemctl start pgpool