|
Home > Archive > Slony1 PostgreSQL Replication > July 2005 > Changing sync interval with slon_start.pl
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Changing sync interval with slon_start.pl
|
|
| Ian Burrell 2005-07-25, 8:29 pm |
| It was suggested that we increase the sync check interval (-s). We
are using slon_start to the daemons. The value (-s 1000) is hardcoded
in slon-tools.pm. Instead of editing that file, I added support for
setting the value in the conf file.
The appended patch adds a new config variable, $SYNC_CHECK_INTERVAL
,
to slon_tools.conf and uses it in start_slon. It maintains the
current defaultt of 1000, although shouldn't it have the true default
of 1000. It also does some refactoring of the construction of the
command line.
- Ian
Index: tools/altperl/slon-tools.pm
=3D=3D=3D=3D=3D=3D=3
D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3
D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3
D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/slon-tools.=
pm,v
retrieving revision 1.23
diff -u -b -B -r1.23 slon-tools.pm
--- tools/altperl/slon-tools.pm=0913 Jun 2005 14:37:25 -0000=091.23
+++ tools/altperl/slon-tools.pm=0925 Jul 2005 21:20:43 -0000
@@ -134,20 +134,20 @@
sub start_slon {
my ($nodenum) =3D @_;
my ($dsn, $dbname) =3D ($DSN[$nodenum], $DBNAME[$nodenum]);
- my $cmd;
- `mkdir -p $LOGDIR/slony1/node$nodenum`;
+ $SYNC_CHECK_INTERVAL
||=3D 1000;
+ system("mkdir -p $LOGDIR/slony1/node$nodenum");
+ my $cmd =3D "@@PGBINDIR@@/slon -s $SYNC_CHECK_INTERVAL
-d2
$CLUSTER_NAME '$dsn' 2>&1 ";
if ($APACHE_ROTATOR) {
- $cmd =3D "@@PGBINDIR@@/slon -s 1000 -d2 $CLUSTER_NAME '$dsn' 2>&1 |
$APACHE_ROTATOR \"$LOGDIR/slony1/node$nodenum/" . $dbname .
"_%Y-%m-%d_%H:%M:%S.log\" 10M&";
+ $cmd .=3D "| $APACHE_ROTATOR \"$LOGDIR/slony1/node$nodenum/" .
$dbname . "_%Y-%m-%d_%H:%M:%S.log\" 10M &";
} else {
my $now=3D`date '+%Y-%m-%d_%H:%M:%S'`;
chomp $now;
- $cmd =3D "@@PGBINDIR@@/slon -s 1000 -d2 -g 80 $CLUSTER_NAME '$dsn'
2>&1 > $LOGDIR/slony1/node$nodenum/$dbname-$now.log &";
+ $cmd .=3D "> $LOGDIR/slony1/node$nodenum/$dbname-$now.log &";
}
print "Invoke slon for node $nodenum - $cmd\n";
- system $cmd;
+ system($cmd);
}
=20
-
$killafter=3D"00:20:00"; # Restart slon after this interval, if there
is no activity
sub query_slony_status {
my ($nodenum) =3D @_;
Index: tools/altperl/slon_tools.conf-sample
=3D=3D=3D=3D=3D=3D=3
D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3
D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3
D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/slon_tools.=
conf-sample,v
retrieving revision 1.5
diff -u -b -B -r1.5 slon_tools.conf-sample
--- tools/altperl/slon_tools.conf-sample=0910 Mar 2005 17:50:03 -0000=091.5
+++ tools/altperl/slon_tools.conf-sample=0925 Jul 2005 21:20:43 -0000
@@ -31,6 +31,9 @@
#
# $APACHE_ROTATOR =3D '/usr/local/apache/bin/rotatelogs';
=20
+ # SYNC check interval (slon -s option)
+ # $SYNC_CHECK_INTERVAL
=3D 1000;
+
# Which node is the default master for all sets?
$MASTERNODE =3D 1;
| |
| Christopher Browne 2005-07-25, 8:29 pm |
| Ian Burrell wrote:
>It was suggested that we increase the sync check interval (-s). We
>are using slon_start to the daemons. The value (-s 1000) is hardcoded
>in slon-tools.pm. Instead of editing that file, I added support for
>setting the value in the conf file.
>
>The appended patch adds a new config variable, $SYNC_CHECK_INTERVAL
,
>to slon_tools.conf and uses it in start_slon. It maintains the
>current defaultt of 1000, although shouldn't it have the true default
>of 1000. It also does some refactoring of the construction of the
>command line.
>
>
Looks good; applied.
|
|
|
|
|