Operating System - HP-UX
1758396 Members
2475 Online
108868 Solutions
New Discussion юеВ

Re: how to syncronize failover server with a modified file on primary server ?

 
Sammy_2
Super Advisor

how to syncronize failover server with a modified file on primary server ?

I am trying to create a failover powerbroker (server2) server and want a particular configuration file (/etc/pb.conf) to be scp from primary (server1) to server2,if it gets modified (cksum of the file/file modification).


How can I do it ?


P.S:Password less ssh authentication is already enabled between 2 servers so that I can scp with no problems.
good judgement comes from experience and experience comes from bad judgement.
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: how to syncronize failover server with a modified file on primary server ?

Shalom Sammy

scp -p /etc/pb.conf server2:/etc

I think the problem is that if you failover, you can't be sure of having access to the primary servers configuration.

I suggest a regularly run cron job to scp it to an alternate location on the backup server. Then you can use diff in a script to see changes.

Or you could use rsync via ssh to keep the files in sync all the time.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Sammy_2
Super Advisor

Re: how to syncronize failover server with a modified file on primary server ?

Shalom SEP,
Thanks for the response.
I did something similiar to what you suggested. I do cksum of the current file (pb.conf) and put it in a /tmp/pb.temp file. Then I run the script thru cron nightly and compare current cksum of pb.conf with the one in pb.temp and see if there is a differece. if there is, I scp the file over to remote server.
I could have scp the file to failover server every night but I thought maybe I should ohly do it if /etc/pb.conf
is modified.

Thanks for making me think.
good judgement comes from experience and experience comes from bad judgement.
Sammy_2
Super Advisor

Re: how to syncronize failover server with a modified file on primary server ?

Thanks SEP. I think I have what I need.
good judgement comes from experience and experience comes from bad judgement.
PeterWolfe
Respected Contributor

Re: how to syncronize failover server with a modified file on primary server ?

rdist/rsync are the canonical answers as mentioned
by SEP. Another alternative is cfengine.
This is available with HP-UX starting
with 11.23 December 05.

cfengine is too big a hammer for a single
file, but if you find you have other aspects
of the systems that you'd like to synchronize,
it could be the right approach.

pete