我正在尝试使用两个服务器创建postgres复制配置。这些步骤类似于Ubuntu14.04上PostgreSQL 9.4与RepMgr和PgBouncer的复制。我使用repmgr + pgbouncer作为我的复制配置。假设我有两个主机dhost1和dhost2。Repmgr元数据db是repmgrdb,用户是repmgr_user。
dhost1有pgbouncer和Repmgr的配置,而且它是主程序。下面提到了Repmgr在dbhost1中的配置:
cluster = test
node = 1
node_name = dhost1
use_replication_slots = 1
conninfo='host=dhost1 user=repmgr_user dbname=repmgrdb'
pg_bindir=/usr/lib/postgresql/9.5/bin
## repmgr.conf at master ##dhost2还具有Repmgr的配置,并且处于从模式。下面提到了它的配置
cluster = test
node = 2
node_name = dhost2
use_replication_slots = 1
conninfo='host=dhost2 user=repmgr_user dbname=repmgrdb'
pg_bindir=/usr/lib/postgresql/9.5/bin
## repmgr.conf at slave ##我能够成功地注册到主服务器,并且可以在集群显示命令中看到主服务器。
在从服务器端,我使用pg_basebackup方法用命令克隆主机
repmgr -f /etc/repmgr/repmgr.conf --force -h dhost1_ip_address_goes_here> -U repmgr_user -d repmgrdb -v standby clone对于上面的命令,我得到以下错误:
[2016-08-08 10:05:26] [NOTICE] using configuration file "/etc/repmgr/repmgr.conf"
[2016-08-08 10:05:26] [NOTICE] setting data directory to: /var/lib/postgresql/9.5/main
[2016-08-08 10:05:26] [HINT] use -D/--data-dir to explicitly specify a data directory
[2016-08-08 10:05:26] [NOTICE] starting backup (using pg_basebackup)...
[2016-08-08 10:05:26] [HINT] this may take some time; consider using the -c/--fast-checkpoint option
[2016-08-08 10:05:31] [NOTICE] copying configuration files from master
[2016-08-08 10:05:31] [ERROR] aborting, remote host <dhost1_ip_address_goes_here> is not reachable.
[2016-08-08 10:05:31] [ERROR] unable to take a base backup of the master server>
[2016-08-08 10:05:31] [WARNING] destination directory (/var/lib/postgresql/9.5/main) may need to be cleaned up manually我还为postgres用户在dhost1和dhost2之间设置了无密码ssh。
此外,我还能从指挥部中获得pg_basebackup
pg_basebackup -h <dhost1_ip_address_goes_here> -P -v -U repmgr_user -X stream -D 9.5/main -R我是一个非常初学者的postgresql复制,请建议我的答案。
发布于 2016-09-06 14:07:49
我正在调查这件事。您可能需要再次运行该命令
-日志级的调试--详细的,应该提供更多关于那里发生的事情的信息.
发布于 2016-10-28 12:05:36
第一
rm -rf /var/lib/postgresql/9.5/main/*
第二
repmgr -h主主机名-p 5433 -U repmgr -d repmgr -D主-f /etc/repmgr.conf -拷贝-外部-config-file=pgdata-详细备份克隆
第三次
pg_ctl -D /var/lib/postgresql/9.5/main -log=/var/log/postgresql/postgres_-D_-D 4
-f /etc/ repmgr /repmgr.conf备用寄存器;
repmgr -f /etc/repmgr/repmgr.conf集群显示
https://stackoverflow.com/questions/38833060
复制相似问题