Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking for simple fail-over solution. If the 92 server is down, the application should point to 91 server. I can check the connectivity by scripting the following commands.

[root@sserver shantanu]# nc -z 6379 > /dev/null; 
[root@server shantanu]# echo $?
[root@server shantanu]# nc -z 6379 > /dev/null; 
[root@server shantanu]# echo $?

I wanted to know if there is a better way to do this. Can I host my script on 92 server and check if 6379 local port is working. If it is down, forward the request to 6379 port of 91.

I am looking for simple solution that anyone can understand and manage. If there is no such option available, please suggest the softwares for the same purpose.

share|improve this question
up vote 1 down vote accepted

I suggect you don't use self-made-high-availability-scripts. They are not reliable, you can forgot about they, they don't save you from split brain situation.

In your case you should use the Virtual IP, that moves across two nodes of your cluster. There are a lot of software for this purposes:

  • lvs (ipvsadm);
  • heartbeat;
  • pacemaker+corosync (imo the best solution).
share|improve this answer

alternatively, the simple solution is to use a PING. Even the most sophisticated fail-overs use ping to check for connectivity. so just script ping command, then if ping fails for one, it should switch to another. your approach using netcat is also fine, no problem in that as well.

share|improve this answer

Your Answer


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.