1. Steps for server A to B:
a. Created below scripts for configure slony A to B.
i)initalize_IGRTEST.slonik
## Script for Initialization.
cluster name = igrtest;
node 1 admin conninfo = 'dbname=registrationlive host=192.168.137.158 user=postgres port=5432 password=adminedb';
node 2 admin conninfo = 'dbname=registrationlive host=192.168.137.163 user=postgres port=5432 password=adminedb';
init cluster (id = 1, comment = 'Primary node for slave');
#### Setting Store Nodes ###
store node (id = 2, event node = 1, comment = 'Slave Node For The Primary Node 1');
#### Storing all nodes in the Slony-I catalogs in schema _igrtest
store path(server = 1, client = 2, conninfo = 'dbname=registrationlive host=192.168.137.158 user=postgres port=5432 password=adminedb');
store path(server = 2, client = 1, conninfo = 'dbname=registrationlive host=192.168.137.163 user=postgres port=5432 password=adminedb');
[postgres@localhost slon_test]$
ii)create_set_SLONTEST.slonik
## Script for Create_set
cluster name = igrtest;
node 1 admin conninfo = 'dbname=registrationlive host=192.168.137.158 user=postgres port=5432 password=adminedb';
node 2 admin conninfo = 'dbname=registrationlive host=192.168.137.163 user=postgres port=5432 password=adminedb';
#-----------------------------
# Creating sets for Tables
#-----------------------------
#---- Set 1 --------#
try { create set (id = 1, origin = 1, comment = 'Set 1 for shadow'); } on error { echo 'Failed...set 1'; exit 1;}
echo 'Set 1 ...created';
set add table (set id = 1, origin = 1, id = 1, full qualified name = 'igr.igr_test', comment = 'Table igr.igr_test with primary key');
echo 'PKey table *** igr.igr_test *** added.';
#---- Set 2 --------#
try { create set (id = 2, origin = 1, comment = 'Set 2 for shadow'); } on error { echo 'Failed...set 2'; exit 1;}
echo 'Set 2 ...created';
set add table (set id = 2, origin = 1, id = 2, full qualified name = 'igr.igr_slon', comment = 'Table igr.igr_slon with primary key');
echo 'PKey table *** igr.igr_slon *** added.';
iii)Start primary and slave slony demons by using below script's.
Primary_start.sh
================
#!/bin/bash
DATE=$(date +%G%m%d)
SLONLOG="/tmp/slon_test/primary_$DATE.log"
/opt/PostgreSQL/9.2/bin/slon -s 1000 -d0 slontest 'host=192.168.137.158 dbname=slontest user=postgres password=adminedb port=5432' > $SLONLOG 2>&1 &
exit
Slave_start.sh
===============
#!/bin/bash
#
#
DATE=$(date +%G%m%d)
SLONLOG="/tmp/slon_test/slave_$DATE.log"
/opt/PostgreSQL/9.2/bin/slon -s 1000 -d0 slontest 'host=192.168.137.163 dbname=slontest user=postgres password=adminedb port=5432' > $SLONLOG 2>&1 &
exit
iv)Subscribe_set_IGRTEST.slonik
## Script for subscribe_set
cluster name = igrtest;
node 1 admin conninfo = 'dbname=registrationlive host=192.168.137.158 user=postgres port=5432 password=adminedb';
node 2 admin conninfo = 'dbname=registrationlive host=192.168.137.163 user=postgres port=5432 password=adminedb';
try { subscribe set (id = 1, provider = 1 , receiver = 2, forward = yes, omit copy = false); } on error { exit 1;}
echo 'Set 1 subscribed to nodes 1';
try { subscribe set (id = 2, provider = 1 , receiver = 2, forward = yes, omit copy = false); } on error { exit 1;}
echo 'Set 2 subscribed to nodes 1';
2. Steps for server A to C:
a) Created below scripts for configure slony A to C.
i) initalize_NEWBUILD.slonik
## Script for Initialization.
cluster name = newbuild;
node 3 admin conninfo = 'dbname=registrationlive host=192.168.137.158 user=postgres port=5432 password=adminedb';
node 4 admin conninfo = 'dbname=registrationlive host=192.168.137.164 user=postgres port=5432 password=adminedb';
init cluster (id = 3, comment = 'Primary node for slave');
#### Setting Store Nodes ###
store node (id = 4, event node = 3, comment = 'Slave Node For The Primary Node 3');
#### Storing all nodes in the Slony-I catalogs in schema _newbuild
store path(server = 3, client = 4, conninfo = 'dbname=registrationlive host=192.168.137.158 user=postgres port=5432 password=adminedb');
store path(server = 4, client = 3, conninfo = 'dbname=registrationlive host=192.168.137.164 user=postgres port=5432 password=adminedb');
ii) create_set_NEWBUILD.slonik
## Script for Create_set
cluster name = newbuild;
node 3 admin conninfo = 'dbname=registrationlive host=192.168.137.158 user=postgres port=5432 password=adminedb';
node 4 admin conninfo = 'dbname=registrationlive host=192.168.137.164 user=postgres port=5432 password=adminedb';
#-----------------------------
# Creating sets for Tables
#-----------------------------
#---- Set 3 --------#
try { create set (id = 3, origin = 3, comment = 'Set 3 for shadow'); } on error { echo 'Failed...set 3'; exit 1;}
echo 'Set 3 ...created';
set add table (set id = 3, origin = 3, id = 3, full qualified name = 'igr.igr_test', comment = 'Table igr.igr_test with primary key');
echo 'PKey table *** igr.igr_test *** added.';
#---- Set 3 --------#
try { create set (id = 4, origin = 3, comment = 'Set 4 for shadow'); } on error { echo 'Failed...set 4'; exit 1;}
echo 'Set 4 ...created';
set add table (set id = 4, origin = 3, id = 4, full qualified name = 'igr.igr_slon', comment = 'Table igr.igr_slon with primary key');
echo 'PKey table *** igr.igr_slon *** added.';
iii)Start primary and slave slony demons by using below script's.
Primary_start.sh
================
#!/bin/bash
DATE=$(date +%G%m%d)
SLONLOG="/tmp/slon_test/primary_$DATE.log"
/opt/PostgreSQL/9.2/bin/slon -s 1000 -d0 newbuild 'host=192.168.137.158 dbname=slontest user=postgres password=adminedb port=5432' > $SLONLOG 2>&1 &
exit
Slave_start.sh
===============
#!/bin/bash
#
#
DATE=$(date +%G%m%d)
SLONLOG="/tmp/slon_test/slave_$DATE.log"
/opt/PostgreSQL/9.2/bin/slon -s 1000 -d0 slontest 'host=192.168.137.164 dbname=slontest user=postgres password=adminedb port=5432' > $SLONLOG 2>&1 &
exit
iv) subscribe_set_NEWBUILD.slonik
## Script for subscribe_set
cluster name = newbuild;
node 3 admin conninfo = 'dbname=registrationlive host=192.168.137.158 user=postgres port=5433 password=adminedb';
node 4 admin conninfo = 'dbname=registrationlive host=192.168.137.164 user=postgres port=5432 password=adminedb';
try { subscribe set (id = 3, provider = 3 , receiver = 4, forward = yes, omit copy = false); } on error { exit 1;}
echo 'Set 3 subscribed to nodes 3';
try { subscribe set (id = 3, provider = 3 , receiver = 4, forward = yes, omit copy = false); } on error { exit 1;}
echo 'Set 4 subscribed to nodes 3';
a. Created below scripts for configure slony A to B.
i)initalize_IGRTEST.slonik
## Script for Initialization.
cluster name = igrtest;
node 1 admin conninfo = 'dbname=registrationlive host=192.168.137.158 user=postgres port=5432 password=adminedb';
node 2 admin conninfo = 'dbname=registrationlive host=192.168.137.163 user=postgres port=5432 password=adminedb';
init cluster (id = 1, comment = 'Primary node for slave');
#### Setting Store Nodes ###
store node (id = 2, event node = 1, comment = 'Slave Node For The Primary Node 1');
#### Storing all nodes in the Slony-I catalogs in schema _igrtest
store path(server = 1, client = 2, conninfo = 'dbname=registrationlive host=192.168.137.158 user=postgres port=5432 password=adminedb');
store path(server = 2, client = 1, conninfo = 'dbname=registrationlive host=192.168.137.163 user=postgres port=5432 password=adminedb');
[postgres@localhost slon_test]$
ii)create_set_SLONTEST.slonik
## Script for Create_set
cluster name = igrtest;
node 1 admin conninfo = 'dbname=registrationlive host=192.168.137.158 user=postgres port=5432 password=adminedb';
node 2 admin conninfo = 'dbname=registrationlive host=192.168.137.163 user=postgres port=5432 password=adminedb';
#-----------------------------
# Creating sets for Tables
#-----------------------------
#---- Set 1 --------#
try { create set (id = 1, origin = 1, comment = 'Set 1 for shadow'); } on error { echo 'Failed...set 1'; exit 1;}
echo 'Set 1 ...created';
set add table (set id = 1, origin = 1, id = 1, full qualified name = 'igr.igr_test', comment = 'Table igr.igr_test with primary key');
echo 'PKey table *** igr.igr_test *** added.';
#---- Set 2 --------#
try { create set (id = 2, origin = 1, comment = 'Set 2 for shadow'); } on error { echo 'Failed...set 2'; exit 1;}
echo 'Set 2 ...created';
set add table (set id = 2, origin = 1, id = 2, full qualified name = 'igr.igr_slon', comment = 'Table igr.igr_slon with primary key');
echo 'PKey table *** igr.igr_slon *** added.';
iii)Start primary and slave slony demons by using below script's.
Primary_start.sh
================
#!/bin/bash
DATE=$(date +%G%m%d)
SLONLOG="/tmp/slon_test/primary_$DATE.log"
/opt/PostgreSQL/9.2/bin/slon -s 1000 -d0 slontest 'host=192.168.137.158 dbname=slontest user=postgres password=adminedb port=5432' > $SLONLOG 2>&1 &
exit
Slave_start.sh
===============
#!/bin/bash
#
#
DATE=$(date +%G%m%d)
SLONLOG="/tmp/slon_test/slave_$DATE.log"
/opt/PostgreSQL/9.2/bin/slon -s 1000 -d0 slontest 'host=192.168.137.163 dbname=slontest user=postgres password=adminedb port=5432' > $SLONLOG 2>&1 &
exit
iv)Subscribe_set_IGRTEST.slonik
## Script for subscribe_set
cluster name = igrtest;
node 1 admin conninfo = 'dbname=registrationlive host=192.168.137.158 user=postgres port=5432 password=adminedb';
node 2 admin conninfo = 'dbname=registrationlive host=192.168.137.163 user=postgres port=5432 password=adminedb';
try { subscribe set (id = 1, provider = 1 , receiver = 2, forward = yes, omit copy = false); } on error { exit 1;}
echo 'Set 1 subscribed to nodes 1';
try { subscribe set (id = 2, provider = 1 , receiver = 2, forward = yes, omit copy = false); } on error { exit 1;}
echo 'Set 2 subscribed to nodes 1';
2. Steps for server A to C:
a) Created below scripts for configure slony A to C.
i) initalize_NEWBUILD.slonik
## Script for Initialization.
cluster name = newbuild;
node 3 admin conninfo = 'dbname=registrationlive host=192.168.137.158 user=postgres port=5432 password=adminedb';
node 4 admin conninfo = 'dbname=registrationlive host=192.168.137.164 user=postgres port=5432 password=adminedb';
init cluster (id = 3, comment = 'Primary node for slave');
#### Setting Store Nodes ###
store node (id = 4, event node = 3, comment = 'Slave Node For The Primary Node 3');
#### Storing all nodes in the Slony-I catalogs in schema _newbuild
store path(server = 3, client = 4, conninfo = 'dbname=registrationlive host=192.168.137.158 user=postgres port=5432 password=adminedb');
store path(server = 4, client = 3, conninfo = 'dbname=registrationlive host=192.168.137.164 user=postgres port=5432 password=adminedb');
ii) create_set_NEWBUILD.slonik
## Script for Create_set
cluster name = newbuild;
node 3 admin conninfo = 'dbname=registrationlive host=192.168.137.158 user=postgres port=5432 password=adminedb';
node 4 admin conninfo = 'dbname=registrationlive host=192.168.137.164 user=postgres port=5432 password=adminedb';
#-----------------------------
# Creating sets for Tables
#-----------------------------
#---- Set 3 --------#
try { create set (id = 3, origin = 3, comment = 'Set 3 for shadow'); } on error { echo 'Failed...set 3'; exit 1;}
echo 'Set 3 ...created';
set add table (set id = 3, origin = 3, id = 3, full qualified name = 'igr.igr_test', comment = 'Table igr.igr_test with primary key');
echo 'PKey table *** igr.igr_test *** added.';
#---- Set 3 --------#
try { create set (id = 4, origin = 3, comment = 'Set 4 for shadow'); } on error { echo 'Failed...set 4'; exit 1;}
echo 'Set 4 ...created';
set add table (set id = 4, origin = 3, id = 4, full qualified name = 'igr.igr_slon', comment = 'Table igr.igr_slon with primary key');
echo 'PKey table *** igr.igr_slon *** added.';
iii)Start primary and slave slony demons by using below script's.
Primary_start.sh
================
#!/bin/bash
DATE=$(date +%G%m%d)
SLONLOG="/tmp/slon_test/primary_$DATE.log"
/opt/PostgreSQL/9.2/bin/slon -s 1000 -d0 newbuild 'host=192.168.137.158 dbname=slontest user=postgres password=adminedb port=5432' > $SLONLOG 2>&1 &
exit
Slave_start.sh
===============
#!/bin/bash
#
#
DATE=$(date +%G%m%d)
SLONLOG="/tmp/slon_test/slave_$DATE.log"
/opt/PostgreSQL/9.2/bin/slon -s 1000 -d0 slontest 'host=192.168.137.164 dbname=slontest user=postgres password=adminedb port=5432' > $SLONLOG 2>&1 &
exit
iv) subscribe_set_NEWBUILD.slonik
## Script for subscribe_set
cluster name = newbuild;
node 3 admin conninfo = 'dbname=registrationlive host=192.168.137.158 user=postgres port=5433 password=adminedb';
node 4 admin conninfo = 'dbname=registrationlive host=192.168.137.164 user=postgres port=5432 password=adminedb';
try { subscribe set (id = 3, provider = 3 , receiver = 4, forward = yes, omit copy = false); } on error { exit 1;}
echo 'Set 3 subscribed to nodes 3';
try { subscribe set (id = 3, provider = 3 , receiver = 4, forward = yes, omit copy = false); } on error { exit 1;}
echo 'Set 4 subscribed to nodes 3';
No comments:
Post a Comment