1832973 Members
2384 Online
110048 Solutions
New Discussion

Cluster files check

 
SOLVED
Go to solution
Sanjiv Sharma_1
Honored Contributor

Cluster files check

Hi,

I have a two node(2*N4000/HP-UX 11.00/MCSG) cluster with total 6 packages running. 3 on each node.

The 6 different packages belongs to 6 different owners and hence it has been seen that these owners makes some changes while working on one node based on their requirement and is not updated in the 2nd node.

Now when one node fails and the package comes on the 2nd node it has been found that either the package will fail to start(say a new lvol has been added) or some of the application may not work(say entry has not been made in the /etc/services or cron.allow).

My question is:

Is there a script or a way through which I can check whether if any changes has been made in active node so that I can update the file/files in the standby node too respective to the package?

Thanks,
Sanjiv.
Everything is possible
8 REPLIES 8
John Poff
Honored Contributor

Re: Cluster files check

Hi,

There are a couple of ways around this. One way is to take the filesystem where they are making changes and put it into the package. If that won't work, you could write a script to check for file changes and copy them to the failover node, or even just copy them on a daily basis.

We use a script that provides daily information about our systems and it does a 'diff' on certain files and output of commands [vgdisplay -v, swlist -l product, etc.] between the current date and the previous date. If anything has changed it sends us an e-mail.

JP

Sanjiv Sharma_1
Honored Contributor

Re: Cluster files check

Hi John,

Thanks for your advice.

Can you give me the script?
Everything is possible
John Poff
Honored Contributor

Re: Cluster files check

I'm at home now so I don't have easy access to the script. I'll post some of it when I get to work in the morning.

The gist of it is that you have a text file with the previous days file you are checking, so you rename that and get a current copy of the file. Then, you do a 'diff' on the two files and send any output as e-mail to yourself. It's even handy for a shop with several Unix admins who don't always communicate what they are working on between themselves.

JP
Sanjiv Sharma_1
Honored Contributor

Re: Cluster files check

Hi John,
Thanks again. I will be waiting for the script.
Everything is possible

Re: Cluster files check

Raje,

I use rdist to keep these things in sync (it needs .rhosts files, but I'm guessing you have those anyway in a SG cluster)

rdist is very easy to configure, simply create a configuration file on your master which details the hosts to distribute to, and the files to distribute in the format:

HOSTS = ( node1 node2
node3 ... nodeN )

FILES = ( file1 file2
File3 ... fileN )

${FILES} -> ${HOSTS}
install -R ;


e.g. We have a three node cluster with nodes dilbert, dogbert and ratbert, we have nominated dilbert as our master. We have one package called oracle with three files that must be distributed (/etc/cmcluster/oracle/oracle.cntl, /etc/cmcluster/oracle/oramon.sh, and /etc/cmcluster/oracle/sqlnetmon.sh). Our rdistfile is installed as dilbert:/etc/cmcluster/rdist.cfg, and contains the following:

HOSTS = ( dilbert dogbert ratbert )

FILES = ( /etc/cmcluster/oracle/oracle.cntl
/etc/cmcluster/oracle/oramon.sh
/etc/cmcluster/oracle/sqlnetmon.sh
)

${FILES} -> ${HOSTS}
install -R ;

Now whenever we make any change to our package files on dilbert, we can distribute these changes to the other servers using the command:

rdist ???f /etc/cmcluster/rdist.cfg

If I am controlling the cluster I just do this manually... if others are responsible for it I might consider popping the above command in roots crontab on my 'master' host.

HTH

Duncan


I am an HPE Employee
Accept or Kudo
Sanjiv Sharma_1
Honored Contributor

Re: Cluster files check

Hi Duncan,

rdist seems to be good.

But I still prefer to have a script which can help me to find the difference of the important files between there two nodes?

Can someone give me or help me to write this script?

Thanks,
Everything is possible

Re: Cluster files check

well producing a 'remote diff' should be fairly straightforward...


e.g.

compare file /etc/cmcluster/pkg1/pkg1.cntl on two hosts to local file:


file_to_diff=/etc/cmcluster/pkg1/pkg1.cntl
for node in node2 node3
do
echo "Differences on ${node}"
remsh ${node} "cat ${file_to_diff}" | diff ${file_to_diff} -
done

Hope this helps some...

Regards,

Duncan

I am an HPE Employee
Accept or Kudo
Geoff Wild
Honored Contributor
Solution

Re: Cluster files check

Talk to your HP Account Rep - there is an excellent tool called - CCMON.

Cluster Consistency Monitor

It details changes in your environment and is entirely customizable...

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.