Tue Jul 12 07:11:01 PDT 2005
- Previous message: [Slony1-general] Explaination of "Could slony replicate tables with OID?"
- Next message: [Slony1-general] about Execute SQL/DDL script and add new Subscribing Nodes to existing set
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello! All!
create.sql :
BEGIN;
create table tb_test4 (
INFO_ID NUMERIC(6) not null,
TO_NAME VARCHAR(256) null,
constraint PK_TB_TEST4 primary key (INFO_ID)
);
COMMIT ;
script exec.sh
#!/bin/sh
CLUSTERNAME=test1
MASTERDBNAME=test
MASTERPORT=8432
SLAVEDBNAME=test
SLAVEPORT=8432
MASTERHOST=10.10.10.67
SLAVEHOST=10.10.10.36
REPLICATIONUSER=master
PGBENCHUSER=master
export CLUSTERNAME MASTERDBNAME MASTERPORT SLAVEDBNAME SLAVEPORT MASTERHOST SLAVEHOST REPLICATIONUSER PGBENCHUSER
slonik <<_EOF_
cluster name = $CLUSTERNAME;
node 1 admin conninfo = 'dbname=$MASTERDBNAME host=$MASTERHOST user=$REPLICATIONUSER';
node 2 admin conninfo = 'dbname=$SLAVEDBNAME host=$SLAVEHOST user=$PGBENCHUSER';
EXECUTE SCRIPT (SET ID = 1 , FILENAME = '/u2/master/betty/create.sql' , EVENT NODE = 1 );
_EOF_
# exec.sh script end
1) read document :
SET ID = ival
The unique numeric ID number of the set affected by the script
this "SET ID" should is create by
create set (id=1, origin=1, comment='All pgbench tables');
appointed value of "id" options.is or not ?
2) exec script exec.sh show errors:
bash-2.03$ ./exec.sh
<stdin>:4: PGRES_FATAL_ERROR select "_test1".ddlScript(1, '
begin;
create table tb_test4 (
INFO_ID NUMERIC(6) not null,
TO_NAME VARCHAR(256) null,
constraint PK_TB_TEST4 primary key (INFO_ID)
);
COMMIT ;
', -1); - ERROR: unexpected error -8 in EXECUTE of query "
begin;
create table tb_test4 (
INFO_ID NUMERIC(6) not null,
TO_NAME VARCHAR(256) null,
constraint PK_TB_TEST4 primary key (INFO_ID)
);
COMMIT ;
"
CONTEXT: PL/pgSQL function "ddlscript_int" line 54 at execute statement
PL/pgSQL function "ddlscript" line 31 at perform
bash-2.03$
what's wrong with it ? if i use is error? for right.how to do it?
Question 2: about Subscribing Nodes
first : set up a set use script setCluster.sh
#!/bin/sh
CLUSTERNAME=test1
MASTERDBNAME=test
MASTERPORT=8432
SLAVEDBNAME=test
SLAVEPORT=8432
MASTERHOST=10.10.10.67
SLAVEHOST=10.10.10.36
REPLICATIONUSER=master
PGBENCHUSER=master
export CLUSTERNAME MASTERDBNAME MASTERPORT SLAVEDBNAME SLAVEPORT MASTERHOST SLAVEHOST REPLICATIONUSER PGBENCHUSER
slonik <<_EOF_
cluster name = $CLUSTERNAME;
node 1 admin conninfo = 'dbname=$MASTERDBNAME host=$MASTERHOST user=$REPLICATIONUSER';
node 2 admin conninfo = 'dbname=$SLAVEDBNAME host=$SLAVEHOST user=$PGBENCHUSER';
init cluster ( id=1, comment = 'Master Node');
table add key (node id = 1, fully qualified name = 'public.history');
create set (id=1, origin=1, comment='All pgbench tables');
set add table (set id=1, origin=1, id=1, fully qualified name = 'public.accounts', comment='accounts table');
set add table (set id=1, origin=1, id=2, fully qualified name = 'public.branches', comment='branches table');
set add table (set id=1, origin=1, id=3, fully qualified name = 'public.tellers', comment='tellers table');
set add table (set id=1, origin=1, id=4, fully qualified name = 'public.history', comment='history table', key = serial);
store node (id=2, comment = 'Slave node');
store path (server = 1, client = 2, conninfo='dbname=$MASTERDBNAME host=$MASTERHOST user=$REPLICATIONUSER');
store path (server = 2, client = 1, conninfo='dbname=$SLAVEDBNAME host=$SLAVEHOST user=$PGBENCHUSER');
store listen (origin=1, provider = 1, receiver =2);
store listen (origin=2, provider = 2, receiver =1);
_EOF_
second : if have need add node 3 to this set(cluster name=test1 and set id=1)
how to do it ? I read document about Subscribing Nodes chapter
slonik <<_EOF_
try {
echo 'Subscribing sets';
subscribe set (id = 1, provider=1, receiver=2, forward=yes);
subscribe set (id = 1, provider=1, receiver=3, forward=yes);
subscribe set (id = 1, provider=1, receiver=4, forward=yes);
} on error {
echo 'Could not subscribe the sets!';
exit -1;
}
_EOF_
my question is : when create "set 1" ?define "node 1 admin conninfo" and "node 2 admin conninfo" info (host , username , dbname).
when add node 3 to "set 1" , why not need define "node 3 admin conninfo" info? if no define,how to know relation info(host,username,dbname) of node 3?
how to add node 3 to this set ? what is the right use manner?
if you know ,Please help me! give some tip for that . Thank you for you help very much !
---------------------------------
DO YOU YAHOO!?
????G???????????????????
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gborg.postgresql.org/pipermail/slony1-general/attachments/20050712/43ba2184/attachment.html
- Previous message: [Slony1-general] Explaination of "Could slony replicate tables with OID?"
- Next message: [Slony1-general] about Execute SQL/DDL script and add new Subscribing Nodes to existing set
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-general mailing list