On Dec 12, 2007 6:50 AM, <[EMAIL PROTECTED]> wrote:

> On Dec 12, 2007 12:13 AM, Josh Harrison <[EMAIL PROTECTED]> wrote:
> > Is there any special commands that should be used to execute the slonik
> > scripts?
> > What is slon_tools.conf. Should this be configured for using slony1?
> > thanks
> > josh
>
> You should read slony's documentation [1]. But this particular
> question can be answered by reading about the altperl administrative
> scripts [2].
>
> [1] http://www.slony.info/documentation/
> [2] http://www.slony.info/documentation/adminscripts.html
>
>
Thanks
I rad the above manual and tried to replicate the database as given in
this... http://www.slony.info/documentation/firstdb.html

These are the steps that I did.
1. set the shell variables like clustername,masterdbname etc thro export
command
2. created a user 'josh' with 'somepassword'
3. createdb -O $PGBENCHUSER -h $MASTERHOST $MASTERDBNAME
    createdb -O $PGBENCHUSER -h $SLAVEHOST $SLAVEDBNAME
    pgbench -i -s 1 -U $PGBENCHUSER -h $MASTERHOST $MASTERDBNAME
4.createlang -h $MASTERHOST plpgsql $MASTERDBNAME
5.pg_dump -s -U $REPLICATIONUSER -h $MASTERHOST $MASTERDBNAME | psql -U
$REPLICATIONUSER -h $SLAVEHOST $SLAVEDBNAME
6. pgbench -s 1 -c 5 -t 1000 -U $PGBENCHUSER -h $MASTERHOST $MASTERDBNAME

7. slony1 was configured using --perltools option. I copied
slon_tools.conf-sample to slon_tools.conf and placed it in the /etc dir.
This is my conf file (deleted the commented lines here for clarity)

-------------------------------------------------------------
if ($ENV{"SLONYNODES"}) {
    require $ENV{"SLONYNODES"};
} else {

    $CLUSTER_NAME = 'slony_example';
    $LOGDIR = 'export/home/sjothirajah/slony1';
    # $APACHE_ROTATOR = '/usr/local/apache/bin/rotatelogs';
    # SYNC check interval (slon -s option)
    # $SYNC_CHECK_INTERVAL = 1000;
    $MASTERNODE = 1;
    add_node(node     => 1,
             host     => 'localhost',
             dbname   => 'pgbench',
             port     => 5432,
             user     => 'josh',
             password => 'somepassword');

    add_node(node     => 2,
             host     => 'localhost',
             dbname   => 'pgbenchslave',
             port     => 5432,
             user     => 'josh',
             password => 'somepassword');
}
$SLONY_SETS = {
    "set1" => {
        "set_id" => 1,
        "table_id"    => 1,
        "sequence_id" => 1,
        "pkeyedtables" => [
                          'accounts',
                          'tellers',
                          'branches',
                          ],
        "serialtables" => ["history"],
    },
};
if ($ENV{"SLONYSET"}) {
    require $ENV{"SLONYSET"};
}
1;
--------------------------------------------------------------

8. slonik_init_cluster | slonik
<stdin>:10: Set up replication nodes
<stdin>:13: Next: configure paths for each node/origin
<stdin>:16: Replication nodes prepared
<stdin>:17: Please start a slon replication daemon for each node

9. slon_start 1
......
Slon successfully started for cluster slony_example, node node1
Start the watchdog process as well...

10.slon_start 2
...
Slon successfully started for cluster slony_example, node node2
PID [16697]
Start the watchdog process as well...

11. slonik_create_set 1
cluster name = slony_example;
 ....
.....
  echo 'All tables added';

12. slonik_subscribe_set 1  2 | slonik
<stdin>:4: PGRES_FATAL_ERROR select "_slony_example".subscribeSet(1, 1, 2,
't');  - ERROR:  Slony-I: subscribeSet(): set 1 not found

What is this error? What am I doing wrong here? When i check the
pgbenchslave  database, the table rows are not replicated?
Please advice
Thanks
josh
_______________________________________________
Slony1-general mailing list
[email protected]
http://lists.slony.info/mailman/listinfo/slony1-general

Reply via email to