Simulation is ...

Virtual = Real

Flight Sim 자세히보기

> IT (Information Technology)

CFS, 인포스케일, Veritas infoscale

FlightSim 2023. 8. 8. 15:21
320x100

[상태조회]
# hastatus -sum
# vxclustadm nidmap
# vxdctl -c mode
# gabconfig -a

[디스크 상태 확인]
# vxdisk list
# vxprint -g FILEdb -htq

[네트워크 확인]
# lltconfig -a list

[sync 중인 작업 리스트 확인]
#vxtask -l list

[우선권 설정]
# vxclustadm set master [서버hostname]

[이중화클러스터 시작/중지]
# hastart
# hastop -local

vxdctl Command

The vxdctl utility manages some aspects of the volume configuration daemon, vxconfigd. The -c option can be used to request cluster information. You can use vxdctl as follows to determine whether vxconfigd is enabled and/or running:

vxdctl -c mode

Depending on the circumstances, the output is similar to the following:

mode: enabled: cluster active - MASTER
mode: enabled: cluster active - SLAVE
mode: enabled: cluster inactive
mode: enabled: cluster active - role not set 

Note : If vxconfigd is disabled, no cluster information is displayed.

 

VCS "참고 자료": 다양한 VCS(Veritas Cluster Server) 명령에 대한 빠른 참조

 

LLT 및 GAB

VCS는 LLT 및 GAB라는 두 개의 구성 요소를 사용하여 시스템 간 사설망을 통해 데이터를 공유합니다.
이러한 구성 요소는 VCS에 필요한 성능 및 안정성을 제공합니다.

LLT LLT(Low Latency Transport)는 신속한 커널 간 통신을 제공하며 네트워크 연결을 모니터링합니다. 시스템 관리자는 클러스터의 시스템과 그 사이의 사설망 링크를 설명하는 구성 파일(llttab)을 생성하여 LLT를 구성합니다. LLT는 네트워크 스택의 계층 2에서 실행됩니다.
GAB GAB(Group membership and Atomic Broadcast)은 시스템 간 동기화 상태를 유지하는 데 필요한 전역 메시지 순서를 제공하며 VCS 하트비트 유틸리티에서 필요한 것과 같은 디스크 통신을 모니터링합니다. 시스템 관리자는 구성 파일(gabtab)을 생성해 GAB 드라이버를 구성합니다.

LLT 및 GAB 파일

/etc/llthosts 이 파일은 시스템당 하나의 항목을 포함하는 데이터베이스로, LLT 시스템 ID를 호스트 이름과 연결합니다. 이 파일은 클러스터의 각 서버에서 동일합니다.
/etc/llttab 이 파일에는 설치 중에 파생된 정보가 포함되어 있으며 lltconfig 유틸리티에 의해 사용됩니다.
/etc/gabtab 이 파일에는 GAB 드라이버를 구성하는 데 필요한 정보가 포함되어 있습니다. 이 파일은 gabconfig 유틸리티에 의해 사용됩니다.
/etc/VRTSvcs/conf/config/main.cf VCS 구성 파일입니다. 이 파일에는 클러스터와 해당 시스템을 정의하는 정보가 포함되어 있습니다.

 

gabdiskconf
-i   디스크 영역 초기화
-s   시작 블록
-S   시그니처
gabdiskhb(하트비트 디스크)
-a   gab 디스크 하트비트 리소스 추가
-s   시작 블록
-p   포트
-S   시그니처
gabconfig
-c   사용할 드라이버 구성
-n   클러스터의 시스템 수.

LLT 및 GAB 명령

링크가 LLT에 대해 활성 상태인지 확인 lltstat -n
lltstat 명령의 자세한 정보 출력 lltstat -nvv | more
LLT에 대한 포트 열기 lltstat -p
LLT 구성 지침의 값 표시 lltstat -c
구성된 각 LLT 링크에 대한 정보 나열 lltstat -l
클러스터의 모든 MAC 주소 나열 lltconfig -a list
LLT 실행 중지 lltconfig -U
LLT 시작 lltconfig -c
GAB가 작동하는지 확인 gabconfig -a
참고: 포트 a는 GAB이 통신 중임을 나타내며 포트 h는 VCS가 시작되었음을 나타냅니다.
GAB 실행 중지 gabconfig -U
GAB 시작 gabconfig -c -n <노드 수>
gabtab 파일의 시드 값 덮어쓰기 gabconfig -c -x

GAB 포트 구성원

구성원 나열 gabconfig -a
포트 f 등록 취소 /opt/VRTS/bin/fsclustadm cfsdeinit
포트 기능 a   gab 드라이버
b   I/O Fencing(데이터 무결성을 보장하도록 고안됨)
d   ODM(Oracle Disk Manager)
f   CFS(Cluster File System)
h   VCS(VERITAS Cluster Server: 고가용성 데몬)
o   VCSMM 드라이버(Oracle 및 VCS 인터페이스에 필요한 커널 모듈)
q   QuickLog 데몬
v   CVM(Cluster Volume Manager)
w   vxconfigd(cvm용 모듈)

클러스터 데몬

고가용성 데몬 had
컴패니언 데몬 hashadow
리소스 에이전트 데몬 <리소스>Agent
웹 콘솔 클러스터 관리 데몬 CmdServer

클러스터 로그 파일

로그 디렉터리 /var/VRTSvcs/log
기본 로그 파일(엔진 로그 파일) /var/VRTSvcs/log/engine_A.log

클러스터 시작 및 중지

"-stale"은 엔진이 로컬 구성을 부실로 취급하도록 지시
"-force"는 엔진이 부실 구성을 유효 구성으로 취급하도록 지시
hastart [-stale|-force]
특정 서버의 구성 파일을 사용해 클러스터를 부실 상태에서 실행 모드로 전환 hasys -force <server_name>

로컬 서버의 클러스터 중지. 

참고: 이 방법을 이용해도 클러스터된 모든 리소스가 오프라인으로 전환됩니다. 
 
hastop -local

로컬 서버의 클러스터를 중지시키지만 응용 프로그램을 클러스터 내의 또 다른 노드로 배출(장애 조치)
 
hastop -local -evacuate
모든 노드의 클러스터를 중지시키지만 클러스터된 리소스를 온라인 상태로 남겨둠 hastop -all -force

클러스터 상태

클러스터 요약 표시 hastatus -summary
클러스터를 지속적으로 모니터링 hastatus
클러스터가 작동하는지 확인 hasys -display

클러스터 상세 내역

클러스터에 대한 정보 haclus -display
특정 클러스터 속성의 값 haclus -value <속성>
클러스터 속성 수정 haclus -modify <속성 이름> <신규>
LinkMonitoring 실행 haclus -enable LinkMonitoring
LinkMonitoring 실행 중지 haclus -disable LinkMonitoring

사용자

사용자 추가 hauser -add <사용자 이름>
사용자 수정 hauser -update <사용자 이름>
사용자 삭제 hauser -delete <사용자 이름>
모든 사용자 표시 hauser -display

시스템 작업

