RE: piranha fos setup
Brian Beaver <[email protected]> Fri, 5 Dec 2003 09:57:16 -0500
| Newsgroups | gmane.linux.redhat.piranha |
|---|---|
| Message-ID | <2AB39DC75CB1D5119A4700B0D0218A0506A5F496@RSWMS02> |
Thanks so much for the response. I'll try your attached patch. Obviously my configs were just for basic testing - my start_cmd and stop_cmd that simply touch and remove files, would be replaced with the startup and shutdown commands for the db, and my test_ha.sh would be replaced by a valid db check. Are you saying that the send_program only executes on the failover box periodically, to perform a validation check on the primary? If this is the case, my test below would have to be slightly modified so that the test looking for a semaphore, (or existence of a file), would execute on the partner. Guess I was thinking this validation test_ha.sh script ran periodically on the primary node. Just to clarify another point - with either the C code changes below or the patch you supplied, I won't see fos trying to start or stop X.X.X.100:80 monitoring services, correct? Brian -----Original Message----- From: Sébastien Bonnet [mailto:[email protected]] Sent: Friday, December 05, 2003 3:49 AM To: [email protected] Subject: Re: piranha fos setup Hi Brian, > It appears that fos wants to monitor port 80 for cluster health, > even though I've omitted this port designation and am using > send_program within my lvs.cf If my memory's right, there's a bug which prevent using send_program correctly. If you have C programming skills, edit fos.c. Near line 300, you will find : *arg++ = strip_quotes (send_program); replace it by (program becomes str): + *arg++ = strip_quotes (send_str); But, I wonder if I haven't also made changes in nanny.c. If the above fix does not work, try the attached patch, which does fix ! > send_program = "/etc/sysconfig/ha/test_ha.sh" > start_cmd = "/bin/touch /tmp/primary" > stop_cmd = "/bin/rm /tmp/primary" > > test_ha.sh: > > #!/bin/sh > if [ -f /tmp/primary ]; then > echo "OK" > else > echo "FAIL" > fi Ouch ! I guess you have understood how it works. start_cmd and stop_cmd should be set to the commands used to start and stop your database. For example : start_cmd = "/bin/service postgresql start" stop_cmd = "/bin/service postgresql stop" The script should try to connect to the other host and check the DB is available. Keep in mind the script (actually the test nanny has to run) is only started regurarly on the backup node (the one the DB is not running on). If you have replication between both nodes, I understand your start and stop commands (you want both DBs to run simultaneously), but the script you still check the availability of the DB on the other host. If you set it up the way you did, you won't have failover because piranha is not able to know the DB on the other node has crashed ! Hope this help -- Sébastien Bonnet Centre de contacts - Experian France