Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Jan 28, 2010 3:19 pm 
Offline
Newbie

Joined: Sun Nov 15, 2009 4:56 pm
Posts: 4
Website: http://aaroncouch.info
Location: Philadelphia, PA
I spent some time on this so wanted to share what I've learned, but also get feedback on a couple of items. It would be great if folks could take a look and let me know if this is correct.


Goal:
Have a basic IP failover without the overhead or automation of Heartbeat.

If a site goes down I want to have a script that will allow another server to grab the active IP address. I don't want to automate this so I can do a basic check before flipping the switch. If is a problem with the site switching servers will not necessarily solve anything.

Setup:

Server A with IP 1
Server B with IP 2
Swap IP 3

LAMP stack with Drupal site.

Pre Step:

1) Make sure apache and php settings are identical

2) Setup master / slave replication. Server A is master.

3) Setup identical files on Server A and B using rysnc and svn.

Steps to Setup Failover on Linode

1) Purchase additional IP address (IP 3) for Server A

2) Add IP 3 as a Failover for Server B: https://www.linode.com/members/linode/ipfailover.cfm

3) Add IP 3 as Eth0:1 on Server A and Server B

for Server A:

vim /etc/network/interfaces

Code:
auto eth0
iface eth0 inet static
  address 'IP 1'
  gateway 'IP 1 gateway'
  netmask 255.255.255.0

auto eth0:1
iface eth0:1 inet static
  address 'IP 3'
  gateway 'IP 3 gateway'
  netmask 255.255.255.0


for Server B:

vim /etc/network/interfaces

Code:
auto eth0
iface eth0 inet static
  address 'IP 2'
  gateway 'IP 2 gateway'
  netmask 255.255.255.0

auto eth0:1
iface eth0:1 inet static
  address 'IP 3'
  gateway 'IP 3 gateway'
  netmask 255.255.255.0


You can find the gateway information on your networking tab in your Linode account.

Restart networking on Server A.

Make sure Eth0:1 is setup correctly using 'ifconfig'.

4) Direct traffic for examplesite.com to 'IP 3'

You can do this through the Linode DNS manager.

5) Test switching traffic from Server A to Server B

Turn off eth0:1 on Server A:

Code:
ifdown eth0:1


Turn on eth0:1 on Server B:

Code:
ifup eth0:1


Send out a gratuitous arp request on Server B:

Code:
arping -I eth0:1 'IP 3' -uc 5


update /etc/hosts files on both servers to include their IP and reverse dns

6) Profit?

I would setup a script that would do the steps in '5'. I would also stop the mysql slave and rsync on Server B. This has worked during a test run.

Questions

a) Am I arping correctly? Everywhere I see documentation about this it says to use "arping -I -U 'IP'" but when I try to use that it gives a description of the usage. This is the 'ARPing 2.06' package I get on Ubuntu 9.10 which is installed through 'apt-get install arping'

b) The first time I tested this it took at least an hour to update. But once it did the first time using the steps in 5 the change was almost instant. Is the MAC address getting cached somewhere else than the ARP table? Is the ARP table not getting updated?

_________________
http://aaroncouch.info


Top
   
 Post subject:
PostPosted: Fri May 07, 2010 1:31 pm 
Offline
Senior Newbie

Joined: Tue Apr 27, 2010 9:57 am
Posts: 8
What a great post!

I m newbie and unable to answer your question.
But appreciate this tutorial.

I have tried to dig this forum for setting up HA on my linode(s). And this is the best post I have ever found.


Top
   
 Post subject:
PostPosted: Mon May 10, 2010 11:28 am 
Offline
Newbie

Joined: Sun Nov 15, 2009 4:56 pm
Posts: 4
Website: http://aaroncouch.info
Location: Philadelphia, PA
thanks. glad it was helpful. i've expanded it here: http://www.zivtech.com/blog/setting-bas ... ntu-linode

_________________
http://aaroncouch.info


Top
   
 Post subject:
PostPosted: Mon Apr 18, 2011 11:09 am 
Offline
Senior Newbie

Joined: Sun Jul 26, 2009 10:26 pm
Posts: 19
You have 'auto eth0:1' on both hosts. What if they are both rebooted?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group