on  it road.com

测试防护配置

  1. 查看围列状态
# vxfenadm -d
Fencing Protocol Version: 201
 Fencing Mode: SCSI3
 Fencing Mechanism: dmp
 Cluster Members:
        * 0 (node01)
          1 (node02)
RSM State Information
     node 0 in state 8 (running)
     node 1 in state 8 (running)
  1. 检查GAB端口“b”状态
# gabconfig -a
GAB Port Memberships 
==================================
Port a gen 24ec03 membership 01
Port b gen 24ec06 membership 01
Port h gen 24ec09 membership 01
  1. 检查配置文件
# grep SCSI3 /etc/VRTSvcs/conf/config/main.cf
UseFence = SCSI3
# cat /etc/vxfenmode
...
vxfen_mode=scsi3
...
scsi3_disk_policy=dmp
# cat /etc/vxfendg
fendg
cat /etc/vxfentab
...
/dev/vx/rdmp/emc_dsc01
/dev/vx/rdmp/emc_dsc02
/dev/vx/rdmp/emc_dsc03
  1. 检查所有协调器磁盘上的 SCSI 保留密钥
    在我的情况下,我每个磁盘有 2 个节点和 2 个路径,因此我应该能够在以下命令的输出中看到每个磁盘 4 个键(每个路径 1 个,每个节点 1 个)。
# vxfenadm -s all -f /etc/vxfentab
Reading SCSI Registration Keys...
Device Name: /dev/vx/rdmp/emc_dsc01 Total Number Of Keys: 4
key[0]:
[Numeric Format]: 32,74,92,78,21,28,12,65
        [Character Format]: VF000701
* [Node Format]: Cluster ID: 5 Node ID: 1 Node Name: node02
key[1]:
[Numeric Format]: 32,74,92,78,21,28,12,65 [Character Format]: VF000701
* [Node Format]: Cluster ID: 5 Node ID: 1 Node Name: node02
key[2]:
[Numeric Format]: 32,74,92,78,21,28,12,66 [Character Format]: VF000700
* [Node Format]: Cluster ID: 5 Node ID: 0 Node Name: node01
key[3]:
[Numeric Format]: 32,74,92,78,21,28,12,66 [Character Format]: VF000700
* [Node Format]: Cluster ID: 5 Node ID: 0 Node Name: node01
如何配置 VCS I/O 防护

I/O 防护(I/O fencing)是 VCS 的一项非常重要的功能,可为用户提供所需的数据完整性。

现在让我们看看如何在 VCS 设置中配置防护。
此设置假定我们已经安装了 VCS 并在没有防护的情况下运行。
可以通过使用安装程序脚本和使用命令行以 2 种方式配置防护。

在为防护配置磁盘之前,我们可以运行测试以确认它们是否是 SCSI3-PGR 兼容磁盘。
vxfentsthdw 脚本将指导我们测试要在防护 DG 中配置的所有磁盘。
也可以直接给fencing DG名字来测试整个DG。

# vxfentsthdw
# vxfentsthdw -c vxfencoorddg

配置 I/O 防护的步骤

使用installer 脚本

  1. 为 I/O 防护初始化磁盘
    配置 I/O 防护所需的最小磁盘数为 3.
    此外,防护磁盘数应始终为奇数。
    我们将使用 3 个大小约为 500 MB 的磁盘,因为我们有一个 2 节点集群。
    初始化要用于防护磁盘组的磁盘。
    我们还可以使用 fendg 的 vxfentsthdw 命令测试磁盘是否与 SCSI3 PGR 兼容。
# vxdisk -eo alldgs list
# vxdisksetup -i disk01
# vxdisksetup -i disk02
# vxdisksetup -i disk03
  1. 从安装媒体运行 installvcs 脚本,并使用 fencing 选项
# cd /cdrom/VRTS/install
# ./installvcs -fencing
Cluster information verification: Cluster Name: geekdiary
Cluster ID Number: 3
Systems: node01 node02
Would you like to configure I/O fencing on the cluster? [y,n,q] y
  1. 选择基于磁盘的防护
    我们将进行基于磁盘的防护,而不是基于服务器的防护,也称为 CP(协调器点)基于客户端的防护。
Fencing configuration
1) Configure CP client based fencing 2) Configure disk based fencing
3) Configure fencing in disabled mode
Select the fencing mechanism to be configured in this Application Cluster:[1-3,q] 2
  1. 新建磁盘组
    我们可以创建新磁盘组或者使用现有磁盘组进行防护。
    我们将使用一种新的击剑 DG,这是一种首选方式。
Since you have selected to configure Disk based fencing, you would be asked to give either the Disk group to be used as co-ordinator of asked to create disk group and the mechanism to be used.
Select one of the options below for fencing disk group: 1) Create a new disk group
2) Using an existing disk group
3) Back to previous menu
Press the choice for a disk group: [1-2,b,q] 1
  1. 选择要用于 fencing DG 的磁盘
    选择我们在步骤 1 中初始化的磁盘以创建我们的新磁盘组。
List of available disks to create a new disk group 1) [disk name 1]
     2) disk01
     3) disk02
     4) disk03
     ...
     b) Back to previous menu
Select an odd number of disks and at least three disks to form a disk group.
Enter the disk options, separated by spaces:
[1-4,b,q] 1 2 3
  1. 输入fencing磁盘组名fendg
enter the new disk group name: [b] fendg
  1. 选择fencing机制:raw/dmp(dynamic multipathing)
Enter fencing mechanism name (raw/dmp): [b,q,?] dmp
  1. 确认配置和警告
I/O fencing configuration verification Disk Group: fendg
Fencing mechanism: dmp
Is this information correct? [y,n,q] (y) y
Installer will stop VCS before applying fencing configuration. To make sure VCS shuts down successfully, unfreeze any frozen service groups in the cluster.
Are you ready to stop VCS on all nodes at this time? [y,n,q] (n) y

使用命令行

  1. 为 I/O 防护初始化磁盘
    第一步与上述方法相同。
    我们将初始化 3 个磁盘,每个磁盘 500 MB。
    在一个节点上:
# vxdisk -eo alldgs list
# vxdisksetup -i disk01
# vxdisksetup -i disk02
# vxdisksetup -i disk03
  1. 创建fencing磁盘组fendg
# vxdg -o coordinator=on init fendg disk01
# vxdg -g fendg adddisk disk02
# vxdg -g fendg adddisk disk03
  1. 创建vxfendg文件
# vxdg deport vxfendg
# vxdg -t import fendg
# vxdg deport fendg
# echo "fendg" > /etc/vxfendg  (on both nodes)
  1. 启用fencing
# haconf -dump -makero
# hastop -all
# /etc/init.d/vxfen stop
# vi /etc/VRTSvcs/conf/config/main.cf    ( add SCSI3 entry )
cluster geekdiary (
UserNames = { admin = "ass76asishmHajsh9S." }
Administrators = { admin }
HacliUserLevel = COMMANDROOT
CounterInterval = 5
UseFence = SCSI3
)
# hacf -verify /etc/VRTSvcs/conf/config
# cp /etc/vxfen.d/vxfenmode_scsi3_dmp /etc/vxfenmode    (if you are using dmp )
  1. 启动fencing
# /etc/init.d/vxfen start
# /opt/VRTS/bin/hastart
日期:2020-09-17 00:15:07 来源:oir作者:oir