我正在设置 Patroni 集群,并面临两个节点均保持“已停止”状态的问题,并且日志表明系统正在等待领导者引导。这是我运行时的输出
patronictl -c /etc/postgres0.yml list
:
Cluster: postgres (7366xxxxxxxxxxxxxxx) ---------+----+-----------+
| Member | Host | Role | State | TL | Lag in MB |
+-------------+----------------+---------+---------+----+-----------+
| postgresql0 | xxx.xxx.xx.57 | Replica | stopped | | unknown |
| postgresql1 | xxx.xxx.xx.129 | Replica | stopped | | unknown |
+-------------+----------------+---------+---------+----+-----------+
日志条目:
[postgres@patroni01 ~]$ patroni /etc/postgres0.yml
2024-05-07 13:24:24,345 INFO: No PostgreSQL configuration items changed, nothing to reload.
2024-05-07 13:24:24,401 INFO: Lock owner: None; I am postgresql0
2024-05-07 13:24:24,404 INFO: waiting for leader to bootstrap
(repeated logs)
2024-05-07 13:25:04,405 INFO: waiting for leader to bootstrap
配置详情:
scope: postgres
namespace: /service/
name: postgresql0
restapi:
listen: xxx.xxx.xx.57:8008
connect_address: xxx.xxx.xx.57:8008
etcd:
host: xxx.xxx.xx.155:2379
bootstrap:
dcs:
ttl: 30
loop_wait: 10
retry_timeout: 10
maximum_lag_on_failover: 1048576
postgresql:
use_pg_rewind: true
use_slots: true
pg_hba:
- host replication replicator 127.0.0.1/32 trust
- host replication replicator xxx.xxx.xx.57/0 trust
- host replication replicator xxx.xxx.xx.129/0 trust
- host all all 0.0.0.0/0 trust
parameters:
initdb:
- encoding: UTF8
- data-checksums
postgresql:
listen: xxx.xxx.xx.57:5432
connect_address: xxx.xxx.xx.57:5432
data_dir: /data/patroni
pgpass: /tmp/pgpass0
authentication:
replication:
username: replicator
password: replicator
superuser:
username: postgres
password: postgres
parameters:
unix_socket_directories: '..'
tags:
noloadbalance: false
clonefrom: false
nosync: false
nostream: false
尝试解决问题:
其他问题:
任何解决或解决此问题的见解或建议将不胜感激。
可以通过以下方式从 DCS 中删除所有 Patroni 集群来解决该问题: