9. 도서관/__다. UNIX

IPMP (IP MultiPatching) 이란...

행복 금융 2008. 7. 30.
[개요]
IPMP 기능 이해
IPMP 관련 화일및 명령어 이해
IPMP 설정 및 테스트

[설명]
솔라리스 8부터 새로이 추가된 기능중 하나인 IPMP(IP MultiPathing)는
솔라리스의 core package인 SUNWcsr에 포함되어 있다.
IPMP는 하나의 시스템이 여러개의 NIC(Network Interface Card)를 사용할때
네트웍 카드들을 그룹핑을 하여서 그중 하나의 네트웍 카드가 failure 되었을때
이를 검사하여 정상적인 네트웍 카드로 failover해주는 기능이다.
그러므로써 네트웍 서비스를 제공하는데 있어서 네트웍 카드의 장애로 생기는
네트웍 장애 문제를 극복할 수 있는 안정적인 환경을 구성해 줄 수 있다.
또한 failback 기능을 가지고 있는데 이는 장애가 발생한 네트웍 카드를 복구한 후
관리자가 메뉴얼하게 네트웍 카드의 설정을 하지 않아도 자동으로 이전 설정으로 돌려주는 기능이다.
IPMP 설정 방법으로는 크게 두가지가 있다. Standby NIC를 가지는 환경과 그렇지 않은 환경이다.
Standby NIC란 네트웍 서비스를 일반적으로 하지 않는 NIC를 하나 설정하여
실제 서비스중인 NIC의 failover에 집중적으로 책임을 지는 인터페이스이다.
이것이 Standby NIC를 가지고 IPMP를 설정하는 것이다.
Standby NIC를 가지지 않는 환경이란 그룹에 있는 NIC들이 네트웍 서비스를 각각 하고 있다가
그룹내 NIC 하나가 failure가 발생하면 남아있던 정상의 NIC로 failover하는 것이다.
IPMP를 설정하는데 있어서 Standby를 갖는냐 갖지 않는냐의 가장 큰 차이는
failover를 할 수 있는 대상 NIC 차이이다.
Standby NIC는 Standby가 아닌 다른 NIC의 failover를 제공하지만 반대는 할 수 없다.
즉, Standby가 아닌 NIC는 Standby NIC의 failure에 대해 failover를 하지 않는다.
Standby NIC가 없이 NIC들을 모두 active path로 잡아주는 환경은 그룹에 있는
NIC들이 어떤것이든 서로를 failover하며 서비스 해 줄 수 있다.
아래의 Lab에서는 Standby NIC를 두는 IPMP 환경 설정과 그렇지 않는 설정에 대해 설명할것이다.


IPMP 구현 관련 명령어와 파일

1. in.mpathd : IPMP의 main control daemon이다. NIC를 그룹핑하는 Ifconfig 명령어를 실행하면
실행하는 프로세스로써 그룹내에 있는 네트웍 카드가 failure가 발생했는지 검사하여
정상적인 네트웍 카드를 failover를 시켜주고 failback을 시켜주는 프로세스이다.
이때 in.mpathd가 failover, failback을 하기위해 (NIC를 테스트하기 위해) 사용하는
logical interface가 필요한데 이것이 test interface이다. test interface는 failover하지 않는다.
단지 테스트를 위한 virtual interface이다.
참고로 Standby interface는 test interface 형태로만 설정한다.
하지만 그룹내 NIC들이 모두 active한 환경이라면(즉 Standby NIC를 가지지 않는 설정) NIC들은
public한 ip address와 test를 위한 ip address 모두를 갖도록 설정해야한다.

2. /etc/default/mpathd : in.mpathd의 configuration file이다.
예를 들어 in.mpathd가 그룹내 NIC들의 failover를 체크할 시간 간격을 정의하는
파라메터등을 설정하는 화일이다.

3. ifconfig : 너무나 잘 알고 있듯이 네트웍 카드 설정을 해주는 명령어이다.
예를 들어 ip address나 netmask등을 설정해주는 명령어이다.
그러한 기본 기능뿐만이 아니라 IPMP를 설정시에도 그룹을 지정하거나 테스트 NIC를 설정하는데 사용된다.
IPMP 설정에 관련있는 ifconfig 명령어들의 옵션이나 아규먼트 몇 가지를 살펴보자.
group : IPMP failover를 할 그룹을 설정한다.
deprecated -failover : test interface 에 설정하는 옵션
addif : test interface 이면서 active path 를 가지고 있으면서 test interface를 add 하기 위해
사용하는 아규먼트
standby : active path를 갖지 않는 standby test interface 를 설정하는 아규먼트

Implementation
아래의 구현 내용은 IPMP를 설정하는 방법으로 첫째로 standby를 사용하지 않고 두 NIC가
모두 active하게 서비스를 할 수 있는 상태로 만든후 failover, failback을 하는 내용이다.
두번째 구현의 내용은 standby를 사용하는 테스트의 예이다.

1. Standby 없이 dual active path 의 IPMP설정 및 확인
[설정]
host1#eeprom local-mac-address?
local-mac-address?=false
host1# eeprom local-mac-address?=true

--> 각 interface의 ethernet address를 달리 설정하기 위한
eeprom parameter를 true로 설정

host1# eeprom local-mac-address?
local-mac-address?=true
host1# ifconfig ge0 unplumb
host1# ifconfig ge1 unplumb
host1# ifconfig ge0 plumb 192.168.0.86 group testgrp2 up

host1# ps -ef|grep mpath
root 477 1 0 17:18:09 ? 0:00 /sbin/in.mpathd

host1# ifconfig ge0 addif 192.168.0.87 deprecated -failover up
---> test interface 설정 . Created new logical interface ge0:1

host1# ifconfig -a
lo0: flags=1000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
ge0: flags=1000843 mtu 1500 index 6
inet 192.168.0.86 netmask ffffff00 broadcast 192.168.0.255 3
groupname testgrp2
ether 8:0:20:c0:ff:ec
ge0:1: flags=9040843
mtu 1500 index 6
inet 192.168.0.87 netmask ffffff00 broadcast 192.169.0.255

host1# ifconfig ge1 plumb 192.168.0.88 group testgrp2 up
host2# ifconfig ge1 addif 192.168.0.89 deprecated -failover up
--> test interface설정 . Created new logical interface ge1:1

host1# ifconfig -a
lo0: flags=1000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
ge0: flags=1000843 mtu 1500 index 6
inet 192.168.0.86 netmask ffffff00 broadcast 192.168.0.255
groupname testgrp2
ether 8:0:20:c0:ff:ec
ge0:1:
flags=9040843
mtu 1500 index 6
inet 192.168.0.87 netmask ffffff00 broadcast 192.168.0.255
ge1: flags=1000843 mtu 1500 index 7
inet 192.168.0.88 netmask ffffff00 broadcast 192.168.0.255
groupname testgrp2
ether 8:0:20:c0:ff:ec
ge1:1:
flags=9040843
mtu 1500 index 7
inet 192.168.0.89 netmask ffffff00 broadcast 192.168.0.255


Failover 테스트
다른 호스트 host2 로부터 192.168.0.88 번으로 ping을 날리고 host1은 그러는 중간에
ge1에 장애를 일으켰다. lab에서는 네트웍 포트를 뽑아버렸다
host2# ping -s 192.168.0.88
PING 192.168.0.88: 56 data bytes
64 bytes from host1 (192.168.0.88): icmp_seq=0. time=0. ms
64 bytes from host1 (192.168.0.88): icmp_seq=1. time=0. ms
64 bytes from host1 (192.168.0.88): icmp_seq=2. time=0. ms
64 bytes from host1 (192.168.0.88): icmp_seq=3. time=0. ms
64 bytes from host1 (192.168.0.88): icmp_seq=4. time=0. ms
64 bytes from host1 (192.168.0.88): icmp_seq=5. time=0. ms
.
.
.
64 bytes from host1 (192.168.0.88): icmp_seq=14. time=0. ms
64 bytes from host1 (192.168.0.88): icmp_seq=15. time=0. ms

위의 결과에서 보듯이 중간에 잠시 멈추는 부분이 보이는데 이때 host1의 ge1이 장애를 일으켰다.
하지만 잠시 시간이 흐른 후 계속 ping 이 잘 진행되는 것을 확인할 수 있다.
host1에서 IPMP설정에 의해 failover가 되는 것이다.
이러한 테스트는 ge0에 장애를 일으켜도 마찬가지로 ge1으로 failover 된다.
그럼 host1쪽의 failover된 환경을 확인해 보자.


host1# ifconfig -a
lo0: flags=1000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
ge0: flags=1000843 mtu 1500 index 6
inet 192.168.0.86 netmask ffffff00 broadcast 192.168.0.255
groupname testgrp2
ether 8:0:20:c0:ff:ec
ge0:1:
flags=9040843
mtu 1500 index 6
inet 192.168.0.87 netmask ffffff00 broadcast 192.168.0.255
ge0:2: flags=1000843 mtu 1500 index 6
inet 192.168.0.88 netmask ffffff00 broadcast 192.168.0.255
ge1: flags=19000842
mtu 0 index 7
inet 0.0.0.0 netmask 0 groupname testgrp2
ether 8:0:20:c0:ff:ec
ge1:1:
flags=9040843
mtu 1500 index 7
inet 192.168.0.89 netmask ffffff00 broadcast 192.168.0.255



Failback 테스트
ge1을 복구한 후 얼마 지나지 않아 자동으로 failback 하는 것을 확인할 수 있다.
아래의 내용은 failback을 한 후의 host1의 네트웍 카드 설정을 보면 이전 상태로
돌아가 있는 것을 확인할 수 있다


host1# ifconfig -a
lo0: flags=1000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
ge0: flags=1000843 mtu 1500 index 6
inet 192.168.0.86 netmask ffffff00 broadcast 192.168.0.255
groupname testgrp2
ether 8:0:20:c0:ff:ec
ge0:1:
flags=9040843
mtu 1500 index 6
inet 192.168.0.87 netmask ffffff00 broadcast 192.168.0.255
ge1: flags=1000843 mtu 1500 index 7
inet 192.168.0.88 netmask ffffff00 broadcast 192.168.0.255
groupname testgrp2
ether 8:0:20:c0:ff:ec
ge1:1:
flags=9040843
mtu 1500 index 7
inet 192.168.0.89 netmask ffffff00 broadcast 192.168.0.255

/etc/hostnanme. 설정 내용
# cat /etc/hostname.hme0
192.168.10.215 broadcast + netmask + up group test \
addif 192.168.10.216 -failover deprecated netmask + broadcast + up
# cat /etc/hostname.hme1
192.168.10.217 broadcast + netmask + up group test \
addif 192.168.10.218 -failover deprecated netmask + broadcast + up


2. Standby 를 가진 single active path의 IPMP 설정하기
[설정부분]
host1#eeprom local-mac-address?
local-mac-address?=false
host1# eeprom local-mac-address?=true
--> 각 interface의 ethernet address를 달리 설정하기 위한 eeprom parameter를 true로 설정
host1# eeprom local-mac-address?
local-mac-address?=true

host1# ifconfig ge0 unplumb
host1# ifconfig ge1 unplumb
host1# ifconfig ge0 plumb 192.168.0.86 group testgrp2 up

host1# ps -ef|grep mpath ß 데몬이 실행중인지 확인한다
root 477 1 0 17:18:09 ? 0:00 /sbin/in.mpathd
-> 실행중이지 않다면 /sbin에서 #./in.mpathd 실행

host1# ifconfig ge0 addif 192.168.0.87 deprecated -failover up
-> ge0:1 가상인터페이스가 생성된다

host1# ifconfig -a <-확인

lo0: flags=1000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
ge0: flags=1000843 mtu 1500 index 6
inet 192.168.0.86 netmask ffffff00 broadcast 192.168.0.255
groupname testgrp2
ether 8:0:20:c0:ff:ec
ge0:1: flags=9040843
mtu 1500 index 6
inet 192.168.0.87 netmask ffffff00 broadcast 192.169.0.255

host1# ifconfig ge1 plumb 203.234.247.88 group testgrp1 deprecated -failover standby up
host1# ifconfig -a
lo0: flags=1000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
ge0: flags=1000843 mtu 1500 index 6
inet 192.168.0.86 netmask ffffff00 broadcast 192.168.0.255
groupname testgrp2
ether 8:0:20:c0:ff:ec
ge0:1: flags=9040843
mtu 1500 index 6
inet 192.168.0.87 netmask ffffff00 broadcast 192.169.0.255
ge1: flags=69040843

mtu 1500 index 5
inet 192.168.0.88 netmask ffffff00 broadcast 192.168.0.255
groupname testgrp1 ether 8:0:20:c0:ff:ec

Failover 테스트
다른 호스트 host2 로부터 192.168.0.86 번으로 ping을 날리고
host1은 그러는 중간에 ge1에 장애를 일으켰다.
lab에서는 네트웍 포트를 뽑아버렸다

host2# ping -s 192.168.0.86
PING 192.168.0.86: 56 data bytes
64 bytes from host1 (192.168.0.86): icmp_seq=0. time=0. ms
64 bytes from host1 (192.168.0.86): icmp_seq=1. time=0. ms
64 bytes from host1 (192.168.0.86): icmp_seq=2. time=0. ms
64 bytes from host1 (192.168.0.86): icmp_seq=3. time=0. ms
64 bytes from host1 (192.168.0.86): icmp_seq=4. time=0. ms
.
.
.
64 bytes from host1 (192.168.0.86): icmp_seq=11. time=0. ms
64 bytes from host1 (192.168.0.86): icmp_seq=12. time=0. ms

위의 결과에서 보듯이 중간에 잠시 멈추는 부분이 보이는데 이때 host1의 ge1이 장애를 일으켰다.
하지만 잠시 시간이 흐른 후 계속 ping 이 잘 진행되는 것을 확인할 수 있다.
host1에서 IPMP설정에 의해 failover가 되는 것이다.
하지만 이때 ge0이 아닌 standby 인 ge1에 장애가 발생하면 ge0으로는 failover되지 않는다.

/etc/hostname. 설정 내용
# cat /etc/hostname.ge0
192.168.0.86 netmask 255.255.255.0 broadcast + group host1 up \
addif 192.168.0.87 deprecated -failover netmask 255.255.255.0 broadcast + up

#cat /etc/hostname.ge1
192.168.0.88 netmask 255.255.255.0 broadcast + group host1 deprecated -
failover standby up

댓글

💲 추천 글