클러스터에 시스템 추가 hasys -add <sys>
클러스터에서 시스템 삭제 hasys -delete <sys>
시스템 속성 수정 hasys -modify <sys> <옵션 수정>
시스템 상태 나열 hasys -state
시스템을 강제로 시작 hasys -force
시스템 속성 표시 hasys -display [-sys]
클러스터의 모든 시스템 나열 hasys -list
시스템의 로드 속성 변경 hasys -load <시스템> <값>
시스템 nodeid 값 표시(/etc/llthosts) hasys -nodeid
시스템 중단(시스템 오프라인 전환 없음, 그룹 온라인 전환 없음) hasys -freeze [-persistent][-evacuate]
참고: main.cf는 쓰기 모드여야 합니다.
시스템 중단 취소(그룹 재실행 및 리소스를 다시 온라인으로 전환) hasys -unfreeze [-persistent]
참고: main.cf는 쓰기 모드여야 합니다.

동적 구성 

VCS 구성은 변경하려면 읽기/쓰기 모드여야 합니다. 읽기/쓰기 모드일 때
구성이 부실 상태가 될 경우 .stale 파일이 $VCS_CONF/conf/config에 생성됩니다. 구성이 다시 읽기 전용 모드로
되돌아가면 .stale 파일이 제거됩니다.

구성을 읽기/쓰기 모드로 변경 haconf -makerw
구성을 읽기 전용 모드로 변경 haconf -dump -makero
클러스터가 어떤 모드에서 실행되는지 확인 haclus -display |grep -i 'readonly'
0 = 쓰기 모드
1 = 읽기 전용 모드
구성 파일 확인 hacf -verify /etc/VRTS/conf/config
참고: main.cf 및 types.cf 파일이 포함되어 있기만 하면 모든 디렉터리를 가리킬 수 있습니다.
main.cf 파일을 클러스터 명령으로 변환 hacf -cftocmd /etc/VRTS/conf/config -dest /tmp
명령 파일을 main.cf 파일로 변환 hacf -cmdtocf /tmp -dest /etc/VRTS/conf/config

서비스 그룹

서비스 그룹 추가 haconf -makerw
  hagrp -add groupw
  hagrp -modify groupw SystemList sun1 1 sun2 2
  hagrp -autoenable groupw -sys sun1
haconf -dump -makero
서비스 그룹 삭제 haconf -makerw
  hagrp -delete groupw
haconf -dump -makero
서비스 그룹 변경 haconf -makerw
  hagrp -modify groupw SystemList sun1 1 sun2 2 sun3 3
haconf -dump -makero

참고: 속성을 나열하려면 "hagrp -display <그룹>"을 사용합니다.
서비스 그룹 나열 hagrp -list
그룹 종속성 나열 hagrp -dep <그룹>
그룹의 매개 변수 나열 hagrp -display <그룹>
서비스 그룹의 리소스 표시 hagrp -resources <그룹>
서비스 그룹의 현재 상태 표시 hagrp -state <그룹>
특정 그룹에서 오류가 있는 비영구적 리소스 지우기 hagrp -clear <그룹> [-sys] <호스트> <sys>
클러스터에서 시스템 목록 변경 # 호스트 제거
hagrp -modify grp_zlnrssd SystemList -delete <호스트이름>

# 새 호스트 추가(위치를 명시하는 것을 잊지 말 것)
hagrp -modify grp_zlnrssd SystemList -add <호스트이름> 1

# 자동 시작 목록 업데이트
hagrp -modify grp_zlnrssd AutoStartList <호스트> <호스트>

서비스 그룹 작업

서비스 그룹을 시작하고 해당 리소스를 온라인으로 전환 hagrp -online <그룹> -sys <sys>
서비스 그룹을 중지하고 해당 리소스를 오프라인으로 전환 hagrp -offline <그룹> -sys <sys>
시스템에서 또 다른 시스템으로 서비스 그룹 전환 hagrp -switch <그룹> to <sys>
그룹의 모든 리소스 실행 hagrp -enableresources <그룹>
그룹의 모든 리소스 실행 중지 hagrp -disableresources <그룹>
서비스 그룹 중단(온라인 및 오프라인 전환 실행 중지) hagrp -freeze <그룹> [-persistent]
참고: "hagrp -display <그룹> | grep TFrozen"을 사용해 확인하십시오.
서비스 그룹 중단 취소(온라인 및 오프라인 전환 실행) hagrp -unfreeze <그룹> [-persistent]
참고: "hagrp -display <그룹> | grep TFrozen"을 사용해 확인하십시오.
서비스 그룹 실행. 실행되고 있는 그룹은 온라인으로만 전환 가능. haconf -makerw
  hagrp -enable <그룹> [-sys]
haconf -dump -makero

참고: "hagrp -display | grep Enabled” 명령을 실행해 확인하십시오.
서비스 그룹 실행 중지. 온라인 전환 중지 haconf -makerw
  hagrp -disable <그룹> [-sys]
haconf -dump -makero

참고: "hagrp -display | grep Enabled” 명령을 실행해 확인하십시오.
서비스 그룹을 플러시하고 수정 작업 실행. hagrp -flush <그룹> -sys <시스템>

리소스

리소스 추가 haconf -makerw
  hares -add appDG DiskGroup groupw
  hares -modify appDG Enabled 1
  hares -modify appDG DiskGroup appdg
  hares -modify appDG StartVolumes 0
haconf -dump -makero
리소스 삭제 haconf -makerw
  hares -delete <리소스>
haconf -dump -makero
리소스 변경 haconf -makerw
  hares -modify appDG Enabled 1
haconf -dump -makero

참고: "hares -display <리소스>” 매개 변수를 나열합니다.
리소스 속성을 전역적으로 변경 hares -global <리소스> <속성> <값>
리소스 속성을 로컬로 변경 hares -local <리소스> <속성> <값>
리소스 매개 변수 나열 hares -display <리소스>
리소스 나열 hares -list  
리소스 독립성 나열 hares -dep

리소스 작업

리소스를 온라인으로 설정 hares -online <리소스> [-sys]
리소스를 오프라인으로 설정 hares -offline <리소스> [-sys]
리소스 상태(오프라인, 온라인 등) 표시 hares -state
리소스 매개 변수 표시 hares -display <리소스>
리소스를 오프라인으로 설정하고 명령을 하위로 전파 hares -offprop <리소스> -sys <sys>
리소스 에이전트가 즉시 리소스를 모니터링하도록 함 hares -probe <리소스> -sys <sys>
리소스 지우기(자동으로 온라인 설정 시작) hares -clear <리소스> [-sys]

리소스 유형

리소스 유형 추가 hatype -add <유형>
리소스 유형 제거 hatype -delete <유형>
모든 리소스 유형 나열 hatype -list
리소스 유형 표시 hatype -display <유형>
특정 리소스 유형 나열 hatype -resources <유형>
특정 리소스 유형 속성 변경 hatype -value <유형> <attr>

리소스 에이전트

에이전트 추가 pkgadd -d . <에이전트 패키지>
에이전트 제거 pkgrm <에이전트 패키지>
에이전트 변경 n/a
모든 ha 에이전트 나열 haagent -list  
에이전트 런타임 정보(예: 시작 여부, 실행 여부) 표시 haagent -display <에이전트_이름>  
에이전트 오류 표시 haagent -display |grep Faults

리소스 에이전트 작업

에이전트 시작 haagent -start <에이전트_이름>[-sys]
에이전트 중지 haagent -stop <에이전트_이름>[-sys]

 

Veritas Cluster 이하 Infoscale 또는 (구)VCS [ Veritas Cluster Server] , Cluster의 역할과 관점

