Postgresql repmgr错误:必须先定义主服务器,然后才能配置从服务器
我正在使用repmgr进行复制。我已成功将主节点注册到repmgr。我已成功克隆主节点并启动备用服务器。但问题是我无法在repmgr中注册备用节点 我使用的是repmgr 2.0beta1版本(PostgreSQL 9.3.2)。操作系统:Ubuntu 14.04 LTS 在注册备用节点时Postgresql repmgr错误:必须先定义主服务器,然后才能配置从服务器,postgresql,ubuntu,networking,ssh,repmgr,Postgresql,Ubuntu,Networking,Ssh,Repmgr,我正在使用repmgr进行复制。我已成功将主节点注册到repmgr。我已成功克隆主节点并启动备用服务器。但问题是我无法在repmgr中注册备用节点 我使用的是repmgr 2.0beta1版本(PostgreSQL 9.3.2)。操作系统:Ubuntu 14.04 LTS 在注册备用节点时 $ repmgr -f /etc/repmgr/repmgr.conf --verbose standby register Opening configuration file: /etc/repmgr/r
$ repmgr -f /etc/repmgr/repmgr.conf --verbose standby register
Opening configuration file: /etc/repmgr/repmgr.conf
[2015-03-31 11:43:19] [WARNING] pg_bindir//usr/lib/postgresql/9.3/bin: Unknown name/value pair!
[2015-03-31 11:43:19] [INFO] repmgr connecting to standby database
[2015-03-31 11:43:19] [INFO] repmgr connected to standby, checking its state
[2015-03-31 11:43:19] [INFO] repmgr connecting to master database
[2015-03-31 11:43:19] [INFO] finding node list for cluster 'test'
[2015-03-31 11:43:19] [INFO] checking role of cluster node 'host=127.0.0.1 user=repmgr_usr dbname=repmgr_db'
[2015-03-31 11:43:19] [ERROR] A master must be defined before configuring a slave
我犯了这个错误
在备用Postgres日志中:(日志连接=打开,日志断开=打开)
我在日志中遇到错误“无法从客户端接收数据:对等方重置连接”
在主Postgres日志上:(日志连接=打开,日志断开=打开)
我认为此日志中没有关于备用连接的详细信息。(我不确定我不知道)
Master repmgr.conf:
cluster=test
node=1
node_name=node1
conninfo='host=127.0.0.1 user=repmgr_usr dbname=repmgr_db'
pg_bindir=/usr/lib/postgresql/9.3/bin
备用repmgr.conf
cluster=test
node=2
node_name=node2
conninfo='host=localhost user=repmgr_usr dbname=repmgr_db'
pg_bindir='/usr/lib/postgresql/9.3/bin'
主备postgres.conf
listen_addresses='*'
wal_level = 'hot_standby'
archive_mode = on
archive_command = 'cd .'
max_wal_senders = 10
wal_keep_segments = 5000
hot_standby = on
log_connections = on
log_disconnections = on
master&stanby pg_hba.conf
host repmgr_db repmgr_usr 192.168.1.0/24 trust
host replication repmgr_usr 192.168.1.0/24 trust
host repmgr_db repmgr_usr 127.0.0.1/24 trust
host replication repmgr_usr 127.0.0.1/24 trust
备用节点中的群集详细信息:
$ repmgr -f /etc/repmgr/repmgr.conf cluster show
[2015-03-31 12:06:17] [WARNING] pg_bindir//usr/lib/postgresql/9.3/bin: Unknown name/value pair!
Role | Connection String
standby | host=127.0.0.1 user=repmgr_usr dbname=repmgr_db
主节点中的群集详细信息:
$ repmgr -f /etc/repmgr/repmgr.conf cluster show
[2015-03-31 12:07:46] [WARNING] pg_bindir//usr/lib/postgresql/9.3/bin: Unknown name/value pair!
Role | Connection String
* master | host=127.0.0.1 user=repmgr_usr dbname=repmgr_db
请帮我解决这个问题。最后我通过更改repmgr.conf文件解决了这个问题。我改变了主意
conninfo='host=localhost user=repmgr_usr dbname=repmgr_db'
与
i、 在配置文件中,我们必须给出集群解析的IP地址或名称。beta1?请更新至最新版本(2.0.2)或至少稳定版本。自beta1以来,许多错误已经修复。是的,我在repmgr 2.0(PostgreSQL 9.3.5)中尝试过。同样的错误。在那之前,一切都很好。嗨,我也有同样的问题。我不想重复同样的问题。你找到解决方案了吗?@yavuzs请在下面找到我的解决方案。如果不起作用,请告诉我。
$ repmgr -f /etc/repmgr/repmgr.conf cluster show
[2015-03-31 12:07:46] [WARNING] pg_bindir//usr/lib/postgresql/9.3/bin: Unknown name/value pair!
Role | Connection String
* master | host=127.0.0.1 user=repmgr_usr dbname=repmgr_db
conninfo='host=localhost user=repmgr_usr dbname=repmgr_db'
conninfo='host=192.168.1.205 user=repmgr_usr dbname=repmgr_db'