Sun Cluster 数据服务开发者指南(适用于 Solaris OS)

使用标准的 Sun Cluster 管理命令来创建使用 GDS 的服务

本节将介绍如何将这些参数实际输入到 GDS。 我们通过现有的 Sun Cluster 管理命令(如 scrgadm 和 scswitch)来使用和管理 GDS。

如果驱动脚本的功能够用,就不必输入本节所述的低级管理命令。 但是,如果您需要对基于 GDS 的资源进行更为严格的控制,则可以这样做。 这些命令实际上是驱动脚本所执行的命令。

如何使用 Sun Cluster 管理命令来创建使用 GDS 且具有高可用性的服务
  1. 登记资源类型 SUNW.gds


    # scrgadm -a -t SUNW.gds
    
  2. 创建资源组,其中包含 LogicalHostname 资源和故障切换服务本身。


    # scrgadm -a -g haapp_rg
    
  3. 为 LogicalHostname 资源创建资源。


    # scrgadm -a -L -g haapp_rs -l hhead
    
  4. 为故障切换服务本身创建资源。


    # scrgadm -a -j haapp_rs -g haapp_rg -t SUNW.gds \
             -y Scalable=false -y Start_timeout=120 \
             -y Stop_timeout=120 -x Probe_timeout=120 \
             -y Port_list="2222/tcp" \
             -x Start_command="/export/ha/appctl/start" \
             -x Stop_command="/export/ha/appctl/stop" \    
             -x Probe_command="/export/app/bin/probe" \
             -x Child_mon_level=0 -y Network_resources_used=hhead \
             -x Failover_enabled=true -x Stop_signal=9
    
  5. 将资源组 haapp_rg 联机。


    # scswitch -Z -g haapp_rg
    
标准的 Sun Cluster 管理命令(用于创建使用 GDS 的、可伸缩的服务)
  1. 登记资源类型 SUNW.gds。


    # scrgadm -a -t SUNW.gds
    
  2. 为 SharedAddress 资源创建资源组。


    # scrgadm -a -g sa_rg
    

  3. 在 sa_rg 上创建 SharedAddress 资源。


    # scrgadm -a -S -g sa_rg -l hhead
    
  4. 为可伸缩服务创建资源组。


    # scrgadm -a -g app_rg -y Maximum_primaries=2 \
          -y Desired_primaries=2 -y RG_dependencies=sa_rg
    
  5. 为可伸缩服务自身创建资源组。


    # scrgadm -a -j app_rs -g app_rg -t SUNW.gds \
           -y Scalable=true -y Start_timeout=120 \ 
           -y Stop_timeout=120 -x Probe_timeout=120 \
           -y Port_list="2222/tcp" \
           -x Start_command="/export/app/bin/start" \
           -x Stop_command="/export/app/bin/stop" \
           -x Probe_command="/export/app/bin/probe" \
           -x Child_mon_level=0 -y Network_resource_used=hhead \
           -x Failover_enabled=true -x Stop_signal=9 
    
  6. 将包含网络资源的资源组联机。


     # scswitch -Z -g sa_rg
    
  7. 将资源组 app_rg 联机。


    # scswitch -Z -g app_rg