09ClusterXL 구성 명령ClusterXL 구성 명령
이 장은 ClusterXL의 내부 동작, 즉 클러스터링 메커니즘 자체를 세밀하게 손보는 명령들 을 빠짐없이 정리합니다. Critical Device(중요 장치)를 등록·해제·보고하고, CCP 암호화를 켜고, 수동으로 페일오버를 일으키고, Bond Load Sharing의 최소 인터페이스 수를 정하고, Multi-Version Cluster(MVC)를 켜고 끄는 일들이 여기에 속합니다. 명령은 두 갈래로 나뉩니다 — Gaia Clish 에서 쓰는 set cluster ... 계열과, Expert mode 에서 쓰는 cphaconf ... 계열입니다. 같은 일을 하는 짝이 있는 경우가 많지만, 일부는 Expert mode에서만 됩니다.
어떤 명령이 있는지 둘러보기
외워 두기보다, 셸이 직접 명령 목록을 보여 주게 하는 편이 빠릅니다.
- Gaia Clish 에서는
set cluster뒤에<ESC><ESC>(ESC 두 번)를 눌러 쓸 수 있는 명령을 모두 펼쳐 봅니다.
set cluster<ESC><ESC>
- Expert mode 에서는
cphaconf명령으로 사용 가능한 명령을 봅니다.cphaconf계열은 오직 Expert mode에서만 실행됩니다.
이 명령들은 모두 스크립트에 넣어 자동으로 실행 할 수 있습니다.
구문 표기법 읽는 법
명령 설명을 정확히 읽으려면 표기 약속부터 알아 둡니다.
| 표기 | 뜻 | |
|---|---|---|
중괄호 { } | 세로줄 `\ | ` 로 구분된 후보 목록. 이 중 하나만 고릅니다. |
꺾쇠 < > | 변수. 사용자가 지원되는 실제 값을 직접 지정 해야 합니다. | |
대괄호 [ ] | 선택적(optional) 명령·파라미터. 넣어도 되고 안 넣어도 됩니다. |
전체 명령 한눈에 보기
아래 표는 ClusterXL 구성 명령을 하나씩 짝지어 정리한 것입니다. 왼쪽이 무엇을 하는 명령인지, 가운데가 Gaia Clish 형태, 오른쪽이 Expert mode 형태입니다. N/A 는 해당 셸에서는 그 명령을 쓸 수 없다는 뜻입니다.
| 하는 일 | Gaia Clish | Expert mode | ||
|---|---|---|---|---|
| 로컬 로그에 멤버를 ID로 표시할지 이름으로 표시할지 설정 | `set cluster member idmode {id \ | name}` | `cphaconf mem_id_mode {id \ | name}` |
| Critical Device(Pnote) 하나를 등록 | N/A | `cphaconf set_pnote -d <Name of Device> -t <Timeout in Sec> -s {ok\ | init\ | problem} [-p] [-g] register` |
| Critical Device(Pnote) 하나를 해제 | N/A | cphaconf set_pnote -d <Name of Device> [-p] [-g] unregister | ||
| Critical Device(Pnote) 하나의 상태를 보고(변경) | N/A | `cphaconf set_pnote -d <Name of Device> -s {ok\ | init\ | problem} [-g] report` |
| 파일에 나열된 여러 Critical Device를 한꺼번에 등록 | N/A | cphaconf set_pnote -f <Name of File> [-g] register | ||
| 모든 Critical Device를 해제 | N/A | cphaconf set_pnote -a [-g] unregister | ||
| CCP(Cluster Control Protocol) 암호화 설정 | `set cluster member ccpenc {off \ | on}` | `cphaconf ccp_encrypt {off \ | on} / cphaconf ccp_encrypt_key <Key String>` |
| Cluster Forwarding Layer 설정(멤버 간 트래픽 전달 제어) — Check Point 전용 | `set cluster member forwarding {off \ | on}` | `cphaconf forward {off \ | on}` |
| 커널에 로드된 현재 클러스터 구성 출력(sk93306) | N/A | cphaconf debug_data | ||
| 지정한 Bond의 subordinate 인터페이스 간 내부 페일오버 시작 — Bond High Availability 모드 전용(sk93306) | N/A | cphaconf failover_bond <bond_name> | ||
| Bond가 내부 페일오버를 한 뒤의 동작 설정(sk93306) | N/A | cphaconf enable_bond_failover <bond_name> | ||
| 수동 클러스터 페일오버 시작 | `set cluster member admin {down \ | up}` | `clusterXL_admin {down \ | up}` |
| Bond Load Sharing에 필요한 최소 subordinate 인터페이스 수 설정 | set interface <Bond Name> links <Value> | `cphaconf bond_ls {set <Bond Name> <Value> \ | remove <Bond Name>}` | |
| Cluster 인터페이스의 Link Monitoring 구성 | N/A | N/A | ||
| Multi-Version Cluster(MVC) 메커니즘 구성 | `set cluster member mvc {off \ | on}` | `cphaconf mvc {off \ | on}` |
`set cluster member` 명령 모음 (Gaia Clish)
Gaia Clish에서 자주 쓰는 set cluster member 명령은 다음과 같습니다.
set cluster member admin {down | up} [permanent]
set cluster member ccpenc {off | on}
set cluster member forwarding {off | on}
set cluster member idmode {id | name}
set cluster member mvc {off | on}`cphaconf` 명령 모음 (Expert mode)
cphaconf [-D] <options> start
cphaconf stop
cphaconf [-t <Sync IF 1>...] [-d <Non-Monitored IF 1>...] add
cphaconf clear-secured
cphaconf clear-non-monitored
cphaconf debug_data
cphaconf delete_link_local [-vs <VSID>] <IF name>
cphaconf set_link_local [-vs <VSID>] <IF name> <Cluster IP>
cphaconf mem_id_mode {id | name}
cphaconf failover_bond <bond_name>
cphaconf [-s] {set | unset | get} var <Kernel Parameter Name> [<Value>]
cphaconf bond_ls {set <Bond Name> <Value> | remove <Bond Name>}
cphaconf set_pnote -d <Device> -t <Timeout in sec> -s {ok | init | problem} [-p] [-g] register
cphaconf set_pnote -f <File> [-g] register
cphaconf set_pnote -d <Device> [-p] [-g] unregister
cphaconf set_pnote -a [-g] unregister
cphaconf set_pnote -d <Device> -s {ok | init | problem} [-g] report
cphaconf ccp_encrypt {off | on}
cphaconf ccp_encrypt_key <Key String>이제 각 명령을 하나씩 자세히 풀어 봅니다.
로컬 로그의 Cluster Member ID 표시 방식 설정
이 명령은 로컬 ClusterXL 로그에 멤버를 어떻게 표시할지 정합니다 — Member ID(기본값)로 보일지, Member Name(이름)으로 보일지입니다. 이 설정은 다음 로컬 로그들에 적용됩니다.
/var/log/messagesdmesg$FWDIR/log/fwd.elg
구문은 다음과 같습니다.
Gaia Clish
set cluster member idmode {id | name}
Expert mode
cphaconf mem_id_mode {id | name}실제로 표시 방식을 ID에서 NAME으로 바꾸는 예를 보면, cphaprob names 로 현재 모드를 확인하고, cphaconf mem_id_mode name 으로 바꾼 뒤 다시 확인하는 흐름입니다.
[Expert@Member1:0]# cphaprob names
Current member print mode in local logs is set to: ID
[Expert@Member1:0]#
[Expert@Member1:0]# cphaconf mem_id_mode name
Member print mode in local logs: NAME
[Expert@Member1:0]#
[Expert@Member1:0]# cphaprob names
Current member print mode in local logs is set to: NAME
[Expert@Member1:0]#Critical Device 등록하기
기본 Critical Device 목록에 사용자 정의 Critical Device를 추가 할 수 있습니다. 이 명령으로 <device> 를 중요한 프로세스로 등록하면, 그 장치는 멤버가 Active로 인정받기 위해 반드시 살아 있어야 하는 장치 목록 에 들어갑니다. 만약 <device> 가 실패하면 해당 Cluster Member는 실패한 것으로 간주됩니다.
또한 Critical Device가 정해진 timeout 안에 자기 상태를 멤버에게 보고하지 못하면, 그 Critical Device는 (그리고 설계상 그 Cluster Member도) 실패한 것으로 봅니다.
등록할 때 ClusterXL에 보고할 초기 상태 를 함께 정하는데, 다음 셋 중 하나입니다.
| 상태 | 의미 |
|---|---|
ok | Critical Device가 살아 있음(정상). |
init | Critical Device가 초기화 중. 이 동안 Cluster Member는 Down 이며, Active가 될 수 없 습니다. |
problem | Critical Device가 실패함. 이 상태가 보고되면 Cluster Member는 즉시 Down 되고 페일오버 가 일어납니다. |
구문은 Expert mode에서만 쓸 수 있습니다(Gaia Clish는 N/A).
cphaconf set_pnote -d <Name of Critical Device> -t <Timeout in Sec> -s {ok | init | problem} [-p] [-g] register플래그(flag)의 뜻은 다음과 같습니다.
| 플래그 | 설명 |
|---|---|
-t | 이 Critical Device가 얼마나 자주 주기 보고를 해야 하는지 정합니다. 주기 보고를 기대하지 않는다면 값으로 0(영)을 넣습니다. |
-p | 변경을 영구 적용 합니다(재부팅 후에도 유지). |
-g | 명령을 구성된 모든 Virtual System 에 적용합니다. |
제약 사항도 있습니다.
- 한 Cluster Member의 Critical Device(pnote) 총 개수는 16개 로 제한됩니다.
- Critical Device(pnote) 이름은 최대 15자 이며, 공백(white space)을 포함하면 안 됩니다.
활용 예: 디스크 사용량을 클러스터 판정에 끼워 넣기
이 예는 다른 모든 Critical Device가 상태를 ok 로 보고하고 있다고 가정합니다. 각 Cluster Member 에서 다음을 합니다.
- 다음을 하는 셸 스크립트를 만듭니다.
- a. 중요한 디스크 파티션의 사용 공간을 검사합니다.
- b. 사용 공간이 임계값을 넘으면 사용자 정의 Critical Device를 등록하고 상태를
problem으로 보고합니다. 그러면 (Active 멤버가 적어도 하나 있다는 전제에서) 이 멤버는 클러스터 상태를 Down 으로 바꿉니다. 반대로 사용 공간이 임계값 아래면 Critical Device를 등록하고 상태를ok로 보고합니다. 그러면 멤버는 상태를 Standby 또는 Active 로 바꿉니다.
예시 스크립트는 다음과 같습니다.
# Get the used % in the partition lv_current
var_lv_current=$(df -h | grep lv_current | awk '{print $5}'| sed 's/[%]//')
# Get the used % in the partition lv_log
var_lv_log=$(df -h | grep lv_log | awk '{print $5}'| sed 's/[%]//')
if [ "$var_lv_current" -gt 90 -o "$var_lv_log" -gt 90 ];
then
# If the partition is full, then bring the cluster member down
$FWDIR/bin/cphaconf set_pnote -d Storage -s problem report
else
# If the partition is free enough, then bring the cluster member up
$FWDIR/bin/cphaconf set_pnote -d Storage -s ok report
$FWDIR/bin/cphaconf set_pnote -d Storage unregister
fi
- 이 스크립트를 적절한 시간 간격으로 실행하도록 예약 작업(scheduled job) 을 설정합니다. 자세한 방법은 R82 Gaia Administration Guide를 참고하세요.
Critical Device 해제하기
이 명령은 사용자 정의 Critical Device(Pnote)를 등록 해제 합니다. 즉 그 장치는 더 이상 중요하다고 간주되지 않습니다. 만약 이 명령을 실행하기 전에 그 Critical Device가 problem 상태로 등록되어 있었다면, 명령을 실행한 뒤에는 남은 다른 Critical Device들의 상태만으로 Cluster Member의 상태가 결정됩니다.
Gaia Clish는 N/A이고, Expert mode 구문은 다음과 같습니다.
cphaconf set_pnote -d <Name of Critical Device> [-p] [-g] unregister| 플래그 | 설명 |
|---|---|
-p | 변경을 영구 적용 합니다. 즉 재부팅한 뒤에도 이 Critical Device들은 해제된 상태로 남습니다. |
-g | 명령을 구성된 모든 Virtual System에 적용합니다. |
Critical Device 상태 보고(변경)하기
이 명령은 Critical Device의 상태를 ClusterXL에 수동으로 보고(변경) 합니다. 보고할 수 있는 상태는 등록 때와 같이 ok, init, problem 셋 중 하나입니다.
| 상태 | 의미 |
|---|---|
ok | Critical Device가 살아 있음. |
init | 초기화 중. 이 동안 Cluster Member는 Down이며 Active가 될 수 없음. |
problem | 실패. 이 상태가 보고되면 Cluster Member는 즉시 Down 되고 페일오버가 일어남. |
Critical Device가 정해진 timeout 안에 상태를 보고하지 못하면 그 장치는(설계상 멤버도) 실패로 간주됩니다. 단 이것은 timeout이 있는 Critical Device에만 해당합니다. -t 0 으로 등록한 장치는 timeout이 없으므로, 그 장치가 다른 상태를 보고하기 전까지는 마지막으로 보고한 상태가 계속 유지 됩니다.
Gaia Clish는 N/A이고, Expert mode 구문은 다음과 같습니다.
cphaconf set_pnote -d <Name of Critical Device> -s {ok | init | problem} [-g] report파일에 나열된 Critical Device 한꺼번에 등록하기
이 명령은 지정한 파일에 나열된 모든 사용자 정의 Critical Device를 한꺼번에 등록 합니다. 이 파일은 일반 텍스트 ASCII 파일 이어야 하고, 각 Critical Device를 한 줄씩 정의해야 합니다. 각 정의는 세 가지 파라미터를 공백(space)이나 탭(tab)으로 구분 해 담습니다.
<Name of Device> <Timeout> <Status>각 파라미터의 의미는 다음과 같습니다.
| 파라미터 | 설명 |
|---|---|
<Name of Device> | Critical Device의 이름. 최대 15자 이며, 공백(space·tab)을 포함하면 안 됩니다. |
<Timeout> | 이 장치가 정해진 초(seconds) 안에 상태를 보고하지 못하면 그 장치(설계상 멤버도)를 실패로 간주합니다. timeout을 두지 않으려면 값 0(영)을 씁니다. |
<Status> | 이 장치가 멤버에게 보고하는 상태 — ok(살아 있음), init(초기화 중, 멤버 Down·Active 불가), problem(실패, 멤버 즉시 Down·페일오버) 중 하나. |
Gaia Clish는 N/A이고, Expert mode 구문은 다음과 같습니다.
cphaconf set_pnote -f /<Path>/<Name of File> [-g] register모든 Critical Device 해제하기
이 명령은 Cluster Member에서 모든 Critical Device를 한꺼번에 해제 합니다. Gaia Clish는 N/A이고, Expert mode 구문은 다음과 같습니다.
cphaconf set_pnote -a [-g] unregister| 플래그 | 설명 |
|---|---|
-a | 모든 Pnote를 해제 하라는 뜻입니다. |
-g | 명령을 구성된 모든 Virtual System에 적용합니다. |
Cluster Control Protocol(CCP) 설정하기
Cluster Member들은 CCP 모드를 자동으로 설정 합니다.
여러분이 직접 설정할 수 있는 것은 CCP 암호화(Encryption) 입니다. 구문은 다음과 같습니다.
Gaia Clish
set cluster member ccpenc {off | on}
Expert mode
cphaconf ccp_encrypt {off | on}
cphaconf ccp_encrypt_key <Key String>off 와 on 으로 암호화를 끄고 켜며, Expert mode에서는 cphaconf ccp_encrypt_key 로 키 문자열(Key String)을 지정합니다.
수동으로 클러스터 페일오버 일으키기
이 명령은 원하는 시점에 직접 클러스터 페일오버를 일으킵니다(sk55081 참고). 구문은 다음과 같습니다.
Gaia Clish
set cluster member admin {down | up}
Expert mode
clusterXL_admin {down | up}admin down(또는 clusterXL_admin down)으로 멤버를 관리상 Down 으로 내리면 다른 멤버로 페일오버가 일어나고, up 으로 다시 정상으로 되돌립니다.
아래 예는 Member1 을 내렸다가(clusterXL_admin down) 다시 올리는(clusterXL_admin up) 과정과, 그때마다 cphaprob state 로 상태가 어떻게 바뀌는지를 보여 줍니다. 처음에는 Member1이 ACTIVE(100%), Member2가 STANDBY(0%)였다가, down 이후 Member1이 DOWN(0%)·Active PNOTE가 ADMIN 으로 바뀌고 Member2가 ACTIVE(100%)로 올라갑니다. 다시 up 하면 Member1은 STANDBY가 되지만 이미 Member2가 Active이므로 Member1은 Standby에 머무릅니다.
[Expert@Member1:0]# cphaprob state
Cluster Mode: High Availability (Active Up) with IGMP Membership
ID Unique Address Assigned Load State Name
1 (local) 11.22.33.245 100% ACTIVE Member1
2 11.22.33.246 0% STANDBY Member2
Active PNOTEs: None
... ...
[Expert@Member1:0]#
[Expert@Member1:0]# clusterXL_admin down
This command does not survive reboot. To make the change permanent, please run 'set cluster
member admin down/up permanent' in clish or add '-p' at the end of the command in expert mode
Setting member to administratively down state ...
Member current state is DOWN
[Expert@Member1:0]#
[Expert@Member1:0]# cphaprob state
Cluster Mode: High Availability (Active Up) with IGMP Membership
ID Unique Address Assigned Load State Name
1 (local) 11.22.33.245 0% DOWN Member1
2 11.22.33.246 100% ACTIVE Member2
Active PNOTEs: ADMIN
Last member state change event:
Event Code: CLUS-111400
State change: ACTIVE -> DOWN
Reason for state change: ADMIN_DOWN PNOTE
Event time: Sun Sep 8 19:35:06 2019
Last cluster failover event:
Transition to new ACTIVE: Member 1 -> Member 2
Reason: ADMIN_DOWN PNOTE
Event time: Sun Sep 8 19:35:06 2019
Cluster failover count:
Failover counter: 2
Time of counter reset: Sun Sep 8 16:08:34 2019 (reboot)
[Expert@Member1:0]#
[Expert@Member1:0]# clusterXL_admin up
This command does not survive reboot. To make the change permanent, please run 'set cluster
member admin down/up permanent' in clish or add '-p' at the end of the command in expert mode
Setting member to normal operation ...
Member current state is STANDBY
[Expert@Member1:0]#
[Expert@Member1:0]# cphaprob state
Cluster Mode: High Availability (Active Up) with IGMP Membership
ID Unique Address Assigned Load State Name
1 (local) 11.22.33.245 0% STANDBY Member1
2 11.22.33.246 100% ACTIVE Member2
Active PNOTEs: None
Last member state change event:
Event Code: CLUS-114802
State change: DOWN -> STANDBY
Reason for state change: There is already an ACTIVE member in the cluster (member 2)
Event time: Sun Sep 8 19:37:03 2019
Last cluster failover event:
Transition to new ACTIVE: Member 1 -> Member 2
Reason: ADMIN_DOWN PNOTE
Event time: Sun Sep 8 19:35:06 2019
Cluster failover count:
Failover counter: 2
Time of counter reset: Sun Sep 8 16:08:34 2019 (reboot)
[Expert@Member1:0]#Bond Load Sharing의 최소 subordinate 인터페이스 수 설정하기
ClusterXL은 Load Sharing 모드의 Bond에서 살아 있는(up) subordinate 인터페이스 수가 정해진 최솟값보다 적어지면 그 Bond를 down 상태로 봅니다. 기본값은, subordinate 인터페이스가 n 개인 Bond에서 up을 유지해야 하는 최소 개수가 n-1 입니다. 즉 한 개가 더 실패해서 n-2 개만 남으면, Bond에 인터페이스가 두 개보다 많더라도 ClusterXL은 그 Bond를 down으로 간주합니다.
만약 더 적은 수의 인터페이스로도 예상 트래픽을 처리할 수 있다면, 최소 개수를 직접 정해 줄 수 있습니다. 적절한 값은, 최대 예상 트래픽 속도를 subordinate 인터페이스 하나의 속도로 나눈 뒤 올림 해서 구합니다.
특정 Bond에 최소 개수 지정하기
Gaia Clish
set interface <Name of Bond Interface> links <Minimum Number of Requirement Subordinate Interfaces between 1 and 8>
Expert mode
cphaconf bond_ls set <Name of Bond Interface> <Minimum Number of Required Subordinate Interfaces between 1 and 8>값은 1에서 8 사이 입니다.
지정한 최소 개수 제거하기
Gaia Clish
set interface <Name of Bond Interface> links 0
Expert mode
cphaconf bond_ls remove <Name of Bond Interface>Gaia Clish에서는 links 0 으로, Expert mode에서는 remove 로 설정을 지웁니다.
현재 설정 확인하기
Gaia Clish
show interface <Name of Bond Interface> links
Expert mode
cat $FWDIR/conf/cpha_bond_ls_config.confGaia Clish 절차
| 단계 | 할 일 | |
|---|---|---|
| 1 | 각 Cluster Member의 명령줄에 접속합니다. | |
| 2 | Gaia Clish에 로그인합니다. | |
| 3 | 특정 Bond 인터페이스의 최소 개수를 추가하거나 제거합니다.<br>`set interface <Name of Bond Interface> links {Minimum Number of Requirement Subordinate Interfaces> \ | 0}` |
| 4 | 구성을 저장합니다 — save config | |
| 5 | 구성을 확인합니다 — show interface <Name of Bond Interface> links | |
| 6 | SmartConsole에서 이 클러스터 객체에 Access Control 정책을 설치합니다. |
Expert mode 절차
| 단계 | 할 일 |
|---|---|
| 1 | 각 Cluster Member의 명령줄에 접속합니다. |
| 2 | Expert mode에 로그인합니다. |
| 3 | 특정 Bond 인터페이스의 최소 개수를 추가하거나 제거합니다.<br>cphaconf bond_ls set <Bond> <Minimum Number of Subordinate Interfaces><br>cphaconf bond_ls remove <Bond> |
| 4 | 구성을 확인합니다 — cat $FWDIR/conf/cpha_bond_ls_config.conf |
| 5 | SmartConsole에서 이 클러스터 객체에 Access Control 정책을 설치합니다. |
Expert mode 예시
아래는 bond1 의 최소 개수를 2로 설정했다가(bond_ls set bond1 2) 다시 제거하는(bond_ls remove bond1) 과정과, 그때마다 설정 파일 내용이 어떻게 바뀌는지를 보여 줍니다.
[Expert@Member1:0]# cat $FWDIR/conf/cpha_bond_ls_config.conf
# ... (truncated for brevity) ...
# Example:
# bond0 2
[Expert@Member1:0]#
[Expert@Member1:0]# cphaconf bond_ls set bond1 2
Set operation succeeded
[Expert@Member1:0]# cat $FWDIR/conf/cpha_bond_ls_config.conf
# ... (truncated for brevity) ...
# Example:
# bond0 2
bond1 2
[Expert@Member1:0]#
[Expert@Member1:0]# cphaconf bond_ls remove bond1
Remove operation succeeded
[Expert@Member1:0]#
[Expert@Member1:0]# cat $FWDIR/conf/cpha_bond_ls_config.conf
# ... (truncated for brevity) ...
# Example:
# bond0 2
[Expert@Member1:0]#Multi-Version Cluster(MVC) 메커니즘 설정하기
이 명령은 무중단 업그레이드의 핵심인 MVC(Multi-Version Cluster) 메커니즘을 켜거나 끕니다. MVC는 서로 다른 버전의 멤버가 잠시 공존하며 순차로 업그레이드되도록 해 줍니다.
구문은 다음과 같습니다.
Gaia Clish
set cluster member mvc {off | on}
Expert mode
cphaconf mvc {off | on}| 파라미터 | 설명 |
|---|---|
off | 이 Cluster Member에서 MVC 메커니즘을 비활성화 합니다. |
on | 이 Cluster Member에서 MVC 메커니즘을 활성화 합니다. |