The continuing saga of Buckaroo Croft in LVS land....

Edward Croft <[email protected]>
Newsgroups gmane.linux.redhat.piranha
Organization Open Ratings, Inc.
Message-ID <[email protected]>
Many thanks to those that helped me to resolve the LVS portion of my
project. I now have load balancing to my http servers working like a
charm. I still have the DBS portion of the project that does not seem to
work. In this case, I am using FOS. I don't see many examples utilizing
FOS. Most are using lvs for load balancing. Anyway, here is my lvs.cf
from my db servers. Note the send is a script I wrote that actually
pulls data from the db server rather than just sensing if the process
was running. It responds OK if it can retrieve data, Failed, if it does
not. I have included the start and stop scripts also, since those use
su. I don't know under which user piranha runs, so that could be part of
the problem since it needs to su to user postgres to start/stop the db.

lvs.cf

serial_no = 22
primary = 10.0.13.5
service = fos
backup_active = 1
backup = 10.0.13.6
heartbeat = 1
heartbeat_port = 539
keepalive = 6
deadtime = 18
network = direct
reservation_conflict_action = preempt
debug_level = 2
failover spdb {
     address = 10.0.13.30 aft0:1
     vip_nmask = 255.255.255.0
     active = 1
     timeout = 6
     send_program = "/scripts/check_pgsql_alive"
     expect = "OK"
     start_cmd = "/scripts/startdb"
     stop_cmd = "/scripts/stopdb"
}




startdb

cd /var/lib/pgsql/data
su - postgres -c "/var/lib/pgsql/data/start_db"
echo "started db"


stopdb

cd /var/lib/pgsql/data
su - postgres -c "/var/lib/pgsql/data/stop_db"
echo "stopped db"


I had originally put the su - postgres..... in the start_cmd/stop_cmd
fields, but figured this might work better as the dbadmin created the
/var/lib/pgsql/data/start_db script to use the current directory for the
log anticipating that it would be started in the /var/lib/pgsql/data
directory. Go figure!

Anyway, You quickly helped me to resolve phase 1, the LVS servers. I can
only hope that someone can figure this one out too.
BTW, if I manually run the check_pgsql_alive script, I do get OK if the
server is running and failed if not. Also, if I manually start the
server, I can get to it from the shared address. 

TIA, Ed Croft
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.