Dear all
Here is my patroni.yml
scope: pg-cluster
name: pg-ceph-node1
restapi:
listen: 0.0.0.0:8008
connect_address: 127.0.0.1:8008
etcd:
host: 192.168.10.11:2379
bootstrap:
dcs:
ttl: 30
loop_wait: 10
retry_timeout: 10
maximum_lag_on_failover: 1048576
postgresql:
use_pg_rewind: true
use_slots: true
parameters:
wal_level: replica
hot_standby: "on"
wal_keep_segments: 8
max_wal_senders: 5
max_replication_slots: 5
checkpoint_timeout: 30
initdb:
pg_hba:
users:
dba:
password: Pg4Cloud
options:
- createrole
- createdb
repl:
password: Pg4CloudRepl
options:
- replication
postgresql:
listen: 0.0.0.0:5433
connect_address: 192.168.5.81:5433
data_dir: /opt/patroni/pgdir
config_dir: /opt/patroni/pgdir
bin_dir: /usr/pgsql-11/bin
authentication:
replication:
username: repl
password: Pg4CloudRepl
superuser:
username: dba
password: Pg4Cloud
parameters:
unix_socket_directories: '/tmp'
port: 5433
But when I first start (single instance) I Got
2019-01-20 10:40:55,664 INFO: Failed to import patroni.dcs.consul
2019-01-20 10:40:55,690 INFO: Selected new etcd server http://192.168.10.11:2379
2019-01-20 10:40:55,728 INFO: Lock owner: None; I am pg-ceph-node1
2019-01-20 10:40:55,733 INFO: waiting for leader to bootstrap
2019-01-20 10:41:05,724 INFO: Lock owner: None; I am pg-ceph-node1
2019-01-20 10:41:05,729 INFO: waiting for leader to bootstrap
2019-01-20 10:41:15,724 INFO: Lock owner: None; I am pg-ceph-node1
2019-01-20 10:41:15,729 INFO: waiting for leader to bootstrap
2019-01-20 10:41:25,724 INFO: Lock owner: None; I am pg-ceph-node1
2019-01-20 10:41:25,729 INFO: waiting for leader to bootstrap
2019-01-20 10:41:35,725 INFO: Lock owner: None; I am pg-ceph-node1
2019-01-20 10:41:35,729 INFO: waiting for leader to bootstrap
2019-01-20 10:41:45,725 INFO: Lock owner: None; I am pg-ceph-node1
2019-01-20 10:41:45,730 INFO: waiting for leader to bootstrap
2019-01-20 10:41:55,725 INFO: Lock owner: None; I am pg-ceph-node1
2019-01-20 10:41:55,730 INFO: waiting for leader to bootstrap
2019-01-20 10:42:05,725 INFO: Lock owner: None; I am pg-ceph-node1
2019-01-20 10:42:05,730 INFO: waiting for leader to bootstrap
2019-01-20 10:42:15,725 INFO: Lock owner: None; I am pg-ceph-node1
2019-01-20 10:42:15,730 INFO: waiting for leader to bootstrap
2019-01-20 10:42:25,724 INFO: Lock owner: None; I am pg-ceph-node1
2019-01-20 10:42:25,729 INFO: waiting for leader to bootstrap
2019-01-20 10:42:35,725 INFO: Lock owner: None; I am pg-ceph-node1
2019-01-20 10:42:35,730 INFO: waiting for leader to bootstrap
when I try with new clean install of patroni , with new cluster name ... it work.
Why ?
Sincerely
-bino-
Etcd keeps information that cluster was already initialized (/service/pg-cluster/initialize key).
Patroni wont run initdb second time if such key exists. Instead it wants to get a basebackup from one of existing nodes.
Either you should manuall remove /service/$CLUSTER_NAME/initialize from Etcd or use patronictl remove for that.
Solved.
Thankyou @CyberDem0n
Most helpful comment
Etcd keeps information that cluster was already initialized (
/service/pg-cluster/initializekey).Patroni wont run initdb second time if such key exists. Instead it wants to get a basebackup from one of existing nodes.
Either you should manuall remove
/service/$CLUSTER_NAME/initializefrom Etcd or usepatronictl removefor that.