1. Cluster 및 배경 및 역할

 - 배경 : 옛날부터 현재까지, 그리고 앞으로도 서버의 중요기능 중 하나는 연속성입니다. 가정에서 사용되는 컴퓨터와는 다르게 24시간 365일 켜저 있어야하며, 때문에 이중화는 아직까지도 중요시되고 IT기기가 있는 모든기업이라면 중요서버에는 이중화 부분에 있어 엄격한 기준을 두는 편입니다.

 - 역할 : 이렇게 중요시 되는 이중화 부분에 있어 서버의 서비스에 대한 이중화를 해주는 것이 Cluster의 역할입니다.

아래 그림처럼 2대의 서버에 대한 Cluster가 구성되어 있다면 서버의 장애 발생시 Cluster가 해당서버에서 운영중이었던 서비스에 대한 연속성을 보장하는 역할을 수행하게 됩니다.

2. 관점

 - 2020년, 이미 예전부터 Cluster 시장은 급격하게 감소 하고 있는것이 사실입니다. x86서버의 H/W 성능 증가와 Unix시장의 몰락으로 예전에는 Unix서버 내 중요서비스가 구동되고, 그 서버의 연속성이 중요시되었다면, 2020 현재시점에선 Unix대비 저렴한 가격에 고성능 H/W인 x86서버를 다량 구매하여 용도에 맞게 서비스를 나누고, 관리하는 식이며,

이런 관리방식도, VMware의 가상서버, 현재는 Docker를 포함한 k8s(kubernetes)등 일부 상용서비스에 이미 Cluster의 기능이 내포되고 있습니다.

3. Veritas Cluster Server / infoscale 특징

 - 상용솔루션 입니다. 때문에 각 버전마다 내포된 기능들이 다릅니다.

 - 각 버전은 아래 그림과 같이 있으며, 여러 기능이 포함되 있는 것을 알 수 있습니다.

 - 또한 이 기종간의 Cluster를 지원하며, 내포된 infoscale Storage(Volume Manager)의 기능은 서로 다른 OS에서도 데이터 영역에 대한 연결(?)을 지원합니다.

 - Cluster구성 간 필요한 HeartBeat에 대하여 Mac주소 기반의 통신을 사용합니다.

4. Infoscale 시작하기

 - 먼저 상용제품이다보니 Download가 open되어 있지 않으며, 공식사이트를 통해 최신버전의 trial버전만 다운 받을 수 있습니다.

 - 공식사이트 : https://www.veritas.com/form/trialware/infoscale-solutions

 - Infoscale 설치에 앞서 중요시 되는 부분은 OS버전이며, Linux의 경우 Kerner Version을 정확히 확인 하셔야 합니다.  또한 특정 서비스 (예 : Oracle RAC)등에 대한 Software Compatibility List(SCL)에 대한 검토는 아래 사이트에서 진행합니다.
 - 호환성 검토 : https://sort.veritas.com/land

 

Veritas Cluster Server 설치 및 구성.

Veritas Cluster Server(이하 VCS)는 Symantec사의 HA(high-availability) 솔루션이다. VCS는 LLT(Low Latency Transport), GAB(Group Membership and Atomic Broadcast) 두가지 요소로 구성된다.

용어
LLT : 빠른 커널 대 커널 통신을 제공하고, 네트워크 연결을 모니터한다.
GAB : 노드들 사이에 동기화된 상태를 유지하기 위해 필요한 전체적으로 순서화된 메시지를 제공한다.

작업환경

Node1 : CentOS6.3 minimal 64bit, 외부 IP(eth0): 192.168.100.21, 내부 IP(eth1): 172.16.1.21, 호스트네임: fox1
Node2 : CentOS6.3 minimal 64bit, 외부 IP(eth0): 192.168.100.22, 내부 IP(eth1): 172.16.1.22, 호스트네임: fox2
Virtual IP : 192.168.100.20
VCS : 6.0.2

1. 설치전 요구패키지 및 확인사항(Node1, Node2 모두)
/etc/hosts화일을 아래와 같이 설정한다.

# cat /etc/hosts
192.168.100.21	fox1
192.168.100.22	fox2
192.168.100.20	fox_cluster

installer를 실행하고, Pre-Installation Check를 실행한다.

/etc/redhat-release 를 확인하고 수정해야한다. 그렇지 않으면 아래와 같은 오류가 발생한다.

                 Veritas Cluster Server 6.0.2 Precheck Program                  
                                      fox1                                      

 
Logs are being written to /var/tmp/installer-201606011239rDh while installer is 
in progress

    Verifying systems: 25%              ____________________________________ 

    Estimated time remaining: (mm:ss) 0:15                            2 of 8

    Checking system communication ..................................... Done
    Checking release compatibility .................................... Done

Precheck report completed

System verification checks completed

The following errors were discovered on the systems:

CPI ERROR V-9-20-1139 This release is intended to operate on RHEL Linux 
distributions but fox1 is a CentOS system

installer log files, summary file, and response file are saved at:

	/opt/VRTS/install/logs/installer-201606011239rDh

아래처럼 수정한다

# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.3 (Santiago)

이것을 수정하고 Pre-Installation check를 진행하면 아래와 같은 메시지를 볼 수 있다.

                 Veritas Cluster Server 6.0.2 Precheck Program                  
                                      fox1                                      

Logs are being written to /var/tmp/installer-201606011246vBr while installer is 
in progress

    Verifying systems: 100%                                                  

    Estimated time remaining: (mm:ss) 0:00                            8 of 8

    Checking system communication ..................................... Done
    Checking release compatibility .................................... Done
    Checking installed product ........................................ Done
    Checking prerequisite patches and rpms .......................... Failed
    Checking platform version ......................................... Done
    Checking file system free space ................................... Done
    Checking product licensing ........................................ Done
    Performing product prechecks ...................................... Done

Precheck report completed

System verification checks completed

The following errors were discovered on the systems:

CPI ERROR V-9-30-1316 The following required OS rpms (or higher version) were 
not found on fox1:
	glibc-2.12-1.25.el6.i686 libstdc++-4.4.5-6.el6.i686 
ksh-20100621-6.el6.x86_64 libgcc-4.4.5-6.el6.i686 perl-5.10.1-119.el6.x86_64

CPI ERROR V-9-30-1425 The following required OS commands are missing on fox1:
/bin/ls: cannot access /usr/bin/nslookup: No such file or directory

installer log files, summary file, and response file are saved at:

	/opt/VRTS/install/logs/installer-201606011246vBr

Would you like to view the summary file? [y,n,q] (n)

먼저 ksh, perl, bind-utils패키지를 설치한다. 나머지 패키지는 32bit 버전을 설치해야 한다.

# yum install ksh perl bind-utils

glibc, libstdc++ 32비트 버전을 다운로드 받는다.

# curl -O http://vault.centos.org/6.3/os/i386/Packages/glibc-2.12-1.80.el6.i686.rpm
# curl -O http://vault.centos.org/6.3/os/i386/Packages/libstdc++-4.4.6-4.el6.i686.rpm

OS 업데이트를 했다면(패키지 버전을 이미 설치되어 있는 64비트 버전과 동일하게 맞추어 주면 된다),

# curl -O http://ftp.daumkakao.com/centos/6.8/os/i386/Packages/glibc-2.12-1.192.el6.i686.rpm
# curl -O http://ftp.daumkakao.com/centos/6.8/os/i386/Packages/libstdc++-4.4.7-17.el6.i686.rpm

다운로드 받은 패키지를 설치한다.

# yum install glibc-2.12-1.192.el6.i686.rpm libstdc++-4.4.7-17.el6.i686.rpm

2. 설치
설치는 installer를 실행시키면 된다. 전반적으로 아래처럼 진행될 것이다.

# ./installer





    Storage Foundation and High Availability Solutions 6.0.2 Install Program    

Copyright (c) 2012 Symantec Corporation. All rights reserved.  Symantec, the 
Symantec Logo are trademarks or registered trademarks of Symantec Corporation or
its affiliates in the U.S. and other countries. Other names may be trademarks of
their respective owners.

The Licensed Software and Documentation are deemed to be "commercial computer 
software" and "commercial computer software documentation" as defined in FAR 
Sections 12.212 and DFARS Section 227.7202.

Logs are being written to /var/tmp/installer-201606011330eeJ while installer is 
in progress.





    Storage Foundation and High Availability Solutions 6.0.2 Install Program    

Symantec Product                                   Version Installed    Licensed
================================================================================
Symantec Licensing Utilities (VRTSvlic) are not installed due to which products 
and licenses are not discovered.
Use the menu below to continue.


Task Menu:

    P) Perform a Pre-Installation Check     I) Install a Product
    C) Configure an Installed Product       G) Upgrade a Product
    O) Perform a Post-Installation Check    U) Uninstall a Product
    L) License a Product                    S) Start a Product
    D) View Product Descriptions            X) Stop a Product
    R) View Product Requirements            ?) Help

Enter a Task: [P,I,C,G,O,U,L,S,D,X,R,?] I





    Storage Foundation and High Availability Solutions 6.0.2 Install Program    

     1)  Veritas Cluster Server (VCS)
     2)  Veritas Storage Foundation and High Availability (SFHA)
     b)  Back to previous menu

Select a product to install: [1-2,b,q] 1

Do you agree with the terms of the End User License Agreement as specified in 
the cluster_server/EULA/en/EULA_VCS_Lx_6.0.2.pdf file present on media? 
[y,n,q,?] y







                  Veritas Cluster Server 6.0.2 Install Program                  

     1)  Install minimal required rpms - 346 MB required
     2)  Install recommended rpms - 549 MB required
     3)  Install all rpms - 572 MB required
     4)  Display rpms to be installed for each option

Select the rpms to be installed on all systems? [1-4,q,?] (2) 

Enter the 64 bit RHEL6 system names separated by spaces: [q,?] fox1 fox2







                  Veritas Cluster Server 6.0.2 Install Program                  
                                    fox1 fox2                                   

Logs are being written to /var/tmp/installer-201606011330eeJ while installer is 
in progress

    Verifying systems: 100%                                                  

    Estimated time remaining: (mm:ss) 0:00                            8 of 8

    Checking system communication ..................................... Done
    Checking release compatibility .................................... Done
    Checking installed product ........................................ Done
    Checking prerequisite patches and rpms ............................ Done
    Checking platform version ......................................... Done
    Checking file system free space ................................... Done
    Checking product licensing ........................................ Done
    Performing product prechecks ...................................... Done

System verification checks completed successfully








                  Veritas Cluster Server 6.0.2 Install Program                  
                                    fox1 fox2                                   

The following Veritas Cluster Server rpms will be installed on all systems:

Rpm               Rpm Description

VRTSperl          Veritas Perl 5.14.2 Redistribution
VRTSvlic          Veritas Licensing
VRTSspt           Veritas Software Support Tools by Symantec
VRTSllt           Veritas Low Latency Transport
VRTSgab           Veritas Group Membership and Atomic Broadcast
VRTSvxfen         Veritas I/O Fencing by Symantec
VRTSamf           Veritas Asynchronous Monitoring Framework by Symantec
VRTSvcs           Veritas Cluster Server
VRTSvcsag         Veritas Cluster Server Bundled Agents by Symantec
VRTSvcsdr         Veritas Cluster Server Disk Reservation Modules
VRTSvcsea         Veritas Cluster Server Enterprise Agents by Symantec
VRTSvcsvmw        ApplicationHA Virtual Machine Wizards for application 
                  monitoring configurations, by Symantec.
VRTSsfmh          Veritas Storage Foundation Managed Host by Symantec
VRTSvbs           Veritas Virtual Business Service
VRTSsfcpi602      Veritas Storage Foundation Installer

Press [Enter] to continue: 







                  Veritas Cluster Server 6.0.2 Install Program                  
                                    fox1 fox2                                   

Logs are being written to /var/tmp/installer-201606011330eeJ while installer is 
in progress

    Installing VCS: 100%                                                     

    Estimated time remaining: (mm:ss) 0:00                          17 of 17

    Installing VRTSllt rpm ............................................ Done
    Installing VRTSgab rpm ............................................ Done
    Installing VRTSvxfen rpm .......................................... Done
    Installing VRTSamf rpm ............................................ Done
    Installing VRTSvcs rpm ............................................ Done
    Installing VRTSvcsag rpm .......................................... Done
    Installing VRTSvcsdr rpm .......................................... Done
    Installing VRTSvcsea rpm .......................................... Done
    Installing VRTSvcsvmw rpm ......................................... Done
    Installing VRTSsfmh rpm ........................................... Done
    Installing VRTSvbs rpm ............................................ Done
    Installing VRTSsfcpi602 rpm ....................................... Done
    Performing VCS postinstall tasks .................................. Done

Veritas Cluster Server Install completed successfully








                  Veritas Cluster Server 6.0.2 Install Program                  
                                    fox1 fox2                                   

To comply with the terms of Symantec's End User License Agreement, you have 60 
days to either:

 * Enter a valid license key matching the functionality in use on the systems
 * Enable keyless licensing and manage the systems with a Management Server. For
more details visit http://go.symantec.com/sfhakeyless. The product is fully 
functional during these 60 days.

     1)  Enter a valid license key
     2)  Enable keyless licensing and complete system licensing later

How would you like to license the systems? [1-2,q] (2) 

Checking system licensing






                  Veritas Cluster Server 6.0.2 Install Program                  
                                    fox1 fox2                                   

Would you like to enable the Global Cluster Option? [y,n,q] (n) 

Registering VCS license
VCS vxkeyless key (VCS) successfully registered on fox1
VCS vxkeyless key (VCS) successfully registered on fox2

Would you like to configure VCS on fox1 fox2? [y,n,q] (n) 

Veritas Cluster Server cannot be started without configuration.

Run the '/opt/VRTS/install/installvcs602 -configure' command when you are ready 
to configure Veritas Cluster Server.

Would you like to send the information about this installation to Symantec to 
help improve installation in the future? [y,n,q,?] (y) n

installer log files, summary file, and response file are saved at:

	/opt/VRTS/install/logs/installer-201606011330eeJ

Would you like to view the summary file? [y,n,q] (n)

[wpdevart_youtube]G0imNi1n6YA[/wpdevart_youtube]

3. 설치후 작업

VCS관련 커맨드를 아무데서나 실행 하기 위해 PATH에 아래를 추가한다. 여기서는 .bash_profile 에 설정할 것이다. 상황에 따라서 /etc/profile을 수정해도 되고, .bashrc를 수정해도 된다.(Node1, Node2 모두 동일하게)

.bash_profile 수정전

PATH=$PATH:$HOME/bin

수정후

PATH=/opt/VRTS/bin:$PATH:$HOME/bin

node1, node2에서 상호 ssh접속시 비밀번호를 묻지 않도록 키를 설정한다(ssh-keygen 이용).

4. 클러스터 구성

여기서는 아래 그림과 같이 가장 간단한 2 node 클러스터를 구성할 것이다. 설정중 여러 가지 사항을 물어본다. I/O fencing을 묻는 부분이 있는데, I/O fencing은 split-brain 상태에 의해 클러스터 멤버가 변화될 때 공유디스크 상의 데이타를 보호하는 방법이다. 일단, fencing은 사용하지 않는다.
클러스터 노드 이름은 fox_cluster로, heartbeat는 eth1을 사용할 것이다. secure 클러스터는 사용하지 않을 것이며, 클러스터 관리자는 기본설정(admin/password)을 사용한다.

설정은 아래와 같이 진행 될 것이다.

# /opt/VRTS/install/installvcs602 -configure





                 Veritas Cluster Server 6.0.2 Configure Program                 

Copyright (c) 2012 Symantec Corporation. All rights reserved.  Symantec, the 
Symantec Logo are trademarks or registered trademarks of Symantec Corporation or
its affiliates in the U.S. and other countries. Other names may be trademarks of
their respective owners.

The Licensed Software and Documentation are deemed to be "commercial computer 
software" and "commercial computer software documentation" as defined in FAR 
Sections 12.212 and DFARS Section 227.7202.

Logs are being written to /var/tmp/installvcs602-201606051817Zjp while 
installvcs602 is in progress.

Enter the 64 bit RHEL6 system names separated by spaces: [q,?] fox1 fox2 










                 Veritas Cluster Server 6.0.2 Configure Program                 
                                    fox1 fox2                                   

Logs are being written to /var/tmp/installvcs602-201606051817Zjp while 
installvcs602 is in progress

    Verifying systems: 100%                                                  

    Estimated time remaining: (mm:ss) 0:00                            5 of 5

    Checking system communication ..................................... Done
    Checking release compatibility .................................... Done
    Checking installed product ........................................ Done
    Checking platform version ......................................... Done
    Performing product prechecks ...................................... Done

System verification checks completed successfully

I/O Fencing

It needs to be determined at this time if you plan to configure I/O Fencing in 
enabled or disabled mode, as well as help in determining the number of network 
interconnects (NICS) required on your systems. If you configure I/O Fencing in 
enabled mode, only a single NIC is required, though at least two are 
recommended.

A split brain can occur if servers within the cluster become unable to 
communicate for any number of reasons. If I/O Fencing is not enabled, you run 
the risk of data corruption should a split brain occur. Therefore, to avoid data
corruption due to split brain in CFS environments, I/O Fencing has to be 
enabled.

If you do not enable I/O Fencing, you do so at your own risk

See the Administrator's Guide for more information on I/O Fencing

Do you want to configure I/O Fencing in enabled mode? [y,n,q,?] (y) n

Installer has detected that VCS is already configured. If you re-configure VCS, 
you will lose all the current configurations in main.cf. And you need to offline
all the resources manually before proceeding.
If you select not to re-configure, VCS configurations will not be changed and 
installer will start the processes with existing configuration. Make sure all 
the current configurations are compatible with 6.0.2.

Do you want to re-configure VCS? [y,n,q] (n) y










                 Veritas Cluster Server 6.0.2 Configure Program                 
                                    fox1 fox2                                   

To configure VCS, answer the set of questions on the next screen.

When [b] is presented after a question, 'b' may be entered to go back to the 
first question of the configuration set.

When [?] is presented after a question, '?' may be entered for help or 
additional information about the question.

Following each set of questions, the information you have entered will be 
presented for confirmation.  To repeat the set of questions and correct any 
previous errors, enter 'n' at the confirmation prompt.

No configuration changes are made to the systems until all configuration 
questions are completed and confirmed.

Press [Enter] to continue: 













                 Veritas Cluster Server 6.0.2 Configure Program                 
                                    fox1 fox2                                   

To configure VCS the following information is required:

	A unique cluster name
	Two or more NICs per system used for heartbeat links
	A unique cluster ID number between 0-65535

	One or more heartbeat links are configured as private links
	You can configure one heartbeat link as a low-priority link

All systems are being configured to create one cluster.

Enter the unique cluster name: [q,?] fox_cluster










                 Veritas Cluster Server 6.0.2 Configure Program                 
                                    fox1 fox2                                   

     1)  Configure heartbeat links using LLT over Ethernet
     2)  Configure heartbeat links using LLT over UDP
     3)  Automatically detect configuration for LLT over Ethernet
     b)  Back to previous menu

How would you like to configure heartbeat links? [1-3,b,q,?] (1) 

    Discovering NICs on fox1 .......................... Discovered eth0 eth1

Enter the NIC for the first private heartbeat link on fox1: [b,q,?] (eth1) 
Would you like to configure a second private heartbeat link? [y,n,q,b,?] (y) n
Enter the NIC for the low-priority heartbeat link on fox1: [b,q,?] (eth0) 
Are you using the same NICs for private heartbeat links on all systems? 
[y,n,q,b,?] (y) 
    Checking media speed for eth1 on fox1 ......................... 1000Mb/s
    Checking media speed for eth1 on fox2 ......................... 1000Mb/s

Enter a unique cluster ID number between 0-65535: [b,q,?] (59976) 

The cluster cannot be configured if the cluster ID 59976 is in use by another 
cluster. Installer can perform a check to determine if the cluster ID is 
duplicate. The check will take less than a minute to complete.

Would you like to check if the cluster ID is in use by another cluster? [y,n,q] 
(y) 

    Checking cluster ID ............................................... Done

Duplicated cluster ID detection passed. The cluster ID 59976 can be used for the
cluster.

Press [Enter] to continue: 












                 Veritas Cluster Server 6.0.2 Configure Program                 
                                    fox1 fox2                                   

Cluster information verification:

	Cluster Name: 	   fox_cluster
	Cluster ID Number: 59976
	Private Heartbeat NICs for fox1: 
		link1=eth1
	Low-Priority Heartbeat NIC for fox1: 
		link-lowpri1=eth0
	Private Heartbeat NICs for fox2: 
		link1=eth1
	Low-Priority Heartbeat NIC for fox2: 
		link-lowpri1=eth0

Is this information correct? [y,n,q,?] (y) 












                 Veritas Cluster Server 6.0.2 Configure Program                 
                                    fox1 fox2                                   

The following data is required to configure the Virtual IP of the Cluster:

	A public NIC used by each system in the cluster
	A Virtual IP address and netmask

Do you want to configure the Virtual IP? [y,n,q,?] (n) y

Active NIC devices discovered on fox1: eth0 eth1

Enter the NIC for Virtual IP of the Cluster to use on fox1: [b,q,?] (eth0) 
Is eth0 to be the public NIC used by all systems? [y,n,q,b,?] (y) 
Enter the Virtual IP address for the Cluster: [b,q,?] 192.168.100.20
Enter the NetMask for IP 192.168.100.20: [b,q,?] (255.255.255.0) 













                 Veritas Cluster Server 6.0.2 Configure Program                 
                                    fox1 fox2                                   

Cluster Virtual IP verification:

	NIC: eth0
	IP: 192.168.100.20
	NetMask: 255.255.255.0

Is this information correct? [y,n,q] (y) 













                 Veritas Cluster Server 6.0.2 Configure Program                 
                                    fox1 fox2                                   

Veritas Cluster Server can be configured in secure mode

Running VCS in Secure Mode guarantees that all inter-system communication is 
encrypted, and users are verified with security credentials.

When running VCS in Secure Mode, NIS and system usernames and passwords are used
to verify identity. VCS usernames and passwords are no longer utilized when a 
cluster is running in Secure Mode.

