在本地新建了2套patroni集群
其中一套三个节点,如下
[postgres@postgresql-2 ~]$ patronictl list
+ Cluster: backup (7044098801871411390) +---------+----+-----------+
| Member | Host | Role | State | TL | Lag in MB |
+--------------+--------------+---------+---------+----+-----------+
| postgresql-1 | 192.168.1.21 | Replica | running | 33 | 0.0 |
| postgresql-2 | 192.168.1.22 | Leader | running | 33 | |
| postgresql-3 | 192.168.1.23 | Replica | running | 33 | 0.0 |
+--------------+--------------+---------+---------+----+-----------+另外一套为单节点,配置为standby_cluster,具体信息如下
[postgres@patroni ~]$ patronictl list
2022-03-29 10:02:00,207 - ERROR - Request to server http://127.0.0.1:2379 failed: MaxRetryError("HTTPConnectionPool(host=u'127.0.0.1', port=2379): Max retries exceeded with url: /v3/kv/range (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f3c2d7699d0>: Failed to establish a new connection: [Errno 111] Connection refused',))",)
+ Cluster: patroni (7044098801871411390) -+---------+----+-----------+
| Member | Host | Role | State | TL | Lag in MB |
+---------+--------------+----------------+---------+----+-----------+
| patroni | 192.168.1.25 | Standby Leader | running | 33 | |
+---------+--------------+----------------+---------+----+-----------+
现在遇到的问题是主集群没有haproxy代理,当主集群做switchover的时候standby_cluster就会同步数据失败,这个要如何修改配置呢?
从patroni的github上得知是
Add target_session_attrs=read-write to standby_leader primary_conninfo
但是没有找到对应的配置例子,有没有大佬帮忙答复一下,谢谢!
墨值悬赏

