| Sun.betty 2005-07-11, 3:24 am |
|
Hello,everyone.
in practice slonyI . come into contact with some question like this.if you know,please give some tip for me.Thanks very much !
question 1:
test=# EXECUTE SCRIPT (SET ID = 1 , FILENAME = '/u2/master/betty/create.sql' , EVENT NODE = 1 );
exec command show errors :
ERROR: syntax error at or near "ID" at character 21
why ? this is read document do it .
create.sql :
create table COMPANY_INFO (
INFO_ID NUMERIC(6) not null,
TO_NAME VARCHAR(256) null,
constraint PK_COMPANY_INFO primary key (INFO_ID)
);
COMMIT TRANSACTION ;
help say:
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 ?
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=mast
er
PGBENCHUSER=master
export CLUSTERNAME MASTERDBNAME MASTERPORT SLAVEDBNAME SLAVEPORT MASTERHOST SLAVEHOST REPLICATIONUSER PGBENCHUSER
slonik <<_EOF_
cluster name = $CLUSTERNAME;
node 1 admin conninfo = 'dbname=$MASTERDBNAM
E host=$MASTERHOST user=$REPLICATIONUSE
R';
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=$MA
STERDBNAME host=$MASTERHOST user=$REPLICATIONUSE
R');
store path (server = 2, client = 1, conninfo='dbname=$SL
AVEDBNAME 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 setid=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,d
bname) of node 3?
and couldn't this need to come true ? how to do it ?
Thank you for your help.
---------------------------------
DO YOU YAHOO!?
ÑÅ»¢Ãâ·ÑGÓÊÏä£_Öйúµ
ÚÒ»¾øÎÞÀ¬»øÓʼþɧÈų
¬´óÓÊÏä
|