Discussion:
[ADMIN] postgresql-9.4-BDR replication issue
Mikhail Levandovskiy
2015-05-25 10:51:23 UTC
Permalink
Hi all.

I've installed postgresql-9.4 with BDR from its official repository, and
trying to create replication group with database on two nodes:
on first node runned:
CREATE EXTENSION btree_gist;
CREATE EXTENSION bdr;
SELECT bdr.bdr_group_create(local_node_name := 'node1',
node_external_dsn := 'host=10.10.1.39 dbname=bdrdemo2');

on second node runned:
CREATE EXTENSION btree_gist;
CREATE EXTENSION bdr;
SELECT bdr.bdr_group_join(local_node_name := 'node2', node_external_dsn
:= 'host=10.10.5.107 dbname=bdrdemo2', join_using_dsn :=
'host=10.10.1.39 dbname=bdrdemo2' );

And then getting this error on second node:
< 2015-05-25 03:38:37.714 PDT >LOG: starting background worker process
"bdr db: bdrdemo"
< 2015-05-25 03:38:37.731 PDT >ERROR: previous init failed, manual
cleanup is required
< 2015-05-25 03:38:37.731 PDT >DETAIL: Found bdr.bdr_nodes entry for
bdr (6152755282451262703,1,16407,) with state=i in remote bdr.bdr_nodes
< 2015-05-25 03:38:37.731 PDT >HINT: Remove all replication identifiers
and slots corresponding to this node from the init target node then drop
and recreate this database and try again
< 2015-05-25 03:38:37.732 PDT >LOG: worker process: bdr db: bdrdemo
(PID 25402) exited with exit code 1

I've tried to remove all replication slots on both nodes:
select * from pg_replication_slots;
select pg_drop_replication_slot('replication_slot_name');
tried to clean bdr.bdr_nodes, bdr.bdr_node_slots and bdr.bdr_connections,
tried to drop database and create it again - all was useless.

What's missed?

Thanks.
--
Sent via pgsql-admin mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Mikhail Levandovskiy
2015-05-25 11:38:29 UTC
Permalink
No, i've already runned

SELECT bdr.bdr_node_join_wait_for_ready();

on first and second nodes, and on first node it shows:
SELECT bdr.bdr_node_join_wait_for_ready();
bdr_node_join_wait_for_ready
------------------------------

(1 row)

but on second it hung.
This error may cause because of on node1 you did not execute the function bdr.bdr_node_join_wait_for_ready();
try to execute it and also execute it on second node after executing bdr.bdr_group_join(....).
--
Thanks & Regards,
Sagar R. Jadhav
Ph: +91-9552688400 / 7400
Skype ID: sagarjdhv24
www.shreeyansh.com
Post by Mikhail Levandovskiy
Hi all.
I've installed postgresql-9.4 with BDR from its official repository, and
CREATE EXTENSION btree_gist;
CREATE EXTENSION bdr;
SELECT bdr.bdr_group_create(local_node_name := 'node1',
node_external_dsn := 'host=10.10.1.39 dbname=bdrdemo2');
CREATE EXTENSION btree_gist;
CREATE EXTENSION bdr;
SELECT bdr.bdr_group_join(local_node_name := 'node2', node_external_dsn
:= 'host=10.10.5.107 dbname=bdrdemo2', join_using_dsn :=
'host=10.10.1.39 dbname=bdrdemo2' );
< 2015-05-25 03:38:37.714 PDT >LOG: starting background worker process
"bdr db: bdrdemo"
< 2015-05-25 03:38:37.731 PDT >ERROR: previous init failed, manual
cleanup is required
< 2015-05-25 03:38:37.731 PDT >DETAIL: Found bdr.bdr_nodes entry for
bdr (6152755282451262703,1,16407,) with state=i in remote bdr.bdr_nodes
< 2015-05-25 03:38:37.731 PDT >HINT: Remove all replication identifiers
and slots corresponding to this node from the init target node then drop
and recreate this database and try again
< 2015-05-25 03:38:37.732 PDT >LOG: worker process: bdr db: bdrdemo
(PID 25402) exited with exit code 1
select * from pg_replication_slots;
select pg_drop_replication_slot('replication_slot_name');
tried to clean bdr.bdr_nodes, bdr.bdr_node_slots and bdr.bdr_connections,
tried to drop database and create it again - all was useless.
What's missed?
Thanks.
--
http://www.postgresql.org/mailpref/pgsql-admin
--
------------------------
Best regards,
System Administration Dept.
NIX Solutions Ltd.
--
Sent via pgsql-admin mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Shreeyansh Dba
2015-05-25 12:16:14 UTC
Permalink
if you are trying to create new database the follow the steps

Exeute On both servers(nodes)
-create database new_bdrdemo;
-\c new_bdrdemo
-create extension btree_gist;
-create extension bdr;

_______________
On node1
-SELECT bdr.bdr_group_create(local_node_name := 'node1',
node_external_dsn := 'host=10.10.1.39 dbname=new_bdrdemo');

-SELECT bdr.bdr_node_join_wait_for_ready();

_____________________
On node2
-SELECT bdr.bdr_group_join(local_node_name := 'node2',
node_external_dsn := 'host=10.10.5.107 port=5432 dbname=new_bdrdemo',
join_using_dsn := 'host=10.10.1.39 port=5432 dbname=new_bdrdemo');

-SELECT bdr.bdr_node_join_wait_for_ready();


Thanks and Regards,
Sagar R. Jadhav
www.shreeyansh.com
Mikhail Levandovskiy
2015-05-25 13:05:32 UTC
Permalink
BDR replication link on new databases wokring properly.
Looks like something wrong with existing DBs...
Post by Shreeyansh Dba
if you are trying to create new database the follow the steps
Exeute On both servers(nodes)
-create database new_bdrdemo;
-\c new_bdrdemo
-create extension btree_gist;
-create extension bdr;
_______________
On node1
-SELECT bdr.bdr_group_create(local_node_name := 'node1',
node_external_dsn := 'host=10.10.1.39 dbname=new_bdrdemo');
-SELECT bdr.bdr_node_join_wait_for_ready();
_____________________
On node2
-SELECT bdr.bdr_group_join(local_node_name := 'node2',
node_external_dsn := 'host=10.10.5.107 port=5432 dbname=new_bdrdemo',
join_using_dsn := 'host=10.10.1.39 port=5432 dbname=new_bdrdemo');
-SELECT bdr.bdr_node_join_wait_for_ready();
Thanks and Regards,
Sagar R. Jadhav
www.shreeyansh.com <http://www.shreeyansh.com/>
--
------------------------
Best regards,
System Administration Dept.
NIX Solutions Ltd.
Loading...