简体   繁体   English

PostgreSQL BDR复制问题

[英]Postgresql BDR Replication issue

I am trying to setup 2-node BDR replication and i am getting the following error while running bdr_init_copy. 我正在尝试设置2节点BDR复制,并且在运行bdr_init_copy时遇到以下错误。

These are the steps: 这些步骤是:

mkdir /postgres/pgsql-9.4/data

/usr/pgsql-9.4/bin/pg_basebackup -h 10.10.145.111 -p 5432 -X stream -U postgres -D /postgres/pgsql-9.4/data

cp /postgres/pgsql-9.4/data_old/postgresql.conf /postgres/pgsql-9.4/data
cp /postgres/pgsql-9.4/data_old/pg_hba.conf /postgres/pgsql-9.4/data
chmod -R 700 /postgres/pgsql-9.4/data

/usr/pgsql-9.4/bin/bdr_init_copy -d "host=10.10.145.111 dbname=apimgtdb port=5432" -U postgres --local-dbname="host=10.10.145.110 dbname=apimgtdb port=5432" -n nodeawswest -D  /postgres/pgsql-9.4/data

i am getting the following error: 我收到以下错误:

2015-06-05 14:56:55.951 PDT >LOG:  entering standby mode
2015-06-05 14:56:55.951 PDT >LOG:  starting up replication identifier with ckpt at 9/F5000060
2015-06-05 14:56:55.956 PDT >LOG:  redo starts at 9/F5000060
2015-06-05 14:56:55.972 PDT >LOG:  consistent recovery state reached at 9/F5000128
2015-06-05 14:56:55.972 PDT >LOG:  database system is ready to accept read only connections
2015-06-05 14:56:55.977 PDT >LOG:  started streaming WAL from primary at 9/F6000000 on timeline 1
2015-06-05 14:56:56.639 PDT >LOG:  recovery stopping at restore point "bdr_6157013497737678047", time 2015-06-05 14:56:57.137408-07
2015-06-05 14:56:56.640 PDT >LOG:  recovery has paused
2015-06-05 14:56:56.640 PDT >HINT:  Execute pg_xlog_replay_resume() to continue.
2015-06-05 14:56:56.821 PDT >ERROR:  cannot execute DELETE in a read-only transaction
2015-06-05 14:56:56.821 PDT >STATEMENT:  DELETE FROM pg_catalog.pg_shseclabel WHERE provider = 'bdr';
2015-06-05 14:56:56.837 PDT >LOG:  received smart shutdown request
2015-06-05 14:56:56.838 PDT >FATAL:  terminating walreceiver process due to administrator command
2015-06-05 14:56:56.840 PDT >LOG:  shutting down
2015-06-05 14:56:58.169 PDT >LOG:  database system is shut down

Its not starting the second node after this error. 错误发生后,它没有启动第二个节点。

I was able to fix my broken BDR on one node with the following steps: 我可以通过以下步骤在一个节点上修复损坏的BDR:

$ mv /var/lib/pgsql-9.4/data /var/lib/pgsql-9.4/data-bkp-94
$ mkdir /var/lib/pgsql-9.4/data
$ /usr/pgsql-9.4/bin/pg_basebackup -h 10.10.145.111 -p 5432 -X stream -U postgres -D /var/lib/pgsql-9.4/data
$ /etc/init.d/postgresq-9.4 restart

The bdr_init_copy step is not needed as you already copy the data from node 2 to node 1. 不需要bdr_init_copy步骤,因为您已经将数据从节点2复制到节点1。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM