IP Address change for Active Passive Appliances

From Swivel Knowledgebase
Jump to: navigation, search



Overview

This document outlines the procedures for changing the IP address on PINsafe Servers using Active Passive appliances with DRBD replication.

The HA config can only be tested where the IP addresses and network configurations are consistent with the local address settings. This means IP addresses may need changing as part of the installation process. This section describes the changes required on the assumption that a HA pair have been built and now need to be installed with different IP addresses.

Each server has an internal address that is used for communications between the servers an external IP address. Further more there is a virtual cluster IP address that is used by whichever server is on−line. Therefore there is a total of five IP addresses PrimaryExternal, Primary Internal, StandbyExternal, StandbyInternal, Virtual

Prerequisites

Have read and followed the information in IP Address change for PINsafe servers How to Guide

Unless otherwise stated, the listed processes needs completing on both servers.


Stopping Services

The steps are required on both servers.

Start the server but then stop the HA services and TOMCAT


service heartbeat stop

service drbd stop

service tomcat5 stop

TOMCAT should only be running on the primary server.


Change Networking Information

Within Xwindows change the network settings for the for each interface to match the new settings, (or command line where Xwindows is not available). This includes changing the IP addresses, gateway addresses and DNS settings and host settings. If the two servers are going to be connected via a cross−over cable then the settings for the internal IP addresses need not be changed. Once you have changed these settings you need to restart the network services.


Start Network Services

service network restart

At this point test that you can ping each machine from the other via the internal interface eg run on the primary server

ping 172.16.0.2

If you have changed the internal IP addresses or are not using the default host names, you need to edit the /etc/drbd.conf file to change the following entries,

on primary.swivelsecure.local { device /dev/drbd0; disk /dev/sda9; address 172.16.0.1:7788; meta−disk internal; } and on standby.swivelsecure.local { device /dev/drbd0; disk /dev/sda9; address 172.16.0.2:7788; meta−disk internal; }

to reflect the internal IP addresses and host names used.


Start DRBD

Restart the drbd service on both servers

service drbd start


Check DRBD is working

Check the status by running cat /proc/drbd.

If the status is not connected and consistent run:

drbdadm −− −−do−what−I−say primary all

To bring them into a consistent state.


Configure Heartbeat

The heartbeat ip addresses and host name settings also need to be changed. Edit the

/etc/ha.d/ha.cf

file on each server.

You need to change the following settings.

ucast eth0 192.168.0.36 ucast eth1 172.16.0.2

On the primary server the eth0 settings needs to match the external IP address of the standby server and the eth1 setting needs to match the internal IP address of the standby server. On the standby server the eth0 settings needs to match the external IP address of the primary server and the eth1 setting needs to match the internal IP address of the primary server.

The following settings must match the hostnames used for the pair.

node primary.swivelsecure.local node standby.swivelsecure.local

The ping address needs to match the default gateway address. The heartbeat will ping this address to determine if it still has network.

ping 192.168.0.254

The ha resources file, /etc/ha.d/haresources needs to be edited to reflect the virtual cluster IP address and hostnames to be used. The IP address represents the Virtual IP.

primary.swivelsecure.local IPaddr::192.168.0.38/24/eth0 drbddisk::webapps \ Filesystem::/dev/drbd0::/usr/local/apache−tomcat−5.5.15/webapps::ext3 \ tomcat5 MailTo::changethis@swivelsecure.com::PINsafe standby.swivelsecure.local MailTo::changethis@swivelsecure.com::PINsafeStandby

Enter a valid and relevant email address; this is the email address to which emails are sent in the event of a server failure.


Start the Heartbeat

Start the heartbeat by running service heartbeat start

Check /var/log/messages for log messages from heartbeat. The messages should indicate that both links (assuming the external interfaces are connected to a network) on each machine are up. On the primary server confirm that Tomcat is running (ps ax | grep java) and that the virtual IP has been taken over on the external interface (ifconfig).


Configure the Mon service

Edit the /etc/mon/mon.cf file to reflect the virtual IP address being used.

  1. # group definitions (hostnames or IP addresses) # hostgroup pinsafe 192.168.0.38


Testing

Use the following command to check the servers are synchronised:

cat /proc/drbd

Expected Results:

primary

 drbd driver loaded OK; device status:
 version: 0.7.14 (api:77/proto:74)
 SVN Revision: 1989 build by buildcentos@build-i386, 2006-03-18 19:03:54
 0: cs:Connected st:Primary/Secondary ld:Consistent
 ns:8492552 nr:22716 dw:8515268 dr:284982 al:106 bm:2286 lo:0 pe:0 ua:0 ap:0

secondary

 drbd driver loaded OK; device status:
 version: 0.7.14 (api:77/proto:74)
 SVN Revision: 1989 build by buildcentos@build-i386, 2006-03-18 19:03:54
 0: cs:Connected st:Secondary/Primary ld:Consistent
 ns:22716 nr:10565672 dw:10588388 dr:36158 al:20 bm:128 lo:0 pe:0 ua:0 ap:0

Check that the file systems are mounted on the active server:

df –k

Expected results:

 /dev/drbd0            9.5G  145M  8.9G   2% /usr/local/apache-tomcat-5.5.15/webapps