Whats the best way to switch IP Addresses between servers in a redundant architecture
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Whats the best way to switch IP Addresses between servers in a redundant architecture
Hi All,
I've been working on a simple method to switch IP Addresses between two servers, and before i get to far again i thought i'd go and check what other people thought.
One method i've used before is to:
machine A 192.168.0.2
machine B 192.168.0.3
Main IP address of service 192.168.0.1
Make the IP 192.168.0.1 an alias address that moves between the two servers when required for failover. Restart any running services on the other box so that the new ip is realized.
Second method i've also tried before:
machine A 192.168.0.2
machine B 192.168.0.3
Main IP address of service 192.168.0.1
and then getting the IP to move between machines by re-writing the network config files on the server that set the ip address settings for an interface...and then making the server stop and start the interface so that the new network config settings are used and the server is using not an aliased ip but a real one.
Obviously using an Alias has its advantages is there any service that could run into problems using an ip alias such as samba or ldap etc etc...or is IP Alias done on a different layer and therefore the service like ldap and samba itself is un-ware of it using an alias and not having any problems using that method?
Are you simply just trying to achieve a failover between these two servers? You should probably just look into using a round-robin approach within DNS. What you've outlined probably isn't an ideal way of switching between servers to sort of load balance them.
If you're just looking for a quick way to switch a server when one fails manually though, the above would work. Just write yourself a script to bring up the new IP from the server that goes down, using an alias is probably the easiest approach between the two.
Cheers Trick, i thought one of those methods would be ok...there's no load balencing involved on this one..difficult to do so for a few reasons..if there was i'd probably use LVS anyway.
Thanks for the advice much apreciated my main concern was how different services would cope working off a server with IP Alias's.
The other thing is which is along the same lines...i know of send_arp that you get with the project 'fake' and 'ha-project' to refresh arp tables of the change in MAC address when IP move to other server, and i wondered if the send_arp of these other project ...or perhaps you can tell me what if any advantage there is using send_arp??
If you don't know....no worries and i'll go down the arping route and give that a whirl.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.