Sun Cluster 软件安装指南(适用于 Solaris OS)

Procedure如何对非全局区域使用的群集文件系统配置 HAStoragePlus 资源

使用该过程让群集文件系统可供在群集节点上配置的 native 标记非全局区域使用。


注 –

只将该过程用于非全局区域的 native 标记。不能使用其他任何非全局区域的标记(例如 solaris8 标记或用于区域群集的 cluster 标记)执行该任务。


  1. 在全局群集的一个节点上,成为超级用户或使用一个可提供 solaris.cluster.modify RBAC 授权的角色。

  2. 使用 native 标记非全局区域的节点列表创建资源组。

    • 使用以下命令创建故障转移资源组:


      phys-schost# clresourcegroup create -n node:zone[,…] resource-group
      
      -n node:zone

      在资源组节点列表中指定非全局区域的名称。

      resource-group

      您创建的资源组的名称。

    • 使用以下命令创建可伸缩资源组:


      phys-schost# clresourcegroup create -S -n node:zone[,…] resource-group
      
      -S

      指定资源组是可伸缩的。

  3. 注册 HAStoragePlus 资源类型。


    phys-schost# clresourcetype register SUNW.HAStoragePlus
    
  4. 在驻留节点列表中的非全局区域的每个全局群集节点上,将群集文件系统条目添加至 /etc/vfstab 文件。

    群集文件系统的 /etc/vfstab 文件中的条目必须在挂载选项中包含 global 关键字。

    请参见《Sun Cluster Data Services Planning and Administration Guide for Solaris OS》中的“Sample Entries in /etc/vfstab for Cluster File Systems”

  5. 创建 HAStoragePlus 资源并定义文件系统挂载点。


    phys-schost# clresource create -g resource-group -t SUNW.HAStoragePlus \
    -p FileSystemMountPoints="mount-point-list" hasp-resource
    
    -g resource-group

    指定要添加新资源的资源组的名称。

    -p FileSystemMountPoints="mount-point-list"

    为资源指定一个或多个文件系统挂载点。

    hasp-resource

    您创建的 HAStoragePlus 资源的名称。

    已用已启用状态创建资源。

  6. resource-group 添加资源并为 hasp-resource 上的资源设置依赖性。

    如果要将多个资源添加至资源组,可对每个资源使用单独的命令。


    phys-schost# clresource create -g resource-group -t resource-type \
    -p Network_resources_used=hasp-resource resource
    
    -t resource-type

    指定为其创建的资源的资源类型。

    -p Network_resources_used=hasp-resource

    指定在 HAStoragePlus 资源 hasp-resource 上有依赖性的资源。

    resource

    您创建的资源的名称。

  7. 将包含 HAStoragePlus 资源的资源组置于联机状况并使其处于受管理状态。


    phys-schost# clresourcegroup online -M resource-group
    
    -M

    指定资源组是受管理的。


示例 7–1 对非全局区域使用的群集文件系统配置 HAStoragePlus 资源

以下示例创建故障转移资源组 cfs-rg 以管理 HA-Apache 数据服务。资源组节点列表包含两个非全局区域:phys-schost-1 上的 sczone1phys-schost-2 上的 sczone1。资源组包含 HAStoragePlus 资源 hasp-rs 以及数据服务资源 apache-rs。文件系统挂载点为 /global/local-fs/apache


phys-schost-1# clresourcegroup create -n phys-schost-1:sczone1,phys-schost-2:sczone1 cfs-rg
phys-schost-1# clresourcetype register SUNW.HAStoragePlus

Add the cluster file system entry to the /etc/vfstab file on phys-schost-1
phys-schost-1# vi /etc/vfstab
#device            device         mount          FS    fsck    mount    mount
#to mount          to fsck        point          type  pass    at boot  options
#
/dev/md/kappa-1/dsk/d0 /dev/md/kappa-1/rdsk/d0 /global/local-fs/apache ufs 5 yes logging,global
Add the cluster file system entry to the /etc/vfstab file on phys-schost-2
phys-schost-2# vi /etc/vfstab

…
phys-schost-1# clresource create -g cfs-rg -t SUNW.HAStoragePlus \
-p FileSystemMountPoints="/global/local-fs/apache" hasp-rs
phys-schost-1# clresource create -g cfs-rg -t SUNW.apache \
-p Network_resources_used=hasp-rs apache-rs
phys-schost-1# clresourcegroup online -M cfs-rg