[clue-tech] Linux-HA and openLDAP problem

adam bultman adamb at glaven.org
Wed Aug 10 14:56:20 MDT 2005


I'm setting up a linux-ha 'cluster" with two servers.  Both run openLDAP 
2.1.

I'm using the ldap init script to set variables and to specify which 
slapd.conf file I want - if the "balanced" ip address exists on the 
server, then it user slapd.master.conf. If the ip address isn't on the 
server, it uses slapd.slave.conf.

The failover of linux-ha using heartbeat works fine; they restart ldap 
just as neatly as you please.

However, my sensing of who is master and who is slave isn't working 
right.  In the ldap init script is set_options, which calls ifconfig. 
pipes things through grep, sed, and awk, and then finally returns the 
result: the IP addreess if it is master, and nothing if it is slave.

Then, there's a bash if statement which tells if it has the address or 
the no value, and then runs slapd with the conf file.

Problem:  I stop a node by stopping heartbeat, and the other node kicks 
in. LDAP is properly restarted with the master slapd.conf, and things 
are fine.  the slave node restarts ldap (I put a call to ldap restart in 
the heartbeat script's stop function)..  I restart heartbeat on the 
server.  The new "master" gets the ip address,  and starts slapd with 
the master conf file.  However, the slave restarts ldap, runs ifconfig, 
and then... notice s that it has the virtual ip, and restarts slapd as 
the master.

No amountof resetting variables, sleeping, or anything like that manages 
to make the slave restart ldap with the correct configuration, and it's 
really starting to tick me off something awful.

If you have ideas, apart from "just do master/slave and forget it" or 
"use more sleep calls", feel free to let me know...

Adam
_______________________________________________
CLUE-tech mailing list
CLUE-tech at cluedenver.org
http://cluedenver.org/mailman/listinfo/clue-tech



More information about the clue-tech mailing list