i installed a patroni master node and need to create a pgbackrest replica the master node state is running but the slave node is stopped then it disappear because it looks like it belongs to another database identifier, when i try to run restore command manually pgbackrest --stanza=main --log-level-console=info --delta restore the slave node state change to running
here is the master postgresql.yml file:
> scope: {{ obasicat }} namespace: /pg_cluster/ name: {{ master }}> > restapi:> listen: {{ master_ip }}:8008> connect_address: {{ master_ip }}:8008> > etcd:> host: {{ etcd_ip }}:2379> > bootstrap: dcs:> ttl: 30> loop_wait: 10> retry_timeout: 10> maximum_lag_on_failover: {{ lag }}> postgresql:> use_pg_rewind: false> use_slots: true> > method: pgbackrest pgbackrest:> command: /home/osadmin/custom_bootstrap.sh> keep_existing_recovery_conf: False> no_params: False> recovery_conf:> recovery_target: immediate> recovery_target_action: pause> restore_command: pgbackrest --stanza={{ obasicat }} archive-get %f %p> > pg_hba:> - host all postgres 0.0.0.0/0 trust> - host replication replicate {{ master_ip }}/0 md5> - host replication replicate {{ slave_ip }}/0 md5> - host all all 0.0.0.0/0 md5> > users:> admin:> password: admin> options:> - createrole> - createdb> > postgresql: listen: "*:5432" connect_address: {{ master_ip }}:5432> data_dir: /{{opgbase}}/{{opgname}}/data/ bin_dir:> /opt/pgsql/na/11.7/bin/ authentication:> replication:> username: replicate> password: replicate> superuser:> username: postgres> password: postgres> > create_replica_methods:> - pgbackrest pgbackrest:> command: pgbackrest --stanza={{ obasicat }} --delta restore --config=/etc/pgbackrest.conf --pg1-path=/pgqdata/pgserver01/data/ --log-level-console=info> keep_data: True> no_params: True> > tags:> nofailover: false> noloadbalance: false> clonefrom: false> nosync: false> > log:> level: DEBUG> dir: /tmp/
and this is the slave postgresql.yml file:
> scope: {{ obasicat }} namespace: /pg_cluster/ name: {{ slave }}> > restapi:> listen: {{ slave_ip }}:8008> connect_address: {{ slave_ip }}:8008> > etcd:> host: {{ etcd_ip }}:2379> > bootstrap: dcs:> ttl: 30> loop_wait: 10> retry_timeout: 10> maximum_lag_on_failover: {{ lag }}> postgresql:> use_pg_rewind: false> use_slots: true> > method: pgbackrest pgbackrest:> command: /home/osadmin/custom_bootstrap.sh> keep_existing_recovery_conf: False> no_params: False> recovery_conf:> recovery_target: immediate> recovery_target_action: pause> restore_command: pgbackrest --stanza={{ obasicat }} archive-get %f %p> > pg_hba:> - host all postgres 0.0.0.0/0 trust> - host replication replicate {{ master_ip }}/0 md5> - host replication replicate {{ slave_ip }}/0 md5> - host all all 0.0.0.0/0 md5> > users:> admin:> password: admin> options:> - createrole> - createdb> > postgresql: listen: "*:5432" connect_address: {{ slave_ip }}:5432 > data_dir: /{{opgbase}}/{{opgname}}/data/ bin_dir:> /opt/pgsql/na/11.7/bin/ authentication:> replication:> username: replicate> password: replicate> superuser:> username: postgres> password: postgres> > create_replica_methods:> - pgbackrest pgbackrest:> command: pgbackrest --stanza={{ obasicat }} --delta restore --config=/etc/pgbackrest_slave.conf --pg1-path=/pgqdata/pgserver01/data/ --log-level-console=info> keep_data: True> no_params: True> > tags:> nofailover: false> noloadbalance: false> clonefrom: false> nosync: false> > log:> level: DEBUG> dir: /tmp/
Please any help ?! Thanks