问题
本文提供多条群集服务器 (VCS) 命令的参考信息。
解决方案
LLT 和 GAB
VCS 使用 LLT 和 GAB 这两个组件通过专用网络在系统之间共享数据。
这两个组件提供 VCS 所需的性能和可靠性。
LLT | LLT(低延迟传输)提供快速的内核到内核通信,并且监控网络连接。系统管理员通过创建配置文件 (llttab) 来配置 LLT,该配置文件用于描述群集中的系统及其之间的专用网络链接。LLT 在网络堆栈的第 2 层运行 |
GAB | GAB(组成员关系和原子广播)提供在系统之间保持同步状态所需的全局消息顺序,并且监控磁盘通信(例如 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 初始化磁盘区域 |
gabdiskhb(心跳磁盘)
|
-a 添加 gab 磁盘心跳资源 |
gabconfig
|
-c 配置要使用的驱动程序 |
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 <number of nodes> |
覆盖 gabtab 文件中的种子值 | gabconfig -c -x |
GAB 端口成员关系
列出成员关系 | gabconfig -a |
注销端口 f | /opt/VRTS/bin/fsclustadm cfsdeinit |
端口功能 | a gab 驱动程序 b I/O 防护(设计为保证数据完整性) d ODM (Oracle Disk Manager) f CFS(群集文件系统) h VCS(VERITAS Cluster Server:高可用性后台驻留程序) o VCSMM 驱动程序(Oracle 和 VCS 接口需要的内核模块) q QuickLog 后台驻留程序 v CVM (Cluster Volume Manager) w vxconfigd(用于 cvm 的模块) |
群集后台驻留程序
高可用性后台驻留程序 | had |
同伴后台驻留程序 | hashadow |
资源代理后台驻留程序 | <resource>Agent |
Web 控制台群集管理后台驻留程序 | CmdServer |
群集日志文件
日志目录 | /var/VRTSvcs/log |
主日志文件(引擎日志文件) | /var/VRTSvcs/log/engine_A.log |
启动和停止群集
“-stale”指示引擎将本地配置视为无效 |
hastart [-stale|-force] |
使用特定服务器中的配置文件使群集从失效状态进入运行模式 |
hasys -force <server_name> |
在本地服务器上停止群集。 注意:这也将使任何群集资源脱机。 |
hastop -local |
在本地服务器上停止群集但将应用程序迁移(故障转移)到群集内的另一个节点 |
hastop -local -evacuate |
在所有节点上停止群集,但让群集资源保持联机。 |
hastop -all -force |
群集状态
显示群集摘要 | hastatus -summary |
持续监视群集 | hastatus |
验证群集是否正在运行 | hasys -display |
群集详细信息
有关群集的信息 | haclus -display |
特定群集属性的值 | haclus -value <attribute> |
修改群集属性 | haclus -modify <attribute name> <new> |
启用 LinkMonitoring | haclus -enable LinkMonitoring |
禁用 LinkMonitoring | haclus -disable LinkMonitoring |
用户
添加用户 | hauser -add <username> |
修改用户 | hauser -update <username> |
删除用户 | hauser -delete <username> |
显示所有用户 | hauser -display |
系统操作
将系统添加到群集中 | hasys -add <sys> |
从群集中删除系统 | hasys -delete <sys> |
修改系统属性 | hasys -modify <sys> <modify options> |
列出系统状态 | hasys -state |
强制系统启动 | hasys -force |
显示系统属性 | hasys -display [-sys] |
列出群集中的所有系统 | hasys -list |
更改系统的加载属性 | hasys -load <system> <value> |
显示系统 nodeid (/etc/llthosts) 的值 | hasys -nodeid |
冻结系统(无脱机系统、无组联机) | hasys -freeze [-persistent][-evacuate] 注意:main.cf 必须处于写入模式 |
解冻系统(重新启用组和使资源恢复联机) | hasys -unfreeze [-persistent] 注意:main.cf 必须处于写入模式 |
动态配置
VCS 配置必须处于读/写模式才能进行更改。处于读/写模式时,配置变得无效,
系统会在 $VCS_CONF/conf/config 中创建一个 .stale 文件。在配置恢复只读模式时,
系统会删除此 .stale 文件。
将配置更改为读/写模式 | haconf -makerw |
将配置更改为只读模式 | haconf -dump -makero |
检查群集在哪种模式下运行 | haclus -display |grep -i 'readonly' 0 = 写入模式 |
检查配置文件 | 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 -display <group>”列出属性 |
列出服务组 | hagrp -list |
列出组依赖关系 | hagrp -dep <group> |
列出组的参数 | hagrp -display <group> |
显示服务组的资源 | hagrp -resources <group> |
显示服务组的当前状态 | hagrp -state <group> |
清除特定组中出现故障的非持久性资源 | hagrp -clear <group> [-sys] <host> <sys> |
更改群集中的系统列表 | # 删除主机 # 添加新主机(请记得指明其位置) # 更新 autostart 列表 |
服务组操作
启动服务组并使其资源联机 | hagrp -online <group> -sys <sys> |
停止服务组并使其资源脱机 | hagrp -offline <group> -sys <sys> |
在系统之间切换服务组 | hagrp -switch <group> to <sys> |
启用组中的所有资源 | hagrp -enableresources <group> |
禁用组中的所有资源 | hagrp -disableresources <group> |
冻结服务组(禁用联机和脱机) | hagrp -freeze <group> [-persistent] 注意:使用“hagrp -display <group> | grep TFrozen”来检查结果 |
解冻服务组(启用联机和脱机) | hagrp -unfreeze <group> [-persistent] 注意:使用“hagrp -display <group> | grep TFrozen”来检查结果 |
启用服务组。只能使已启用的组进入联机状态 | haconf -makerw 注意:运行“hagrp -display | grep Enabled”命令来检查结果 |
禁用服务组。停止进入联机状态 | haconf -makerw 注意:运行“hagrp -display | grep Enabled”命令来检查结果 |
刷新服务组并允许执行纠正操作。 | hagrp -flush <group> -sys <system> |
资源
添加资源 | 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 <resource> haconf -dump -makero |
更改资源 | haconf -makerw 注意:可使用“hares -display <resource>”列出参数 |
将资源属性改为全局属性 | hares -global <resource> <attribute> <value> |
将资源属性改为局部属性 | hares -local <resource> <attribute> <value> |
列出资源的参数 | hares -display <resource> |
列出资源 | hares -list |
列出资源依赖关系 | hares -dep |
资源操作
使资源联机 | hares -online <resource> [-sys] |
使资源脱机 | hares -offline <resource> [-sys] |
显示资源状态(脱机、联机等) | hares -state |
显示资源的参数 | hares -display <resource> |
使资源脱机并将命令传播到其子项 | hares -offprop <resource> -sys <sys> |
促使资源代理立即监视资源 | hares -probe <resource> -sys <sys> |
清除资源(自动启动联机) | hares -clear <resource> [-sys] |
资源类型
添加资源类型 | hatype -add <type> |
删除资源类型 | hatype -delete <type> |
列出所有资源类型 | hatype -list |
显示资源类型 | hatype -display <type> |
列出特定资源类型 | hatype -resources <type> |
更改特定资源类型属性 | hatype -value <type> <attr> |
资源代理
添加代理 | pkgadd -d . <agent package> |
删除代理 | pkgrm <agent package> |
更改代理 | n/a |
列出所有 ha 代理 | haagent -list |
显示代理运行时信息,即是否已启动?是否正在运行? | haagent -display <agent_name> |
显示代理故障 | haagent -display |grep Faults |
资源代理操作
启动代理 | haagent -start <agent_name>[-sys] |
停止代理 | haagent -stop <agent_name>[-sys] |