Thread: Issues setting up BDR with multiple databases
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;
-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.
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.
On 19 June 2015 at 08:09, Jorge Torralba <jorge.torralba@gmail.com> wrote: > 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) Interesting - it looks like it's connecting to the wrong DB at this step. You've also posted this as a github issue, and I'm following up there rather than on the mailing list. Lets keep the discussion in one place. https://github.com/2ndQuadrant/bdr/issues/88 -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services