4

I've got two Ubuntu-Servers, each of them with two Ethernet cards. I'm trying to switch from one to the other for high availability purposes. Unfortunately, when querying arp I always get the MAC address of the first card (eth0) and not the one of the second card (eth1) whose IP-address has been dynamically assigned. What can I do?

Example:

Server 1:

Eth0

  • MAC: 00:11:11:11:11:11
  • IP: 192.168.0.1

Eth1

  • MAC: 02:33:33:33:33:33
  • IP: 192.168.0.3

Server 2:

Eth0

  • MAC: 00:22:22:22:22:22
  • IP: 192.168.0.2

Eth1

  • down (goes up with MAC and IP from server1 eth1 when server1 goes down)

When I execute the arp -a 192.168.0.3 command from a Windows machine, the result is 00:11:11:11:11:11 (eth0) and not 02:33:33:33:33:33 (eth1)

splattne
  • 103
dan
  • 41

2 Answers2

2

What you're trying to do is not impossible, but not optimal neither...

Back in the XXth century, we used to do exactly what you're trying to do now, but now in the XXIst century, we use bonding which gives you both reliability and higher throughput when both cards are up.

So forget about 2 IP addresses on 2 NICS, go for 1 IP address on both NICS and take advantage of double the throughput!

:-)

Fabby
  • 35,017
0

What you are trying to do is called a "high-availability cluster". The basic idea of a high-availability cluster is that each cluster member has it's own IP address (usually used only for management) and the cluster has its own different IP address.

Usually this kind of setup is managed by dedicated software, but you can try to play with home-grown scripts.

Basically:

  • On each server, bond the two NICs, obtaining a highly available NIC on each server.
  • Assign the cluster IP to this new NIC on server A. Check that you can access the services.
  • De-assign the cluster IP from server A, assign it on server B. Check that you can access the services.

Now continue by figuring how to make sure that only one of the two servers has possession of the cluster IP, how to make sure that the server which does not have the cluster IP refuses to accept requests, how to synchronize the state between the servers etc. etc.

AlexP
  • 10,435