执行此过程可在本地连接的存储上配置 OpenSolaris 通用多协议 SCSI 目标 (Common Multiprotocol SCSI TARget, COMSTAR),以在多个群集节点间共享访问权。此过程在 iSCSI 启动器和 iSCSI 目标之间使用单路径,同时还配置镜像 ZFS 存储池以提供高可用性。
如果在 iSCSI 启动器和 iSCSI 目标之间使用多路径,请转至如何使用 COMSTAR 和多路径配置 iSCSI 存储。
确保存储配置满足 Open HA Cluster 2009.06 要求。请参见iSCSI 存储。
在每个节点上,执行下表中列出的 "Configuring an iSCSI Storage Array With COMSTAR (Task Map)"(“使用 COMSTAR 配置 iSCSI 存储阵列(任务图)”)中的所需过程,同时遵循特殊说明。
任务 |
文档 |
特殊说明 |
||
---|---|---|---|---|
1. 执行基本设置。 |
Getting Started with COMSTAR(COMSTAR 入门) |
要创建 SCSI 逻辑单元,请执行 "How to Create a Disk Partition SCSI Logical Unit"(“如何创建磁盘分区 SCSI 逻辑单元”)过程。 如果对 sbdadm create-lu 命令指定整个磁盘而不是某个片,请随后运行 cldevice clear 命令以清除 DID 名称空间。 |
||
2. 配置 iSCSI 目标端口。 |
How to Configure iSCSI Target Ports(如何配置 iSCSI 目标端口) |
在每个节点上为每个专用网络适配器创建目标。 |
||
3. 配置 iSCSI 目标。 |
How to Configure an iSCSI Target for Discovery(如何配置 iSCSI 目标以进行搜索) |
使用静态搜索或 SendTargets。请勿使用动态搜索。 |
||
4. 使逻辑单元可用。 |
How to Make Logical Units Available for iSCSI and iSER(如何使逻辑单元可用于 iSCSI 和 iSER) | |||
5. 配置启动器系统以便访问目标存储。 |
How to Configure an iSCSI Initiator(如何配置 iSCSI 启动器) |
|
对每个新创建的设备禁用隔离功能。
phys-schost# /usr/cluster/bin/cldevice set -p default_fencing=nofencing-noscrub device |
或者,对群集中的所有设备全局禁用隔离功能。如果群集中没有要用作法定设备的共享设备,请执行此操作。
phys-schost# /usr/cluster/bin/cluster set -p global_fencing=nofencing-noscrub |
列出群集中设备的 DID 映射。
输出内容将类似如下,其中显示了从每个节点到每个设备的路径:
phys-schost# /usr/cluster/bin/cldevice list -v DID Device Full Device Path ---------- ---------------- … d3 phys-schost-1:/dev/rdsk/c14t1d0s4 d3 phys-schost-2:/dev/rdsk/c14t1d0s4 d4 phys-schost-1:/dev/rdsk/c15t8d0s4 d4 phys-schost-2:/dev/rdsk/c15t8d0s4 … |
从一个节点中,利用在每个节点上创建的 DID 设备创建镜像 ZFS 存储池。
对于设备路径名,请将 /dev/did/dsk/、DID 设备名称和片 s2 组合在一起。
phys-schost# zpool create pool mirror /dev/did/dsk/dNs2 /dev/did/dsk/dYs2 |
将镜像 ZFS 存储池配置为 HAStoragePlus 资源。
phys-schost# /usr/cluster/bin/clresourcegroup resourcegroup phys-schost# /usr/cluster/bin/clresourcetype register HAStoragePlus phys-schost# /usr/cluster/bin/clresource create -g resourcegroup -t HASToragePlus \ -p Zpools=pool resource phys-schost# /usr/cluster/bin/clresourcegroup manage resourcegroup phys-schost# /usr/cluster/bin/clresourcegroup online resourcegroup |
本示例说明了配置基于 COMSTAR 的 iSCSI 存储和镜像 ZFS 存储池 zpool-1 所涉及的步骤。节点 phys-schost-1 的本地连接磁盘是 /dev/rdsk/c1t0d0s4,节点 phys-schost-2 的本地连接磁盘是 /dev/rdsk/c1t8d0s4。clprivnet0 接口的 IP 地址是 172.16.4.1。
配置了 iSCSI 目标的静态搜索。对 phys-schost-1 执行的配置 iSCSI 启动器和目标的过程也将对 phys-schost-2 执行。devfsadm 命令将磁盘连接为 iSCSI 目标后,在启动器端 /dev/rdsk/c1t0d0s4 会变为 /dev/rdsk/c14t0d0s4,而 /dev/rdsk/c1t8d0s4 会变为 /dev/rdsk/c15t8d0s4。
群集不使用任何共享磁盘,因此对于群集中的所有磁盘,隔离功能处于全局关闭状态。使用 HAStoragePlus 资源 hasp-rs(镜像 ZFS 存储池 zpool-1)配置了资源组 rg-1。
Enable and verify the STMF service phys-schost-1# svcadm enable stmf phys-schost-1# svcs stmf online 15:59:53 svc:/system/stmf:default Repeat on phys-schost-2 Create and verify disk-partition SCSI logical units on each node phys-schost-1# sbdadm create-lu /dev/rdsk/c1t0d0s4 Created the following LU: GUID DATA SIZE SOURCE -------------------------------- ------------------- ------------------ 600144f05b4c460000004a1d9dd00001 73407800320 /dev/rdsk/c1t0d0s4 root@phys-schost-1:# ------------------------- phys-schost-2# sbdadm create-lu /dev/rdsk/c1t8d0s4 Created the following LU: GUID DATA SIZE SOURCE -------------------------------- ------------------- ------------------ 600144f07d15cd0000004a202e340001 73407800320 /dev/rdsk/c1t8d0s4 root@phys-schost-2:# ------------------------- Enable the iSCSI target SMF service phys-schost-1# svcadm enable -r svc:/network/iscsi/target:default phys-schost-1# svcs -a | grep iscsi online 14:21:25 svc:/network/iscsi/target:default Repeat on phys-schost-2 Configure each iSCSI target for static discovery phys-schost-1# itadm create-target Target: iqn.1986-03.com.sun:02:97c1caa8-5732-ec53-b7a2-a722a946fead successfully created phys-schost-1# itadm list-target TARGET NAME STATE SESSIONS iqn.1986-03.com.sun:02:97c1caa8-5732-ec53-b7a2-a722a946fead online 0 Repeat on phys-schost-2 for the other iSCSI target Make the logical units available phys-schost-1# sbdadm list-lu phys-schost-1# stmfadm add-view 600144f05b4c460000004a1d9dd00001 Repeat on phys-schost-2 for the other logical unit's GUID Configure iSCSI initiators to access target storage phys-schost-1# iscsiadm modify discovery --static enable phys-schost-1# iscsiadm list discovery Discovery: Static: enabled Send Targets: disabled iSNS: disabled phys-schost-1# ifconfig clprivnet0 clprivnet0: … inet 172.16.4.1 netmask fffffe00 broadcast 172.16.5.255 … phys-schost-1# iscsiadm add static-config \ iqn.1986-03.com.sun:02:97c1caa8-5732-ec53-b7a2-a722a946fead,172.16.4.1 phys-schost-1# iscsiadm list static-config Static Configuration Target: iqn.1986-03.com.sun:02:97c1caa8-5732-ec53-b7a2-a722a946fead,172.16.4.1:3260 phys-schost-1# devfsadm -i iscsi phys-schost-1# format -e phys-schost-1# iscsiadm list target Target: iqn.1986-03.com.sun:02:97c1caa8-5732-ec53-b7a2-a722a946fead Alias: - TPGT: 1 ISID: 4000002a0000 Connections: 1 Repeat on phys-schost-2 for this target Repeat on both nodes for the other target Update and populate the global-devices namespace on each node phys-schost-1# scdidadm -r phys-schost-1# cldevice populate Repeat on phys-schost-2 Disable fencing for all disks in the cluster phys-schost-1# /usr/cluster/bin/cluster set -p global_fencing=nofencing-noscrub Create a mirrored ZFS storage pool phys-schost-1/usr/cluster/bin/cldevice list -v DID Device Full Device Path ---------- ---------------- … d3 phys-schost-1:/dev/rdsk/c14t0d0s4 d3 phys-schost-2:/dev/rdsk/c14t0d0s4 d4 phys-schost-1:/dev/rdsk/c15t8d0s4 d4 phys-schost-2:/dev/rdsk/c15t8d0s4 … phys-schost-1# zpool create zpool-1 mirror /dev/did/dsk/d3s2 /dev/did/dsk/d4s2 Configure the mirrored ZFS storage pool as an HAStoragePlus resource phys-schost# /usr/cluster/bin/clresourcegroup rg-1 phys-schost# /usr/cluster/bin/clresourcetype register HAStoragePlus phys-schost# /usr/cluster/bin/clresource create -g rg-1 -t HAStoragePlus \ -p Zpools=zpool-1 hasp-rs phys-schost# /usr/cluster/bin/clresourcegroup manage rg-1 phys-schost# /usr/cluster/bin/clresourcegroup online rg-1 |
如果要使用 IP 安全体系结构 (IPsec) 在群集互连上提供安全的 TCP/IP 通信,请转至如何对群集专用互连配置 IP 安全体系结构 (IPsec)。
否则,配置要在群集上运行的数据服务。请转至配置数据服务。