patroni configuration
The patroni configuration is the same as before, just replace the original ipv4 part with ipv6. Take one of the machines as an example.
scope: postgres-cluster
namespace: /service/
name: pgnode03
restapi:
listen: fd69:1:10:f940::a13:24cf:8008
connect_address: fd69:1:10:f940::a13:24cf:8008
etcd:
hosts: fd69:1:10:f780::a13:1c81:12379,fd69:1:10:f940::a13:24ce:12379,fd69:1:10:f940::a13:24cf:12379
username: patroni_user
password: antdb
bootstrap:
# this section will be written into Etcd:/<namespace>/<scope>/config after initializing new cluster
# and all other cluster members will use it as a `global configuration`
dcs:
ttl: 15
loop_wait: 5
retry_timeout: 5
maximum_lag_on_failover: 1048576
master_start_timeout: 300
synchronous_mode: true
postgresql:
use_pg_rewind: true
parameters:
listen_addresses: "*"
port: 55551
wal_level: logical
log_directory: "pg_log"
log_destination: "csvlog"
hot_standby: "on"
wal_keep_size: 10240
max_wal_senders: 10
postgresql:
listen: fd69:1:10:f940::a13:24cf:55551
connect_address: fd69:1:10:f940::a13:24cf:55551
data_dir: /data1/adbpuq/data
bin_dir: /data1/adbpuq/pgsql/bin
pgpass: /data1/adbpuq/.pgpass
authentication:
replication:
username: replicator
password: antdb
superuser:
username: adbpuq
password: AntDB@2022@04
parameters:
unix_socket_directories: '/tmp'
tags:
nofailover: false
noloadbalance: false
clonefrom: false
nosync: false
The above steps are the parts of ipv6 that distinguish ipv4 from ipv6. The rest of the operation is inconvenient.
Problems during patroni installation
1. Error "failed import ......" is reported
patroni depends on many installation packages, you can use the pip command to install them in order according to the error message.
For example:
pip3 install python-consul2
pip3 install python-etcd
pip3 install dnspython
pip3 install kazoo
2, /etc/patroni.yml file format problems
yml format document has some formatting requirements: use indentation to indicate hierarchical relationships; do not allow the use of tabs, only spaces are allowed.
3、Etcd: failed to send out heartbeat. Heartbeat check is not allowed
yum install ntp
systemctl start ntpd