Would you like to configure the VCS cluster in secure mode? [y,n,q,?] (n) 












                 Veritas Cluster Server 6.0.2 Configure Program                 
                                    fox1 fox2                                   

The following information is required to add VCS users:

	A user name
	A password for the user
	User privileges (Administrator, Operator, or Guest)

Do you wish to accept the default cluster credentials of 'admin/password'? 
[y,n,q] (y) 

Do you want to add another user to the cluster? [y,n,q] (n) 












                 Veritas Cluster Server 6.0.2 Configure Program                 
                                    fox1 fox2                                   

VCS User verification:

	User: admin     Privilege: Administrators

	Passwords are not displayed

Is this information correct? [y,n,q] (y) 













                 Veritas Cluster Server 6.0.2 Configure Program                 
                                    fox1 fox2                                   

The following information is required to configure SMTP notification:

	The domain-based hostname of the SMTP server
	The email address of each SMTP recipient
	A minimum severity level of messages to send to each recipient

Do you want to configure SMTP notification? [y,n,q,?] (n) 












                 Veritas Cluster Server 6.0.2 Configure Program                 
                                    fox1 fox2                                   

The following information is required to configure SNMP notification:

	System names of SNMP consoles to receive VCS trap messages
	SNMP trap daemon port numbers for each console
	A minimum severity level of messages to send to each console

Do you want to configure SNMP notification? [y,n,q,?] (n) 

All VCS processes that are currently running must be stopped

Do you want to stop VCS processes now? [y,n,q,?] (y) 












                 Veritas Cluster Server 6.0.2 Configure Program                 
                                    fox1 fox2                                   

Logs are being written to /var/tmp/installvcs602-201606051817Zjp while 
installvcs602 is in progress

    Stopping VCS: 100%                                                       

    Estimated time remaining: (mm:ss) 0:00                            9 of 9

    Performing VCS prestop tasks ...................................... Done
    Stopping sfmh-discovery ........................................... Done
    Stopping vxdclid .................................................. Done
    Stopping had ...................................................... Done
    Stopping CmdServer ................................................ Done
    Stopping amf ...................................................... Done
    Stopping vxfen .................................................... Done
    Stopping gab ...................................................... Done
    Stopping llt ...................................................... Done

Veritas Cluster Server Shutdown completed successfully












                 Veritas Cluster Server 6.0.2 Configure Program                 
                                    fox1 fox2                                   

Logs are being written to /var/tmp/installvcs602-201606051817Zjp while 
installvcs602 is in progress

    Starting VCS: 100%                                                       

    Estimated time remaining: (mm:ss) 0:00                            7 of 7

    Performing VCS configuration ...................................... Done
    Starting llt ...................................................... Done
    Starting gab ...................................................... Done
    Starting amf ...................................................... Done
    Starting had ...................................................... Done
    Starting CmdServer ................................................ Done
    Performing VCS poststart tasks .................................... Done

Veritas Cluster Server Startup completed successfully


Would you like to send the information about this installation to Symantec to 
help improve installation in the future? [y,n,q,?] (y) n

installvcs602 log files, summary file, and response file are saved at:

	/opt/VRTS/install/logs/installvcs602-201606051817Zjp

Would you like to view the summary file? [y,n,q] (n) 



설정화일은 /etc/VRTSvcs/conf/config 에 위치한다.

5. 설정 후 클러스터 상태 보기

클러스터 상태 확인(hastatus).

# hastatus -summary

-- SYSTEM STATE
-- System               State                Frozen              

A  fox1                 RUNNING              0                    
A  fox2                 RUNNING              0                    

-- GROUP STATE
-- Group           System               Probed     AutoDisabled    State          

B  ClusterService  fox1                 Y          N               ONLINE         
B  ClusterService  fox2                 Y          N               OFFLINE

서비스 그룹 확인(hagrp, 자세히 보려면 -display 옵션 사용)

# hagrp -list
ClusterService		fox1
ClusterService		fox2

HA 리소스 확인(hares, 자세히 보려면 -display 옵션 사용)

# hares -list
csgnic      		fox1
csgnic      		fox2
webip       		fox1
webip       		fox2

Virtual IP확인(현재 running중인 fox1에서 확인)

# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 08:00:27:91:4C:B9  
          inet addr:192.168.100.21  Bcast:192.168.100.255  Mask:255.255.255.0
...

eth0:0    Link encap:Ethernet  HWaddr 08:00:27:91:4C:B9  
          inet addr:192.168.100.20  Bcast:192.168.100.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

eth1      Link encap:Ethernet  HWaddr 08:00:27:4F:75:9F  
          inet addr:172.16.1.21  Bcast:172.16.1.255  Mask:255.255.255.0
...

fox1에서 실행되는 ClusterService를 fox2로 switch over

# hastatus -sum

-- SYSTEM STATE
-- System               State                Frozen              

A  fox1                 RUNNING              0                    
A  fox2                 RUNNING              0                    

-- GROUP STATE
-- Group           System               Probed     AutoDisabled    State          

B  ClusterService  fox1                 Y          N               ONLINE         
B  ClusterService  fox2                 Y          N               OFFLINE        
[root@fox1 config]# 
[root@fox1 config]# hagrp -switch ClusterService -to fox2
[root@fox1 config]# 
[root@fox1 config]# hastatus -sum

-- SYSTEM STATE
-- System               State                Frozen              

A  fox1                 RUNNING              0                    
A  fox2                 RUNNING              0                    

-- GROUP STATE
-- Group           System               Probed     AutoDisabled    State          

B  ClusterService  fox1                 Y          N               OFFLINE        
B  ClusterService  fox2                 Y          N               OFFLINE|STARTING

-- RESOURCES ONLINING
-- Group           Type            Resource             System               IState

F  ClusterService  IP              webip                fox2                 W_ONLINE
[root@fox1 config]# hastatus -sum

-- SYSTEM STATE
-- System               State                Frozen              

A  fox1                 RUNNING              0                    
A  fox2                 RUNNING              0                    

-- GROUP STATE
-- Group           System               Probed     AutoDisabled    State          

B  ClusterService  fox1                 Y          N               OFFLINE        
B  ClusterService  fox2                 Y          N               ONLINE

fox2에 가상IP가 부여 되었음을 ifconfig 명령어로 확인 할 수 있다.

6. 클러스터 시작 및 정지

installer를 이용하여 시작/정지 하는 방법

# /opt/VRTS/install/installvcs602 -start
# /opt/VRTS/install/installvcs602 -stop

수동으로 VCS를 시작하는 것은(양쪽 노드 모두 vcs 관련 데몬을 실행한다.) 아래 과정과 같다.

 # /etc/init.d/llt start
Starting LLT: 
LLT: loading module...
Loaded 2.6.32-71.el6.x86_64 on kernel 2.6.32-642.el6.x86_64
WARNING:  No modules found for 2.6.32-642.el6.x86_64, using compatible modules for 2.6.32-71.el6.x86_64.
LLT: configuring module...

# /etc/init.d/gab start
Starting GAB: 
Loaded 2.6.32-71.el6.x86_64 on kernel 2.6.32-642.el6.x86_64
WARNING:  No modules found for 2.6.32-642.el6.x86_64, using compatible modules for 2.6.32-71.el6.x86_64.
Started gablogd
gablogd: Keeping 20 log files of 8388608 bytes each in |/var/log/gab_ffdc| directory. Daemon log size limit 8388608 bytes

# /etc/init.d/vxfen start
This script is not allowed to start vxfen. VXFEN_START is not 1

