HACMP配置引數和常用命令

victorymoshui發表於2011-03-28

Cluster的配置引數:
引數名稱引數值
Cluster ID
Cluster Name
Node Name
Resource Group Name
Node RelationshipCascadingcascading
Participating Node Names
Service IP label
Filesystems
Filesystems Consistency Checkfsckfsck
Filesystems Recovery MethodSequentialsequential
Volume Groups
Application Servers
Start s cript
Stop s cript

檢查心跳線是否已經配置好:
1、在兩臺上分別輸入如下命令:
S85_1# cat /etc/hosts >/dev/tty0
S85_2# cat 如果在S85_2機能接收到資訊,則表明心跳線已經配置好
2、測試心跳線是否可以正常工作:
在A機上:
# stty 在B機上:
# stty 如果在兩臺主機上均出現了該TTY的配置資訊,則說明心跳線設定正確。

安裝HACMP時,一般不選擇全部安裝,只安裝一部分關鍵的軟體,如cluster.adt、cluster.base、cluster.cspoc和cluster.doc.en_US。
HA可把故障機的應用及其資源(包括用到的IP地址和磁碟空間等)接管過來.

1、/usr/es/sbin/cluster/utilities/cllscf Show Cluster Topology
2、/usr/es/sbin/cluster/utilities/cllsclstr Show Cluster Definitions
3、/usr/es/sbin/cluster/utilities/cllsnode Show Topology Information by Node
4、/usr/es/sbin/cluster/utilities/cllsnw Show Topology Information by Network Name
5、/usr/es/sbin/cluster/utilities/cllsif Show Topology Information by Network Adapter
6、/usr/es/sbin/cluster/utilities/clshowres -g'sxptt_con_rg'
Show Resource Information by Resource Group
7、/usr/es/sbin/cluster/utilities/clshowres -n's85a'
Show Resource Information by Node

Filesystems Consistency Check
1. fsck
2. logredo

Resource Group的三種節點關係
(Node Relationship):
(1) Cascading
(2) Concurrent
(3) Rotating

HA啟動指令碼:/usr/sbin/cluster/local/app_start1
HA停止指令碼:/usr/sbin/cluster/local/app_stop1

lspv -p hdiskx 列出hdiskx上PP的狀態
lspv hdiskx 看hdiskx上的詳細資訊
lspv 看硬碟及所在VG
lslv lv00 檢視LV狀態
lsvg -p datavg 看指定VG上所有的硬碟

HACMP的常用命令:

1、檢視Cluster的執行情況:
# /usr/sbin/cluster/clinfo –a
# /usr/sbin/cluster/clstat
/usr/sbin/cluster/clstat可以幫助你檢視當前HACMP的節點狀態。
螢幕會如下顯示:
clstat - HACMP for AIX Cluster Status Monitor
----------------------------------------------------------------
Cluster: cluster1 (1) Tue Jul 20 09:52:03 CDT 1999
State: UP Nodes: 2
SubState: STABLE

Node: j50a State: UP Interface: j50_a_srv (0) Address: 192.9.200.1 State: UP Interface: j50_a_tty1 (1) Address: 0.0.0.0
State: UP

Node: j50b State: UP Interface: j50_b_srv (0) Address: 192.9.200.2 State: UP Interface: j50_b_tty1 (1) Address: 0.0.0.0
State: UP

************************ f/forward, b/back, r/refresh, q/quit *****************

2、啟動HACMP:
# smitty clstart
注:有兩種啟動HACMP的方式:
now:手工啟動HACMP
restart、both:在系統啟動時自動啟動HACMP

3、停止HACMP:
# smitty clstop
注:有三種停止方式:
graceful:只停止本節點上HACMP的執行,並釋放由本節點管理的資源,但
允許其它節點接管。
graceful with takeover:停止本節點上HACMP的執行,釋放資源,讓其他節
點接管。
forced:停止本節點上HACMP的執行,但不釋放資源。

4、檢視Cluster的程式狀態:
# ps –ef | grep cluster
注:應有三個HACMP程式:clstrmgr、clinfo、clsnuxpd

5、檢視Cluster的日誌及錯誤資訊:
# more /tmp/hacmp.out
# more /var/adm/cluster.log
注:可以在啟動HACMP時使用 # tail –f /tmp/hacmp.out命令,以檢視HACMP的
啟動是否正常或跟蹤啟動時的錯誤資訊。

6、檢視Cluster執行的歷史記錄:
# cd /usr/sbin/cluster/history
注:此目錄下存放著每天的Cluster執行記錄

7、檢視Cluster執行時的網路情況及資源組的使用情況:
HACMP啟動之前:
# netstat –i
此時應可以看到boot和standby地址
# lsvg –o
此時只能看到本地的VG
HACMP啟動之後:
# netstat –i
此時應可以看到service和standby地址
# lsvg –o
此時應可以看到本地的VG及共享VG

8、儲存和恢復Cluster的配置:
儲存cluster的配置:
#smitty hacmp
選擇:Cluster Configuration→Cluster Snapshots→Add a Cluster Snapshot
鍵入Snapshot檔名(Cluster Snapshot Name)
恢復cluster的配置:
# smitty hacmp
選擇:Cluster Configuration→Cluster Snapshots→Apply a Cluster Snapshot
鍵入Snapshot檔名(Cluster Snapshot Name)

注:選單中各項的意義:
Cluster Snapshot Name:指定Cluster Snapshot的檔名
Cluster Snapshot Des cription:對Cluster Snapshot地描述
Un/Configure Cluster Resource:是否重新配置Cluster資源
Force Apply if verify fails:當Cluster校驗失敗時,是否強制恢復配置

9、注意:向由HACMP管理的共享VG中增加FS時的具體步驟為:
1)、# smitty
選擇:System storage management
File systems
Add/change/show/delete file systems
Journaled file systems
Add a journaled file system
Add a standard journaled file system
選擇共享VG
指定FS的大小,Mount point
2)、# smitty clstop
停止HACMP的執行
3)、在增加FS的節點上作:
# varyoffvg SHARE_VG_NAME
# exportvg SHARE_VG_NAME
在另一個節點上作:
# importvg –y SHARE_VG_NAME –f hdiskX
# varyonvg SHARE_VG_NAME
作此步的目的是將新加入的FS的定義取過來
4)、# smitty hacmp
選擇:cluster configuration
cluster resources
define resource group
change/show resources for a resource group
將增加的FS加入到Cluster資源組的定義中
5)、# smitty hacmp
選擇:cluster configuration
cluster resources
synchronize cluster resources
同步Cluster的資源組的配置
6)、# smitty hacmp
選擇:cluster configuration
cluster verification
進行Cluster配置的校驗

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9390331/viewspace-691147/,如需轉載,請註明出處,否則將追究法律責任。

相關文章