Hi List,
I've setup 2 openldap servers in n-way multimaster replication mode in a test environment, both run centos 6.2, this works well but now i'm trying to make these 2 servers failover using heartbeat. i've got no experience with heartbeat (or setting up clusters in general) however from what i understand heartbeat starts/stops the service if the server has the virtual IP assigned or not. this would be fine for httpd , but since replication doesn't work when slapd is stopped i was wondering if anyone knows if there is a way to setup heartbeat with a hot standby? so that the service keeps running but the ip does gets reassigned when one goes down.
Thanks, Wessel
Wessel van der Aart wrote:
Hi List,
I've setup 2 openldap servers in n-way multimaster replication mode in a test environment, both run centos 6.2, this works well but now i'm trying to make these 2 servers failover using heartbeat. i've got no experience with heartbeat (or setting up clusters in general) however from what i understand heartbeat starts/stops the service if the server has the virtual IP assigned or not. this would be fine for httpd , but since replication doesn't work when slapd is stopped i was wondering if anyone knows if there is a way to setup heartbeat with a hot standby? so that the service keeps running but the ip does gets reassigned when one goes down.
A slight clarification: what happens on a failover cluster is that you've got heartbeat running, and each machine looks to see if the other's still alive. At this point, one is live, and the other's standby. If/when the standby notices it cannot see - even a ping - the other address, or it can be configured to look for a service, such as doing a default search (for apache, that might be a wget ImAlive.html) - it tells the system to assert the IP, and turns up all services for which it's been configured.
I haven't done it, but I'd say you could easily configure heartbeat to check, and if the IP's visible, but the service times out, to tell the live one to turn down services, and to take over primaryhood.
Hope that's clearer.
mark
On 05/23/2012 03:39 PM, m.roth@5-cent.us wrote:
Wessel van der Aart wrote:
Hi List,
I've setup 2 openldap servers in n-way multimaster replication mode in a test environment, both run centos 6.2, this works well but now i'm trying to make these 2 servers failover using heartbeat. i've got no experience with heartbeat (or setting up clusters in general) however from what i understand heartbeat starts/stops the service if the server has the virtual IP assigned or not. this would be fine for httpd , but since replication doesn't work when slapd is stopped i was wondering if anyone knows if there is a way to setup heartbeat with a hot standby? so that the service keeps running but the ip does gets reassigned when one goes down.
A slight clarification: what happens on a failover cluster is that you've got heartbeat running, and each machine looks to see if the other's still alive. At this point, one is live, and the other's standby. If/when the standby notices it cannot see - even a ping - the other address, or it can be configured to look for a service, such as doing a default search (for apache, that might be a wget ImAlive.html) - it tells the system to assert the IP, and turns up all services for which it's been configured.
I haven't done it, but I'd say you could easily configure heartbeat to check, and if the IP's visible, but the service times out, to tell the live one to turn down services, and to take over primaryhood.
Hope that's clearer.
mark
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Thanks Mark, that does make it more clear, i've made a setup and heartbeat does that by default, when heartbeat shuts down it's stops slapd as well and assignes the ip to machine2 and starts slapd there , what i want is that it already has slapd running on the failover but still checks that service for availability. that way i won't have an outdated database on the failover ldap server. would you know if there is a way of making heartbeat not sending the stop command to a particular resource or do i need write a script to (not) do this? i wouldn't mind a script but if that function is already there i'd rather use that one.
Thanks, Wessel
Dear Wessel,
I'd do the following.
give both servers a static non changing IP:
ldapA.yourdomain.tld, e.g. 10.0.0.1 on eth0 ldapB.yourdomain.tld, e.g. 10.0.0.2 on eth0
These two IPs will always be the same. You can access ldapA or ldapB anytime via it's designated name.
For failover, use an alias:
ldap.yourdomain.tld, e.g. 10.0.0.3 on eth0:0 on the active node
Don't tell heartbeat of openldap and everything should be good.
Brgds
Thanks Mark, that does make it more clear, i've made a setup and heartbeat does that by default, when heartbeat shuts down it's stops slapd as well and assignes the ip to machine2 and starts slapd there , what i want is that it already has slapd running on the failover but still checks that service for availability. that way i won't have an outdated database on the failover ldap server. would you know if there is a way of making heartbeat not sending the stop command to a particular resource or do i need write a script to (not) do this? i wouldn't mind a script but if that function is already there i'd rather use that one.
Thanks, Wessel
Wessel,
Just pass heartbeat an IP, not a service. If you use IPaddr2 it will also send a gratuitous ARP that will cut down the failover time.
eg.
primarynode.mycompany.com IPaddr2::10.10.10.50/24/eth0
All the services will stay running, if you want to do service checks to watch slapd to see if it breaks you can use the "mon" project to kickoff a heartbeat failover.
-Tait
Hi Benjamin, Tait,
Thanks for the advice, setting up heartbeat to look for an IP was easy, monitoring looks a bit more complex so i'll have to dive into that. at least now i know the right direction to look for,
Thanks, Wessel
On 05/28/2012 09:01 PM, Tait Clarridge wrote:
Thanks Mark, that does make it more clear, i've made a setup and heartbeat does that by default, when heartbeat shuts down it's stops slapd as well and assignes the ip to machine2 and starts slapd there , what i want is that it already has slapd running on the failover but still checks that service for availability. that way i won't have an outdated database on the failover ldap server. would you know if there is a way of making heartbeat not sending the stop command to a particular resource or do i need write a script to (not) do this? i wouldn't mind a script but if that function is already there i'd rather use that one.
Thanks, Wessel
Wessel,
Just pass heartbeat an IP, not a service. If you use IPaddr2 it will also send a gratuitous ARP that will cut down the failover time.
eg.
primarynode.mycompany.com IPaddr2::10.10.10.50/24/eth0
All the services will stay running, if you want to do service checks to watch slapd to see if it breaks you can use the "mon" project to kickoff a heartbeat failover.
-Tait
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos