HACMP&Cluster的常用命令
(2013-09-03 14:45:58)
标签:
it |
分类: SAP_Basis |
HACMP & Cluster的常用命令
——转自网络,感谢源创人!
1、查看HACMP配置情况
#
/usr/es/sbin/cluster/utilities/cllscf 显示群集拓朴
#
/usr/es/sbin/cluster/utilities/cllsclstr 显示群集定义
#
/usr/es/sbin/cluster/utilities/cllsnode 按节点显示拓朴信息
#
/usr/es/sbin/cluster/utilities/cllsnw 按网络名称显示拓朴信息
#
/usr/es/sbin/cluster/utilities/cllsif 按网卡显示拓朴信息
#
/usr/es/sbin/cluster/utilities/clshowres 显示资源组信息
2、查看cluster运行情况
/usr/sbin/cluster/clstat
3、启动HACMP
# smitty clstart
4、停止HACMP:
# smitty clstop
注:有三种停止方式:
graceful:只停止本节点上HACMP的运行,并释放由本节点管理的资源(允许其它节点接管)。
graceful with
takeover:停止本节点上HACMP的运行,释放资源,让其他节点接管。
forced:停止本节点上HACMP的运行,但不释放资源。
5、查看Cluster的进程状态:
# ps -ef | grep
cluster
6、查看Cluster的日志及错误信息:
# tail -f
/tmp/hacmp.out
# more
/var/adm/cluster.log
7、查看Cluster运行的历史记录:
# cd
/usr/sbin/cluster/history
注:此目录下存放着每天的Cluster运行记录
8、查看Cluster运行时的网络情况及资源组的使用情况:
HACMP启动之前:
# netstat -i
此时应可以看到boot和standby地址
# lsvg -o
此时只能看到本地的VG
HACMP启动之后:
# netstat -i
此时应可以看到service和standby地址
# lsvg -o
此时应可以看到本地的VG及共享VG
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
<–节点A状态
Interface: j50_a_srv (0)
Address: 192.9.200.1 <– 服务IP地址
State: UP
<–服务IP状态
Interface: j50_a_tty1 (1)
Address: 0.0.0.0
State: UP
<–心跳线状态
Node: j50b State: UP
<–节点B状态
Interface: j50_b_srv (0)
Address: 192.9.200.2 <– 服务IP地址
State: UP
<–服务IP状态
Interface: j50_b_tty1 (1)
Address: 0.0.0.0
State: UP
<–心跳线状态
—————————————————————-
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配置的校验
进行Cluster配置的校验