问题:数据未在节点之间复制。 Postgres 版本:14 我已经设置了 patoni 服务器,其中包含一个领导者和三个副本,并使用 HA 代理作为负载平衡器。 自动故障转移工作正常,当领导者宕机时,守护神会将副本节点提升为领导者。
以下是我列出顾客集群时的输出:
+ Cluster: postgres (7322782945008862801) ------+----+-----------+
| Member | Host | Role | State | TL | Lag in MB |
+--------+----------------+---------+-----------+----+-----------+
| node1 | 10.113.123.155 | Leader | running | 1 | |
| node2 | 10.113.123.156 | Replica | streaming | 1 | 0 |
| node3 | 10.113.123.157 | Replica | streaming | 1 | 0 |
| node4 | 10.113.123.158 | Replica | streaming | 1 | 0 |
+--------+----------------+---------+-----------+----+-----------+
/etc/patroni.yml 是
namespace: /db/
name: node1
restapi:
listen: 10.113.123.155:8008
connect_address: 10.113.123.155:8008
etcd:
hosts: 10.113.123.157:2379, 10.113.123.158:2379
bootstrap:
dcs:
ttl: 30
loop_wait: 10
retry_timeout: 10
maximum_lag_on_failover: 1048576
postgresql:
use_pg_rewind: true
initdb:
- encoding: UTF8
- data-checksums
pg_hba:
- host replication replicator 127.0.0.1/32 md5
- host replication replicator 10.113.123.155/0 md5
- host replication replicator 10.113.123.156/0 md5
- host replication replicator 10.113.123.157/0 md5
- host replication replicator 10.113.123.158/0 md5
- host all all 0.0.0.0/0 md5
users:
admin:
password: admin
options:
- createrole
- createdb
postgresql:
listen: 10.113.123.155:5432
connect_address: 10.113.123.155:5432
data_dir: /dev/data/patroni/
pgpass: /tmp/pgpass
authentication:
replication:
username: replicator
password: password
superuser:
username: postgres
password: postgres
parameters:
unix_socket_directories: '.'
tags:
nofailover: false
noloadbalance: false
clonefrom: false
nosync: false
任何形式的帮助将不胜感激。
遇到同样的问题,你找到解决办法了吗?