Forum Discussion
hwidjaja_37598
May 30, 2009Altostratus
I think you need to create a script and use a cron job to periodically synchronize the configuration.
As an example, this script will detect which unit got the latest config (PULL/PUSH Mode). You can add it to the cronjob on both unit. It will initiate ConfigSync from the active unit only.
!/usr/bin/perl
use BigDB;
use strict;
my ($LockFile) = "/tmp/autocs.lck";
my ($bigpipe) = "/bin/bigpipe";
my ($Status);
Exit when lock file is exist,
to prevent launching duplicate process
if (-f $LockFile){
print "Another process is currently running ... \n";
exit 0;
}
Creating lock file
open (fil, ">$LockFile") || die "error creating lock file $LockFile";
close (fil);
Open BigDB
my ($hBigDB, $Status) = &bigdb_open;
&CheckErr('Error: bigdb_open');
If Configsync.State is not Synchronized and the script is run
from active unit then do ConfigSync
if (
&BigDB("Configsync.State") !~ /synchronized/i
&& system("/usr/bin/failover_status | grep -vi active >/dev/null")
){
If LocalConfigTime is bigger than PeerConfigTime then Push Mode
Else Pull Mode
if (
&BigDB("Configsync.LocalConfigTime") > &BigDB("Configsync.PeerConfigTime")
) {
system "$bigpipe config sync";
} else {
system "$bigpipe config sync pull";
}
}
close bigdb
&bigdb_close;
Remove lock file
unlink $LockFile;
exit 0;
sub BigDB {
my ($Key) = @_;
my ($Val, $Status) = &bigdb_fetch($hBigDB, $Key);
&CheckErr("Error: BigDB ($Key)");
return ($Val);
}
sub CheckErr {
if ($Status) {
print $_[0];
exit $Status;
}
}
Make sure you have reviewed and tested the script before deploying to your production unit. Use it at your own risk.