# /etc/init.d/vcs start
Starting VCS:                                              [  OK  ]

한쪽 노드에서 hastart를 실행한다.

# hastart

수동으로 VCS를 정지시키는 것은 아래 과정과 같다(양쪽 노드에서 각각 실행한다).
Node1(fox1)에서,

[root@fox1 ~]# # hagrp -offline ClusterService -sys fox1
VCS WARNING V-16-1-40127 It is not recommended to offline the ClusterService group. To forcibly offline the ClusterService group, use the '-force' option.
[root@fox1 ~]# hagrp -offline -force ClusterService -sys fox1
[root@fox1 ~]# hagrp -state ClusterSerivce
VCS WARNING V-16-1-40131 Group ClusterSerivce does not exist in the local cluster
[root@fox1 ~]# hastop -local
[root@fox1 ~]# gabconfig -a
GAB Port Memberships
===============================================================
Port a gen   319601 membership 01
[root@fox1 ~]# 
[root@fox1 ~]# /etc/init.d/gab stop
Stopping GAB: 
[root@fox1 ~]# /etc/init.d/llt stop
Stopping LLT: 

Node2(fox2)에서

[root@fox2 ~]# hagrp -offline -force ClusterService -sys fox2
[root@fox2 ~]# hagrp -state ClusterService
#Group         Attribute             System     Value
ClusterService State                 fox1       |OFFLINE|
ClusterService State                 fox2       |OFFLINE|
[root@fox2 ~]# hastop -local
[root@fox2 ~]# gabconfig -a
GAB Port Memberships
===============================================================
Port a gen   319602 membership ;1
[root@fox2 ~]# /etc/init.d/gab stop
Stopping GAB: 
[root@fox2 ~]# /etc/init.d/llt stop
Stopping LLT: 

 

참고문서:
http://www.em-dba.com/emvcs01.html#REF-1.1

 

리눅스에서 Veritas Cluster Server(VCS) 설치 및 사용 – part 2

 

이전글 리눅스에서 Veritas Cluster Server(VCS) 설치 및 사용 – part 1에서는 가장 간단한 2node VCS를 구성해 보았다.
이제, 공유스토리지를 추가하고 서비스(apache web server)를 추가할 것이다. 공유스토리지는 리눅스 LVM을 사용할 것이다.
공유스토리지를 추가한 구성은 아래 그림과 같다.



구성환경
Node1 : CentOS6.3 minimal 64bit, 외부 IP(eth0): 192.168.100.21, 내부 IP(eth1): 172.16.1.21, 호스트네임: fox1
Node2 : CentOS6.3 minimal 64bit, 외부 IP(eth0): 192.168.100.22, 내부 IP(eth1): 172.16.1.22, 호스트네임: fox2
Virtual IP : 192.168.100.20
VCS : 6.0.2
OS disk: sdd
Shared Storage: sda, sdb, sdc 각각 1GB 크기. 이중 sda 를 LV로 만들어 사용.

용어:
■ Resource – 어플리케이션을 구성하는 하드웨어 또는 소프트웨어 엔티티. Disk Group과 화일시스템, IP, NIC과 어플리케이션은 리소스의 예라 할 수 있다.
■ Resource dependency – 어플리케이션이나 OS의 요구에 의해서 리소스들이 상호 의존하는것을 나타냄. 보통 계층구조로 나타낼 수 있다.
■ Resource type – 각 리소스를 관리하기위해 타입을 정의한다. 가령, 네트워크카드를 관리하기위해 NIC resource 타입을 설정할 수 있고, IP주소를 사용하기 위해 IP resource 타입을 설정 할 수 있다. VCS는 미리 정의된 resource type을 가진다.
■ Service group – VCS에 의해 관리되는 어플리케이션을 실행하는데 필요한 모든 하드웨어 및 소프트웨어 자원을 포함하는 가상 컨테이너(Virtual Container). 세가지 타입(failover, parallel, hybrid)의 서비스 그룹이 있다.
failover service group – 클러스터에서 한 순간에 단 하나의 시스템에서만 실행되는 서비스 그룹.
parallel service group – 클러스터에서 동시에 하나 이상의 시스템에서 실행되는 서비스 그룹.
hybrid service group – replicated data 클러스터와 failover,parallel 서비스그룹의 조합.
■ ClusterService group – VCS 구성요소에 의해 요구되는 리소스를 가지는 특별한 용도의 서비스 그룹이다.

1. 사전작업
1.1. Apache 웹서버 설치(간단하게 패키지로 설치한다. 상황에따라, 컴파일 설치해도 되며, 여기서는 시험용으로 다른 모듈들은 설치하지 않았다.)
양쪽 노드Node1, Node2 모두 설치하도록 한다.

# yum install httpd

1.2. 리눅스 공유디스크 설정.
Node1에서 아래처럼 LVM을 만든다. fox_vg에 fox_lv를 만들어 ext4로 포맷하고 export한다.

[root@fox1 ~]# pvcreate /dev/sda
[root@fox1 ~]# vgcreate fox_vg /dev/sda
  Volume group "fox_vg" successfully created
[root@fox1 ~]# lvcreate -n fox_lv -l 100%FREE fox_vg
  Logical volume "fox_lv" created.
[root@fox1 ~]# mkfs -t ext4 /dev/mapper/fox_vg-fox_lv 
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
65280 inodes, 261120 blocks
13056 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=268435456
8 block groups
32768 blocks per group, 32768 fragments per group
8160 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376

Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 33 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@fox1 ~]# vgchange -a n fox_vg
  0 logical volume(s) in volume group "fox_vg" now active
[root@fox1 ~]# vgexport fox_vg
  Volume group "fox_vg" successfully exported

Node2에서는, Node1에서 만든 fox_vg를 import한다.

[root@fox2 ~]# vgimport fox_vg
  Volume group "fox_vg" successfully imported
[root@fox2 ~]# vgchange -a y fox_vg
  1 logical volume(s) in volume group "fox_vg" now active

2. 설정.
2.1. 설정 전 클러스터 설정 화일을 쓰기 가능하게 만든다.

[root@fox1 ~]# haconf -makerw

2.2. 서비스 그룹 만들고, 속성을 변경한다
서비스그룹의 이름은 apache_sg로 만들고, SystemList, AutoStartList 속성을 설정한다.

[root@fox1 ~]# hagrp -add apache_sg
VCS NOTICE V-16-1-10136 Group added; populating SystemList and setting the Parallel attribute recommended before adding resources
[root@fox1 ~]# hagrp -modify apache_sg SystemList fox1 0 fox2 1
[root@fox1 ~]# hagrp -modify apache_sg AutoStartList fox1

2.3. 서비스 그룹 apache_sg 를 위한 리소스를 생성한다.

apache_sg 서비스 그룹에 디스크 그룹 리소를 추가한다. 디스크 그룹 리소스는 apache_vg type은 LVMVolumeGroup이다.

[root@fox1 ~]# hares -add apache_vg LVMVolumeGroup apache_sg
VCS NOTICE V-16-1-10242 Resource added. Enabled attribute must be set before agent monitors
[root@fox1 ~]# hares -modify apache_vg Critical 0
[root@fox1 ~]# hares -modify apache_vg VolumeGroup fox_vg
[root@fox1 ~]# hares -modify apache_vg Enabled 1
[root@fox1 ~]# hares -online apache_vg -sys fox1
[root@fox1 ~]# hares -state apache_vg
#Resource    Attribute             System     Value
apache_vg    State                 fox1       ONLINE
apache_vg    State                 fox2       OFFLINE

