Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have a system consisting of different components/services like database, webserver, fileshare, some self programmed daemons, etc. We now have the requirement to make all components/services redundant. As we want to start with a smaller system, we do not have for all services a separate server. For example we have web server (tomcat) and file server (nfs share) on the same machine. We are currently trying to implement this with heartbeat (www.linux-ha.org). It's not clear to me if we can assign different virtual IP addresses to different services. If e.g. the tomcat server crashes and doesn't come up again, we need to redirect all traffic to the backup machine. If there is only a problem with tomcat, there is no need to switch also the nfs share to the backup server.

If I see correctly, heatbeat can only switch the complete server node and can’t do it per service (assign different virtual ip address per service). It also can’t detect if a service (in our case tomcat or the nfs share) is available or not. Is there a way to implement what we need using heatbeat maybe in combination with another tool, or do we need to move on with another approach? Any suggestions are welcome.

UPDATE: Another approach I'm thinking about is to assign a virtual IP for each process. Than use nagios to monitor all processes. In case of a failure of a process, Nagios can delete the virtual ip assigned to the service and assign it to the backup server. This can be done by some shell scrips doing it. Is this a good idea?

share|improve this question

1 Answer 1

I think Heartbeat was designed with a complete server node failover in mind, so even if you can make this somehow work, I think it involves risks.

That said, you sure can assign a different virtual ip address or even several per service in haresources.config like this:

yourservernode IPaddr::10.0.0.1 IPaddr::10.0.0.2 Filesystem::/dev/yourdisk::/mountpoint/fstype::mountoptions nameforyourtomcatservicename
yourservernode IPaddr::10.0.0.3 Filesystem::/dev/yourdisk::/mountpoint/fstype::mountoptions nameforyournfsservice

... but I fear that in case some service at yourservernode goes down, everything gets transferred to other nodes you have listed in ha.cf.

Also, with 2+ nodes things get more complex with CRM. Do you have only 2 nodes or more?

(My information might be outdated since I have experience with Heartbeat v2.1.x.)

Could you run a load-balancer in front of your Tomcat and keep Tomcat running at all the nodes? Then the load-balancer could detect if Tomcat crashes at some node and stop forwarding traffic to that node until it comes back alive.

share|improve this answer
    
I only have 2 nodes. Have you seen my UPDATE, what do you think about that approch with nagios and shell scripts? –  markus Sep 22 '11 at 10:46
    
Wow, that's creative. :) Gotta think about that while I'm going to lunch and reply you when I get back. –  Janne Pikkarainen Sep 22 '11 at 10:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.