Wed Feb 2 17:25:37 PST 2005
- Previous message: [Slony1-commit] By cbbrowne: Alter documentation to reflect the renaming of "$SETNAME"
- Next message: [Slony1-commit] By cbbrowne: Improved discussion of FAILOVER and why it is vital that it
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Log Message:
-----------
Major additions to comments by Steve Simms
Modified Files:
--------------
slony1-engine/tools/altperl:
slon.env (r1.9 -> r1.10)
-------------- next part --------------
Index: slon.env
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/slon.env,v
retrieving revision 1.9
retrieving revision 1.10
diff -Ltools/altperl/slon.env -Ltools/altperl/slon.env -u -w -r1.9 -r1.10
--- tools/altperl/slon.env
+++ tools/altperl/slon.env
@@ -1,72 +1,124 @@
-# -*- perl -*-
# $Id$
# Author: Christopher Browne
# Copyright 2004 Afilias Canada
+# Revised extensively by Steve Simms
+# Keeping the following three lines for backwards compatibility in
+# case this gets incorporated into a 1.0.6 release.
+#
+# TODO: The scripts should check for an environment variable
+# containing the location of a configuration file. That would
+# simplify this configuration file and allow Slony-I tools to still work
+# in situations where it doesn't exist.
+#
if ($ENV{"SLONYNODES"}) {
require $ENV{"SLONYNODES"};
} else {
- # Define environment locally...
- $CLUSTER_NAME=flex2test;
- $LOGDIR='/opt/logs/slon';
- $SLON_BIN_PATH='/opt/OXRS/dbs/pgsql74/bin';
- #$APACHE_ROTATOR="/opt/OXRS/apache/rotatelogs"; # optional path to Apache rotatelog tool
-
- add_node(host => 'marge', dbname=>'transtest', port=>5532,
- user=>'postgres', password=>'postgres', node=>1);
-
- add_node(host => 'marge', dbname=>'transreplica', port=>5533,
- user=>'postgres', password=>'postgres', node=>2, parent=>1);
-
- add_node(host => 'marge', dbname=>'transreplica', port=>5534, user=>'postgres',
- password=>'postgres', node=>3, parent=>1);
-
- # add_node(host => 'marge', dbname=>'flexnodeb', port=>5532,user=>'postgres',
- # password=>'postgres', node=>4, parent=>3);
-
- # add_node(host => 'marge', dbname=>'flexnodec', port=>5532,user=>'postgres',
- # password=>'postgres', node=>5, parent=>4);
-
- # add_node(host => 'marge', dbname=>'flexnoded', port=>5532,user=>'postgres',
- # password=>'postgres', node=>6, parent=>3);
- # add_node(host => 'marge', dbname=>'flexnodee', port=>5532,user=>'postgres',
- # password=>'postgres', node=>7, parent=>6, noforward=>'no');
+
+ # The name of the replication cluster. This will be used to
+ # create a schema named _$CLUSTER_NAME in the database which will
+ # contain Slony-related data.
+ $CLUSTER_NAME = 'replication';
+
+ # The directory where Slony should record log messages. This
+ # directory will need to be writable by the user that invokes
+ # Slony.
+ $LOGDIR = '/var/log/slony';
+
+ # The directory containing the slon and slonik executables
+ $SLON_BIN_PATH = '/usr/local/pgsql/bin';
+
+ # (Optional) If you would like to use Apache's rotatelogs tool to
+ # manage log output, uncomment the following line and ensure that
+ # it points to the executable.
+ #
+ # $APACHE_ROTATOR = '/usr/local/apache/bin/rotatelogs';
+
+ # Which node is the default master for all sets?
+ $MASTERNODE = 1;
+
+ # Include add_node lines for each node in the cluster. Be sure to
+ # use host names that will resolve properly on all nodes
+ # (i.e. only use 'localhost' if all nodes are on the same host).
+ # Also, note that the user must be a superuser account.
+
+ add_node(node => 1,
+ host => 'server1',
+ dbname => 'database',
+ port => 5432,
+ user => 'postgres',
+ password => '');
+
+ add_node(node => 2,
+ parent => 1,
+ host => 'server2',
+ dbname => 'database',
+ port => 5432,
+ user => 'postgres',
+ password => '');
+
+ add_node(node => 3,
+ parent => 1,
+ host => 'server3',
+ dbname => 'database',
+ port => 5432,
+ user => 'postgres',
+ password => '');
}
+# Keeping the following three lines for backwards compatibility in
+# case this gets incorporated into a 1.0.6 release.
+#
+# TODO: The scripts should check for an environment variable
+# containing the location of a configuration file. That would
+# simplify this configuration file and allow Slony tools to still work
+# in situations where it doesn't exist.
+#
if ($ENV{"SLONYSET"}) {
require $ENV{"SLONYSET"};
} else {
- # Table and Sequence Numbering - controlled here...
+ # The first ID to use for tables and sequences that are added to
+ # the replication cluster. This must be unique across the
+ # cluster.
+ #
+ # TODO: This should be determined automatically, which can be done
+ # fairly easily in most cases using psql. create_set should
+ # derive it, and give an option to override it with a specific
+ # value.
$TABLE_ID=1;
$SEQUENCE_ID=1;
- # These are the tables that already have primary keys, that therefore do
- # not need for Slony-I to add sequences/indices
+ # This array contains a list of tables that already have primary
+ # keys.
@PKEYEDTABLES=(
+ 'table1',
+ 'table2'
);
- # These are tables with candidate primary keys; we assume Slony
- # isn't smart enough (yet) to discover the key.
-
+ # For tables that have unique not null keys, but no primary key,
+ # enter their names and indexes here.
%KEYEDTABLES=(
- table1 => 'index_on_table1',
- table2 => 'index_on_table2'
+ 'table3' => 'index_on_table3',
+ 'table4' => 'index_on_table4'
);
- # Here are the tables to be replicated that do NOT have unique
- # keys, to which Slony-I will have to add a key field
+ # If a table does not have a suitable key or set of keys that can
+ # act as a primary key, Slony can add one.
+ #
+ # Note: The Slony development team does not recomment this
+ # approach -- you should create your own primary keys instead.
@SERIALTABLES=(
+ 'table5'
);
- # These are the applications' sequences that are to be
- # replicated
+ # Sequences that need to be replicated should be entered here.
@SEQUENCES=(
- "seq1",
- "seq2",
- "seq3"
+ 'sequence1',
+ 'sequence2'
);
}
-$MASTERNODE ||= 1; # Set MASTER node only if not set above...
+
+# Please do not add or change anything below this point.
1;
- Previous message: [Slony1-commit] By cbbrowne: Alter documentation to reflect the renaming of "$SETNAME"
- Next message: [Slony1-commit] By cbbrowne: Improved discussion of FAILOVER and why it is vital that it
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-commit mailing list