我安装了一个守护主节点并需要创建一个 pgbackrest 副本主节点状态正在运行但从节点停止然后它消失了,因为它看起来属于另一个数据库标识符,当我尝试手动运行恢复命令pgbackrest - stanza=main --log-level-console=info --delta 恢复从节点状态更改为 running
这是主 postgresql.yml 文件:
> 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/
这是从属 postgresql.yml 文件:
> 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/
请任何帮助?!谢谢