LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Whats the best way to switch IP Addresses between servers in a redundant architecture (https://www.linuxquestions.org/questions/linux-newbie-8/whats-the-best-way-to-switch-ip-addresses-between-servers-in-a-redundant-architecture-665440/)

helptonewbie 08-26-2008 02:29 AM

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?

Cheers,
Regards

trickykid 08-26-2008 09:20 AM

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.

helptonewbie 08-26-2008 12:14 PM

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.

Cheers


All times are GMT -5. The time now is 09:09 PM.