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.

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 10.10.10.92 6379 > /dev/null; 
[root@server shantanu]# echo $?
1
[root@server shantanu]# nc -z 10.10.10.91 6379 > /dev/null; 
[root@server shantanu]# echo $?
0

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

2 Answers 2

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

 
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.