Volume 리소스를 서비스 그룹에 추가 한다.

[root@fox1 ~]# hares -add apache_lv LVMLogicalVolume apache_sg
VCS NOTICE V-16-1-10242 Resource added. Enabled attribute must be set before agent monitors
[root@fox1 ~]# hares -modify apache_lv Critical 0
[root@fox1 ~]# hares -modify apache_lv LogicalVolume fox_lv
[root@fox1 ~]# hares -modify apache_lv VolumeGroup fox_vg
[root@fox1 ~]# hares -modify apache_lv Enabled 1
[root@fox1 ~]# hares -online apache_lv -sys fox1
[root@fox1 ~]# hares -state apache_lv
#Resource    Attribute             System     Value
apache_lv    State                 fox1       ONLINE
apache_lv    State                 fox2       OFFLINE

Mount 리소스를 서비스그룹에 추가한다.

[root@fox1 ~]# hares -add apache_mnt Mount apache_sg
VCS NOTICE V-16-1-10242 Resource added. Enabled attribute must be set before agent monitors
[root@fox1 ~]# hares -modify apache_mnt Critical 0
[root@fox1 ~]# hares -modify apache_mnt MountPoint /var/www/html
[root@fox1 ~]# hares -modify apache_mnt BlockDevice /dev/mapper/fox_vg-fox_lv 
[root@fox1 ~]# hares -modify apache_mnt FSType ext4
[root@fox1 ~]# hares -modify apache_mnt FsckOpt %-y
[root@fox1 ~]# hares -modify apache_mnt Enabled 1
[root@fox1 ~]# hares -online apache_mnt -sys fox1
[root@fox1 ~]# hares -state apache_mnt
#Resource    Attribute             System     Value
apache_mnt   State                 fox1       ONLINE
apache_mnt   State                 fox2       OFFLINE

Apache 리소스를 서비스 그룹에 추가한다.

[root@fox1 ~]# hares -add apache_svc Apache apache_sg
VCS NOTICE V-16-1-10242 Resource added. Enabled attribute must be set before agent monitors
[root@fox1 ~]# hares -modify apache_svc Critical 0
[root@fox1 ~]# hares -modify apache_svc ConfigFile /etc/httpd/conf/httpd.conf
[root@fox1 ~]# hares -modify apache_svc httpdDir /usr/sbin
[root@fox1 ~]# hares -modify apache_svc Enabled 1
[root@fox1 ~]# hares -state apache_svc
#Resource    Attribute             System     Value
apache_svc   State                 fox1       ONLINE
apache_svc   State                 fox2       OFFLINE

2.4. 리소스 디펜던시를 정의하고 링크한다.

[root@fox1 ~]# hares -link apache_lv apache_vg
[root@fox1 ~]# hares -link apache_mnt apache_lv
[root@fox1 ~]# hares -link apache_svc apache_mnt
[root@fox1 ~]# hares -dep | grep apache_sg
apache_sg      apache_lv  apache_vg
apache_sg      apache_mnt apache_lv
apache_sg      apache_svc apache_mnt

2.5. 클러스터 설정화일을 읽기 전용으로 바꾼다.

[root@fox1 ~]# haconf -dump -makero

2.6. 서비스그룹을 실행한다.

[root@fox1 ~]# hagrp -online apache_sg -sys fox1
[root@fox1 ~]# df
Filesystem           1K-blocks    Used Available Use% Mounted on
/dev/sdd1              8118712 3164604   4535036  42% /
tmpfs                   510036       0    510036   0% /dev/shm
/dev/mapper/fox_vg-fox_lv
                       1011672    1284    958164   1% /var/www/html

3. 테스트
/var/www/html/index.html 화일을 만들거나 수정하고, 웹브라우저로 접속해 본다.

서비스 그룹을 Node2로 이동시킨다. 여기서 ClusterService도 이동하는 이유는, apache_sg에 IP 리소스를 만들지 않았기 때문이다. 따라서, 기본 서비스인 ClusterService도 같이 이동한다.

[root@fox1 ~]# hagrp -switch apache_sg -to fox2
[root@fox1 ~]# hagrp -switch ClusterService -to fox2
[root@fox1 ~]# hastatus -sum

-- SYSTEM STATE
-- System               State                Frozen              

A  fox1                 RUNNING              0                    
A  fox2                 RUNNING              0                    

-- GROUP STATE
-- Group           System               Probed     AutoDisabled    State          

B  ClusterService  fox1                 Y          N               OFFLINE        
B  ClusterService  fox2                 Y          N               ONLINE         
B  apache_sg       fox1                 Y          N               OFFLINE        
B  apache_sg       fox2                 Y          N               ONLINE         
[root@fox1 ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       7.8G  3.1G  4.4G  42% /
tmpfs           499M     0  499M   0% /dev/shm
tmpfs           4.0K     0  4.0K   0% /dev/vx

node2에서 확인해보면,

[root@fox2 ~]# hastatus -sum

-- SYSTEM STATE
-- System               State                Frozen              

A  fox1                 RUNNING              0                    
A  fox2                 RUNNING              0                    

-- GROUP STATE
-- Group           System               Probed     AutoDisabled    State          

B  ClusterService  fox1                 Y          N               OFFLINE        
B  ClusterService  fox2                 Y          N               ONLINE         
B  apache_sg       fox1                 Y          N               OFFLINE        
B  apache_sg       fox2                 Y          N               ONLINE         
[root@fox2 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             7.8G  1.9G  5.5G  26% /
tmpfs                 499M     0  499M   0% /dev/shm
/dev/mapper/fox_vg-fox_lv
                      988M  1.3M  936M   1% /var/www/html

4. 기타

리소스 타입 보기

# hatype -list
ASMDG
ASMInst
Apache
...
IP
IPMultiNIC
KVMGuest
LVMLogicalVolume
LVMVolumeGroup
Mount
...
VolumeSet

클러스터에 등록된 시스템 보기

# hasys -list
fox1
fox2

클러스터 정보 보기

# haclus -display
#Attribute             Value
AdministratorGroups    
Administrators         admin
AutoAddSystemToCSG     1
AutoStartTimeout       150
BackupInterval         0
CID                    {f7df0792-1dd1-11b2-bf1b-9e3e294c71de}
ClusState              RUNNING
ClusterAddress         192.168.100.20
ClusterLocation        
ClusterName            fox_cluster
 ...     ...
TypeLimit              100
UseFence               NONE
UserNames              admin
VCSFeatures            NONE
VCSMode                VCS
WACPort                14155

LDF(log data file) 보기
현재 시스템에서 볼 수 있는 LDF 리스트 확인

# hamsg -list
#Log data files
hashadow-err_A
Mount_A
Apache_A
HostMonitor_A
CmdServer-log_A
IP_A
engine_A

이중 IP_A의 LDF확인

# hamsg -info IP_A
#Attribute             Value
Version                3.0
System name            fox2
Platform               LINUX
Create Date            2016년 06월 17일 (금) 오후 03시 20분 12초
Last Modify Time       2016년 06월 17일 (금) 오후 03시 20분 12초

CRITICAL Messages      0
ERROR Messages         3
WARNING Messages       0
NOTICE Messages        0
INFO Messages          0

VCS Messages           0
Cluster Messages       0
System Messages        0
Group Messages         0
Agent Messages         0
Resource Messages      3

Total Messages         3
320x100
반응형