[GENERAL] Issues setting up BDR with multiple databases

2015-06-18 Thread Jorge Torralba
On NODE 1

create database christian;

create user christian with password 'christian';

alter database christian owner to christian;


create database lizzie;

create user lizzie with password 'lizzie';

alter database lizzie owner to lizzie;


create database jorge;

create user jorge with password 'jorge';

alter database lizzie owner to jorge;


\c christian;

create extension btree_gist;

create extension bdr;

select bdr.bdr_group_create ( local_node_name := 'dbadevpgha03',
node_external_dsn := 'host=10.5.101.176 port=5432 dbname=christian' );

SELECT bdr.bdr_node_join_wait_for_ready();

select * from bdr.bdr_nodes;



\c lizzie;

create extension btree_gist;

create extension bdr;

select bdr.bdr_group_create ( local_node_name := 'dbadevpgha03',
node_external_dsn := 'host=10.5.101.176 port=5432 dbname=lizzie' );

SELECT bdr.bdr_node_join_wait_for_ready();

select * from bdr.bdr_nodes;



\c jorge;

create extension btree_gist;

create extension bdr;

select bdr.bdr_group_create ( local_node_name := 'dbadevpgha03',
node_external_dsn := 'host=10.5.101.176 port=5432 dbname=jorge' );

SELECT bdr.bdr_node_join_wait_for_ready();

select * from bdr.bdr_nodes;


On NODE 2


-bash-4.1$ bdr_init_copy -D /var/lib/pgsql/9.4-bdr/data -n dbadevpgha04 -d
"host=10.5.101.176 dbname=jorge port=5432"
--local-dbname="host=10.5.101.179 dbname=jorge"

bdr_init_copy: starting ...

Getting remote server identification ...

Detected 3 BDR database(s) on remote server

Updating BDR configuration on the remote node:

 christian: validating BDR configuration ...

 christian: creating replication slot ...

 christian: creating node entry for local node ...

 jorge: validating BDR configuration ...

 jorge: creating replication slot ...

 jorge: creating node entry for local node ...

 lizzie: validating BDR configuration ...

 lizzie: creating replication slot ...

 lizzie: creating node entry for local node ...

Creating base backup of the remote node...

52504/52504 kB (100%), 1/1 tablespace

Creating restore point on remote node ...

Bringing local node to the restore point ...

Transaction log reset

Initializing BDR on the local node:

 christian: adding the database to BDR cluster ...

Could not add local node to cluster, status PGRES_FATAL_ERROR: ERROR:  node
identity for local dsn does not match current node

DETAIL:  The dsn 'dbname=jorge host=10.5.101.179' connects to a node with
identity (6161869759719318325,2,16389) but the local node is
(6161869759719318325,2,16385)

HINT:  The node_local_dsn (or, for bdr, dsn if node_local_dsn is null)
parameter must refer to the node you're running this function from

CONTEXT:  SQL statement "SELECT bdr.internal_begin_join(

'bdr_group_join',

local_node_name,

CASE WHEN node_local_dsn IS NULL THEN node_external_dsn ELSE
node_local_dsn END,

join_using_dsn)"

PL/pgSQL function bdr_group_join(text,text,text,text,integer,text[]) line
21 at PERFORM




Thanks for looking.














-- 
Thanks,

Jorge Torralba


Note: This communication may contain privileged or other confidential
information. If you are not the intended recipient, please do not print,
copy, retransmit, disseminate or otherwise use the information. Please
indicate to the sender that you have received this email in error and
delete the copy you received. Thank You.


[GENERAL] Issues trying to run bdr_init_copy with new setup

2015-06-16 Thread Jorge Torralba
Just started playing with BDR. Originally setup the environment on two
separate servers as per the quick start guid and used the sql commands to
add nodes. Moving on to command line, I am running into some issues.

I am sure I am just overlooking something really simple. But, on the
primary node I created two databases and created two groups. one within
each database. No issues so far. However, now on the 2nd node, I want to
add it to the cluster using bdr_init_copy. It partially works but then it
dies as you can see below.

/var/lib/pgsql/9.4-bdr/data

-bash-4.1$ rm -rf *

-bash-4.1$ bdr_init_copy -D /var/lib/pgsql/9.4-bdr/data -n node2 -d
'host=10.5.101.176 port=5432' --local-dbname='host=10.5.101.179 port=5432'

bdr_init_copy: starting ...

Getting remote server identification ...

Detected 2 BDR database(s) on remote server

Updating BDR configuration on the remote node:

 abc: validating BDR configuration ...

 abc: creating replication slot ...

 abc: creating node entry for local node ...

 xyz: validating BDR configuration ...

 xyz: creating replication slot ...

 xyz: creating node entry for local node ...

Creating base backup of the remote node...

44543/44543 kB (100%), 1/1 tablespace

Creating restore point on remote node ...

Bringing local node to the restore point ...

Transaction log reset

Initializing BDR on the local node:

 abc: adding the database to BDR cluster ...

*Could not add local node to cluster, status PGRES_FATAL_ERROR: ERROR:
getting remote node id failed*

DETAIL:  SELECT sysid, timeline, dboid FROM bdr.bdr_get_local_nodeid()
failed with: ERROR:  schema "bdr" does not exist


CONTEXT:  SQL statement "SELECT *   FROM
bdr_get_remote_nodeinfo(node_local_dsn)"

PL/pgSQL function internal_begin_join(text,text,text,text) line 41 at SQL
statement

SQL statement "SELECT bdr.internal_begin_join(

'bdr_group_join',

local_node_name,

CASE WHEN node_local_dsn IS NULL THEN node_external_dsn ELSE
node_local_dsn END,

join_using_dsn)"

PL/pgSQL function bdr_group_join(text,text,text,text,integer,text[]) line
21 at PERFORM

-- 
Thanks,

Jorge Torralba


Note: This communication may contain privileged or other confidential
information. If you are not the intended recipient, please do not print,
copy, retransmit, disseminate or otherwise use the information. Please
indicate to the sender that you have received this email in error and
delete the copy you received. Thank You.