Open HA Cluster 安装指南

Procedure如何在所有节点上配置 Open HA Cluster 软件 (scinstall)

从群集的一个节点中执行此过程,以便在群集的两个节点上配置 Open HA Cluster 软件。


注 –

此过程使用的是 scinstall 命令的交互形式。要使用 scinstall 命令的非交互形式(如在开发安装脚本时),请参见 scinstall(1M) 手册页。


开始之前

执行以下任务:


注 –

对于全局设备文件系统,请仅使用 lofi 设备。请勿尝试配置专用 /globaldevices 分区。对于询问是否要使用或创建文件系统的所有提示均回答“否”。拒绝配置文件系统后,scinstall 实用程序会提示您创建 lofi 设备。


按照以下指导在此过程中使用交互式的 scinstall 实用程序:

  1. 在要在群集中配置的每个节点上,成为超级用户。

    或者,如果为您的用户帐户指定了主管理员 (Primary Administrator) 配置文件,则可通过配置文件 shell 以非超级用户身份执行命令,或者在命令的前面加上 pfexec 命令。

  2. 在每个节点上,禁用网络自动配置 (Network Auto-Magic, NWAM)。

    NWAM 会激活单个网络接口并禁用所有其他网络接口。因此,NWAM 不能与 Open HA Cluster 2009.06 软件共存,您必须在配置或运行群集之前禁用 NWAM。

    1. 在每个群集节点上,确定 NWAM 处于启用状态还是禁用状态。


      phys-schost# svcs -a | grep /network/physical
      
      • 如果 NWAM 处于启用状态,则输出内容将类似如下:


         online           Mar_13   svc:/network/physical:nwam
         disabled         Mar_13   svc:/network/physical:default
      • 如果 NWAM 处于禁用状态,则输出内容将类似如下:


         disabled          Mar_13  svc:/network/physical:nwam
         online            Mar_13  svc:/network/physical:default
    2. 如果 NWAM 在某一节点上处于启用状态,请将其禁用。


      phys-schost# svcadm disable svc:/network/physical:nwam
      phys-schost# svcadm enable svc:/network/physical:default
      
  3. 在每个节点上,配置每个公共网络适配器。

    1. 确定系统上有哪些适配器。


      phys-schost# dladm show-link
      
    2. 激活 (plumb) 某个适配器。


      phys-schost# ifconfig adapter plumb up
      
    3. 为该适配器指定 IP 地址和网络掩码。


      phys-schost# ifconfig adapter IPaddress netmask + netmask
      
    4. 检验适配器是否已启动。

      确保注释输出中包含 UP 标志。


      phys-schost# ifconfig -a
      
    5. 为适配器创建一个配置文件。

      此文件可确保适配器的配置在重新引导后不会失效。


      phys-schost# vi /etc/hostname.adapter
      IPaddress
      
    6. 对两个节点上的每个公共网络适配器重复步骤 b步骤 e

    7. 在两个节点上,对于在每个节点上配置的每个公共网络适配器,将一个条目添加到 /etc/inet/hosts 文件。


      phys-schost# vi /etc/inet/hosts
      hostname IPaddress
      
    8. 如果使用命名服务,请添加所配置的每个公共网络适配器的主机名和 IP 地址。

    9. 重新引导每个节点。


      phys-schost# /usr/sbin/shutdown -y -g0 -i6
      
    10. 检验所有适配器是否均进行了配置且已启动。


      phys-schost# ifconfig -a
      
  4. 在每个节点上,启用交互式 scinstall 实用程序启用时所需的最少量的 RPC 服务。

    安装 OpenSolaris 软件时,将会自动配置一个限制性的网络配置文件。此配置文件的限制性很强,使得群集专用网络无法正常运行。要启用专用网络功能,请运行以下命令:


    phys-schost# svccfg
    svc:> select network/rpc/bind
    svc:/network/rpc/bind> setprop config/local_only=false
    svc:/network/rpc/bind> quit
     
    phys-schost# svcadm refresh network/rpc/bind:default
    phys-schost# svcprop network/rpc/bind:default | grep local_only
    

    最后一条命令的输出应显示 local_only 属性现在设置为 false

    有关重新启用网络服务的更多信息,请参见《Solaris 10 5/08 安装指南:规划安装和升级》中的“规划网络安全性”

  5. 从一个群集节点启动 scinstall 实用程序。


    phys-schost# /usr/cluster/bin/scinstall
    
  6. 键入 "Create a New Cluster or Add a Cluster Node" 所对应的选项号并按回车键。


     *** Main Menu ***
    
        Please select from one of the following (*) options:
    
          * 1) Create a new cluster or add a cluster node
          * 2) Print release information for this cluster node
     
          * ?) Help with menu options
          * q) Quit
    
        Option:  1
    

    将显示 "New Cluster and Cluster Node" 菜单。

  7. 键入 "Create a New Cluster" 所对应的选项号并按回车键。

    将显示 "Typical or Custom Mode" 菜单。

  8. 键入与 "Typical" 或 “Custom” 相对应的选项号并按回车键。

    将显示 "Create a New Cluster" 屏幕。阅读相关要求,然后按 Ctrl-D 组合键继续。

  9. 按照菜单提示给出您的答案 ,所做回答应依据于您在配置规划工作单中填写的内容。

    scinstall 实用程序用于安装和配置所有群集节点并重新引导群集。将所有节点成功引导到群集中之后,即建立了群集。Open HA Cluster 安装输出记录在 /var/cluster/logs/install/scinstall.log. N 文件中。

  10. 在每个节点上检验服务管理工具 (Service Management Facility, SMF) 的多用户服务是否处于联机状态。

    如果某个节点上的服务尚未处于联机状态,请等到状态变为联机后再继续执行下一步。


    phys-schost# svcs multi-user-server
    STATE          STIME    FMRI
    online         17:52:55 svc:/milestone/multi-user-server:default
  11. 从一个节点中,检验所有节点是否已加入群集。


    phys-schost# /usr/cluster/bin/clnode status
    

    输出类似于以下内容。


    === Cluster Nodes ===
    
    --- Node Status ---
    
    Node Name                                       Status
    ---------                                       ------
    phys-schost-1                                   Online
    phys-schost-2                                   Online

    有关更多信息,请参见 clnode(1CL) 手册页。

  12. (可选的)启用自动节点重新引导功能。

    当所有受监视的磁盘路径都发生故障时,如果至少有一个磁盘可从群集中的另一节点访问,则此功能会自动重新引导节点。

    1. 启用自动重新引导。


      phys-schost# /usr/cluster/bin/clnode set -p reboot_on_path_failure=enabled
      
      -p

      指定要设置的属性

      reboot_on_path_failure=enable

      如果所有监视的磁盘路径发生故障,则启用自动节点重新引导。

    2. 检验是否启用了磁盘路径发生故障时的自动重新引导功能。


      phys-schost# /usr/cluster/bin/clnode show
      === Cluster Nodes ===                          
      
      Node Name:                                      node
      …
        reboot_on_path_failure:                          enabled
      …
  13. 如果要在具有高可用性的本地文件系统上使用 HA for NFS 数据服务,请确保禁用回送文件系统 (loopback file system, LOFS)。

    要禁用 LOFS,请将以下条目添加到群集的每个节点上的 /etc/system 文件中。


    exclude:lofs

    /etc/system 文件所做的更改将在下次重新引导系统后生效。


    注 –

    如果在具有高可用性的本地文件系统中使用 HA for NFS 数据服务并且 automountd 正在运行,则不能启用 LOFS。LOFS 可能会导致 HA for NFS 数据服务出现切换问题。如果选择在具有高可用性的本地文件系统上添加 HA for NFS 数据服务,则必须进行以下配置更改之一。

    • 禁用 LOFS。

    • 禁用 automountd 守护进程。

    • 从自动安装程序映射中排除属于由 HA for NFS 数据服务导出的具有高可用性的本地文件系统的所有文件。这样做可以使 LOFS 和 automountd 守护进程都保持启用状态。


    有关回送文件系统的更多信息,请参见《系统管理指南:设备和文件系统》中的“回送文件系统”


示例 3–1 在所有节点上配置 Open HA Cluster 软件

以下示例显示了当 scinstall 在双节点群集 schost 上完成配置任务时记录的 scinstall 进度消息。该群集是在“典型”模式下使用 scinstall 实用程序从 phys-schost-1 安装的。另一个群集节点为 phys-schost-2。适配器名称为 e1000g0。不存在 /globaldevices 分区,因此会在 lofi 设备上创建全局设备名称空间。不使用自动法定设备选择。


*** Create a New Cluster ***
Tue Apr 14 10:36:19 PDT 2009

    Attempting to contact "phys-schost-1" ... 

    Searching for a remote configuration method ... 

scrcmd -N phys-schost-1 test isfullyinstalled
The Sun Cluster framework software is installed.
scrcmd to "phys-schost-1" - return status 1.

rsh phys-schost-1 -n "/bin/sh -c '/bin/true; /bin/echo SC_COMMAND_STATUS=\$?'"
phys-schost-1: Connection refused
rsh to "phys-schost-1" failed.

ssh root@phys-schost-1 -o "BatchMode yes" -o "StrictHostKeyChecking yes" 
-n "/bin/sh -c '/bin/true; /bin/echo SC_COMMAND_STATUS=\$?'"
No RSA host key is known for phys-schost-1 and you have requested strict checking.
Host key verification failed.
ssh to "phys-schost-1" failed.

    The Sun Cluster framework is able to complete the configuration 
    process without remote shell access.


    Checking the status of service network/physical:nwam ... 


/usr/cluster/lib/scadmin/lib/cmd_test isnwamenabled

scrcmd -N phys-schost-1 test isnwamenabled
    Plumbing network address 172.16.0.0 on adapter e1000g0 >> NOT DUPLICATE ... done
    Plumbing network address 172.16.0.0 on adapter e1000g0 >> NOT DUPLICATE ... done
    Testing for "/globaldevices" on "phys-schost-2" ... 

/globaldevices is not a directory or file system mount point.
Cannot use "/globaldevices" on "phys-schost-2".


    Testing for "/globaldevices" on "phys-schost-1" ... 

scrcmd -N phys-schost-1 chk_globaldev fs /globaldevices
/globaldevices is not a directory or file system mount point.


/globaldevices is not a directory or file system mount point.
Cannot use "/globaldevices" on "phys-schost-1".


scrcmd -N phys-schost-1 chk_globaldev lofi /.globaldevices 100m

----------------------------------
- Cluster Creation -
----------------------------------

    Started cluster check on "phys-schost-2".
    Started cluster check on "phys-schost-1".

    cluster check completed with no errors or warnings for "phys-schost-2".
    cluster check completed with no errors or warnings for "phys-schost-1".

Cluster check report is displayed
…

scrcmd -N phys-schost-1 test isinstalling
"" is not running.

scrcmd -N phys-schost-1 test isconfigured
Sun Cluster is not configured.

    Configuring "phys-schost-1" ... 

scrcmd -N phys-schost-1 install -logfile /var/cluster/logs/install/scinstall.log.2895 
-k -C schost -F -G lofi -T node=phys-schost-2,node=phys-schost-1,authtype=sys 
-w netaddr=172.16.0.0,netmask=255.255.240.0,maxnodes=64,maxprivatenets=10,
numvirtualclusters=12 -A trtype=dlpi,name=e1000g0 -B type=direct
ips_package_processing: ips_postinstall...
ips_package_processing: ips_postinstall done

Initializing cluster name to "schost" ... done
Initializing authentication options ... done
Initializing configuration for adapter "e1000g0" ... done
Initializing private network address options ... done

Plumbing network address 172.16.0.0 on adapter e1000g0 >> NOT DUPLICATE ... done

Setting the node ID for "phys-schost-1" ... done (id=1)

Verifying that NTP is configured ... done
Initializing NTP configuration ... done

Updating nsswitch.conf ... done

Adding cluster node entries to /etc/inet/hosts ... done


Configuring IP multipathing groups ...done


Verifying that power management is NOT configured ... done
Unconfiguring power management ... done
/etc/power.conf has been renamed to /etc/power.conf.041409104821
Power management is incompatible with the HA goals of the cluster.
Please do not attempt to re-configure power management.

Ensure network routing is disabled ... done
Network routing has been disabled on this node by creating /etc/notrouter.
Having a cluster node act as a router is not supported by Sun Cluster.
Please do not re-enable network routing.

Please reboot this machine.

Log file - /var/cluster/logs/install/scinstall.log.2895

scrcmd -N phys-schost-1 test hasbooted
This node has not yet been booted as a cluster node.
    Rebooting "phys-schost-1" ... 

故障排除

配置不成功-如果有一个或多个节点无法加入群集,或者指定了错误的配置信息,请首先尝试重新执行此过程。如果不能解决问题,请在每个配置有误的节点上执行如何卸载 Open HA Cluster 软件过程,以将该节点从群集配置中删除。然后重新执行此过程。

接下来的操作

如果尚未在群集中配置法定设备,请转至如何配置法定设备

否则,请转至如何检验法定配置和安装模式