用于 Apache 的 Sun Cluster 数据服务指南(适用于 Solaris OS)

示例 – 注册可伸缩 Sun Cluster HA for Apache

对于可伸缩服务,您可以创建以下资源组。

下例说明了如何在双节点群集上注册可伸缩 Apache 服务。


群集信息
节点名称:phys-schost-1、phys-schost-2
共享地址:schost-1
资源组:resource-group-1(用于共享地址)、	resource-group-2(用于可伸缩 Apache 应用程序
    资源)
资源:schost-1(共享地址)、apache-1(Apache 应用程序
    资源)
 
(添加故障转移资源组以包含共享地址。)
# scrgadm -a -g resource-group-1
 
(将共享地址资源添加到故障转移资源组。)
# scrgadm -a -S -g resource-group-1 -l schost-1 
 
(注册 Apache 资源类型。)
# scrgadm -a -t SUNW.apache
 
(添加可伸缩资源组。)
# scrgadm -a -g resource-group-2 -y Maximum_primaries=2 \
-y Desired_primaries=2 -y RG_dependencies=resource-group-1
 
(将 Apache 应用程序资源添加到可伸缩资源组。)
# scrgadm -a -j apache-1 -g resource-group-2 \
-t SUNW.apache -y Network_resources_used=schost-1 \
-y Scalable=True -y Port_list=80/tcp \
-x Bin_dir=/opt/apache/bin
 
(使故障转移资源组联机。)
# scswitch -Z -g resource-group-1
 
(使可伸缩资源组在两个节点上联机。)
# scswitch -Z -g resource-group-2