0

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?

markus
  • 1,080
  • 5
  • 18
  • 38

1 Answers1

0

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.

Janne Pikkarainen
  • 31,852
  • 4
  • 58
  • 81