Oracle® Solaris Cluster 数据服务规划和管理指南

退出打印视图

更新时间: 2014 年 9 月
 
 

如何创建可伸缩资源组

可伸缩资源组与可伸缩服务结合使用。共享地址功能是 Oracle Solaris Cluster 的联网机制,能够使可伸缩服务的多个实例显示为一个服务。必须先创建一个包含可伸缩资源所依赖的共享地址的故障转移资源组。接下来,创建可伸缩资源组,并向该组中添加可伸缩资源。每个可伸缩服务实例必须在不同的群集节点上运行。


注 -  可以从任何群集节点执行此过程。
  1. 在群集成员上,承担可提供 solaris.cluster.modify RBAC 授权的 root 角色。
  2. 创建故障转移资源组,用于存放可伸缩资源组将要使用的共享地址。
  3. 创建可伸缩资源组。
    # clresourcegroup create -S [-p Maximum_primaries=m] [-p Desired_primaries=n] \
    [-n nodelist] resource-group
    –S

    指定资源组将是多主节点资源组。如果省略 –p Maximum_primaries–p Desired_primaries 选项,两个属性都将设置为资源组节点列表中的节点数。

    –p Maximum_primaries=m

    指定此资源组的最大活动主节点数。

    –p Desired_primaries=n

    指定应尝试启动此资源组的活动主节点数。

    –n nodelist

    指定要提供此资源组的节点的逗号分隔排序列表。

    此列表是可选的。如果省略此列表,会在群集中的所有节点上创建资源组。

    resource-group

    指定为要添加的可伸缩资源组选择的名称。此名称必须以 ASCII 字符开头。

  4. 检验是否已创建可伸缩资源组。
    # clresourcegroup show resource-group
示例 2-5  创建可伸缩资源组

以下示例说明如何创建可伸缩资源组 resource-group-1。此资源组将由全局群集中的节点 phys-schost-1phys-schost-2 托管。此可伸缩资源组依赖于故障转移资源组 resource-group-2,该故障转移资源组包含共享地址资源。

# clresourcegroup create -S \
-p Maximum_primaries=2 \
-p Desired_primaries=2 \
-p RG_dependencies=resource-group-2 \
-n phys-schost-1, phys-schost-2 \
resource-group-1

# clresourcegroup show resource-group-1

=== Resource Groups and Resources ===

Resource Group:                                  resource-group-1
RG_description:                                  <NULL>
RG_mode:                                         Scalable
RG_state:                                        Unmanaged
RG_project_name:                                 default
RG_affinities:                                   <NULL>
Auto_start_on_new_cluster:                       True
Failback:                                        False
Nodelist:                                        phys-schost-1 phys-schost-2
Maximum_primaries:                               2
Desired_primaries:                               2
RG_dependencies:                                 resource-group2
Implicit_network_dependencies:                   True
Global_resources_used:                           <All>
Pingpong_interval:                               3600
Pathprefix:                                      <NULL>
RG_System:                                       False
Suspend_automatic_recovery:                      False

接下来的步骤

创建可伸缩资源组后,可以向此资源组中添加可伸缩应用程序资源。有关详细信息,请参见如何向资源组中添加可伸缩应用程序资源

另请参见

clresourcegroup(1CL) 手册页。