Thursday, September 3, 2009

How to: IPMP Load Balancing & Resilience in Solaris

P Multipathing (IPMP) in Sun Solaris enables the load balancing capabilities and resilience for Network connections with multple Network Interface Cards (NIC).

Discussed here is about providing resilience for network connections with multiple NICs on the system.

Now, we take it to the next step and make the network connections not only resilient but also load balance the network connections such that both the NICs participating in IPMP are active and forwards traffic. This improves the network throughput and thereby efficiency of the server especially if it is a critical system serving multiple connections.

The requirements to configure IPMP for load balancing are:

1. Two Virtual IP Addresses. These IPs are used by the Applications for data.

2. Test IP Address for each NIC. These IPs are not used by applications and are only used to prode a remote target device to check connectivity.

3. Each Interface has unique MAC-Address. By default in SPARC platforms, all NICs have a System-wide MAC-Address assigned and so they share a single MAC-Address.

The NICs doesn’t have to be of the same kind but have to be of the same speed (10/100/1000Mbps).

In our configuration,

192.168.1.99 – Virtual IP1

192.168.1.100 – Virtual IP2

192.168.1.101 – Test IP for ce0 (NIC1)

192.168.1.102 – Test IP for ce1 (NIC2)

appserver – Actual hostname

appserver-1 – Hostname for Data IP2

appserver-2 – Hostname for Data IP2

appserver-ce0 – Hostname for test IP on ce0 interface

appserver-ce1 – Hostname for test IP on ce1 interface

Add Host Entries in /etc/hosts

Let’s start with adding the hosts entries for the IP addresses in the /etc/hosts file.

# IPMP group appserver-ipmp
127.0.0.1 localhost
192.168.1.99 appserver-1 loghost
192.168.1.100 appserver-2 appserver loghost
192.168.1.101 appserver-ce0 loghost
192.168.1.102 appserver-ce1 loghost

We have configured a hostname for each of the Virtual IPs and the Test IPs. However, the Test IPs should not be used by applications for any network connections.

Create hostname.ce* files

For every interface on the system create a hostname.ce* file. For us, create the files

hostname.ce0 & hostname.ce1

Edit hostname.ce0

Add the following on the hostname.ce0 file. This is the primary or master interface of the IPMP Pair

appserver-ce0 netmask + broadcast + group appserver-ipmp deprecated -failover up \
addif appserver netmask + broadcast + failover up

where
netmask – assigns the default netmask

broadcast – assigns the default broadcast value

group – specifies the IPMP group

deprecated – indicate test Interface not be used for data transfer

-failover – makes the test interface not to failover

Now, the configuration is complete and an ifconfig output should look like as follows:

root@ appserver:/$
lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
ce0: flags=9040843 mtu 1500 index 2
inet 192.168.1.99 netmask ffffff00 broadcast 192.168.1.255
groupname appserver-ipmp
ether 0:xx:xx:xx:xx:x
ce0:1: flags=1000843 mtu 1500 index 2
inet 192.168.1.101 netmask ffffff00 broadcast 192.168.1.255
ce1: flags=69040843 mtu 1500 index 3
inet 192.168.1.100 netmask ffffff00 broadcast 192.168.1.255
groupname appserver-ipmp
ether 0:xx:xx:xx:xx:x
ce1:1: flags=1000843 mtu 1500 index 4

inet 192.168.1.102 netmask ffffff00 broadcast 192.168.1.255

Now, both the NICs will forward traffic and when one of the inerface fails, it transparently failover the virtual IP address onto the other active interface and you can see an interface “ce1:2″ would be created for the failed over IP. When the link is restored, this will be failed back to the ce0 interface. There should be no disruption to the network connections

Readers who read this page, also read:




Bookmark and Share My Zimbio http://www.wikio.com

0 comments: