Sun Cluster 系统管理指南(适用于 Solaris OS)

关闭和引导单个群集节点


注 –

请将 clnode(1CL) evacuate 命令与 Solaris 的 shutdown(1M) 命令结合使用,来关闭单个节点。仅当关闭整个群集时,才能使用 cluster shutdown 命令。有关关闭和引导非全局区域的信息,请参见《System Administration Guide: Solaris Containers-Resource Management and Solaris Zones》中的第 20  章 “Installing, Booting, Halting, Uninstalling, and Cloning Non-Global Zones (Tasks)”


表 3–2 任务表:关闭并引导群集节点

任务 

工具 

指导 

停止群集节点 

使用 clnode(1CL) evacuate 命令和 shutdown 命令

如何关闭群集节点

启动节点 

节点必须具有到群集互连的有效连接才能获得群集成员的身份。 

使用 bootb 命令

如何引导群集节点

停止和重新启动(重新引导)群集节点 

节点必须具有到群集互连的有效连接才能获得群集成员的身份。 

使用 clnode evacuateshutdown 命令

如何重新引导群集节点

引导一个节点,使节点不成为群集成员 

先使用 clnode evacuateshutdown 命令,然后使用 boot -xshutdown -g -y -i0 命令

如何在非群集模式下引导群集节点

Procedure如何关闭群集节点


注意 – 注意 –

不要在群集控制台上用 send brk 来关闭群集节点。群集内部不支持该命令。


有关关闭非全局区域的信息,请参见《System Administration Guide: Solaris Containers-Resource Management and Solaris Zones》中的第 20  章 “Installing, Booting, Halting, Uninstalling, and Cloning Non-Global Zones (Tasks)”

此过程提供了 Sun Cluster 命令的长格式。此外,大多数命令还有简短格式。这些命令除了名称长短的不同以外,其功能都是相同的。有关命令及其简短格式的列表,请参见附录 A,Sun Cluster 面向对象的命令

  1. SPARC:如果群集运行的是 Oracle Parallel Server 或 Oracle RAC,则应关闭数据库的所有实例。

    有关关闭过程,请参阅 Oracle Parallel Server 或 Oracle RAC 产品文档。

  2. 在要关闭的群集节点上,成为超级用户或使用一个可提供 solaris.cluster.admin RBAC 授权的角色。

  3. 将所有资源组、资源和设备组从要关闭的节点切换到其它群集成员。

    在要关闭的节点上,键入以下命令。clnode evacuate 命令可将指定节点上的所有资源组和设备组(包括所有非全局区域)切换到下一个首选节点。


    # clnode evacuate node
    
    node

    指定从中切换资源组和设备组的节点。

  4. 关闭群集节点。

    在要关闭的节点上,键入以下命令。


    # shutdown -g0 -y -i0
    

    检验群集节点是否显示 ok 提示符(在基于 SPARC 的系统中)或 Press any key to continue 消息(在基于 x86 的系统的 GRUB 菜单)。

  5. 如有必要,请关闭节点电源。


示例 3–5 SPARC: 关闭群集节点

以下示例显示了当系统关闭节点 phys-schost-1 时控制台的输出。-g0 选项表示将宽限期设置为零,-y 选项表示在接收到要求确认的问题时自动回答 yes。群集中其他节点的控制台上也显示此节点的关闭消息。


# clnode evacuate -S -h phys-schost-1
# shutdown -T0 -y
Wed Mar 10 13:47:32 phys-schost-1 cl_runtime:
WARNING: CMM monitoring disabled.
phys-schost-1# 
INIT: New run level: 0
The system is coming down.  Please wait.
Notice: rgmd is being stopped.
Notice: rpc.pmfd is being stopped.
Notice: rpc.fed is being stopped.
umount: /global/.devices/node@1 busy
umount: /global/phys-schost-1 busy
The system is down.
syncing file systems... done
Program terminated
ok 


示例 3–6 x86: 关闭群集节点

以下示例显示了当系统关闭节点 phys-schost-1 时控制台的输出。-g0 选项表示将宽限期设置为零,-y 选项表示在接收到要求确认的问题时自动回答 yes。群集中其他节点的控制台上也显示此节点的关闭消息。


# clnode evacuate phys-schost-1
# shutdown -T0 -y
Shutdown started.    Wed Mar 10 13:47:32 PST 2004

Changing to init state 0 - please wait
Broadcast Message from root (console) on phys-schost-1 Wed Mar 10 13:47:32... 
THE SYSTEM phys-schost-1 IS BEING SHUT DOWN NOW ! ! !
Log off now or risk your files being damaged

phys-schost-1#
INIT: New run level: 0
The system is coming down.  Please wait.
System services are now being stopped.
/etc/rc0.d/K05initrgm: Calling scswitch -S (evacuate)
failfasts disabled on node 1
Print services already stopped.
Mar 10 13:47:44 phys-schost-1 syslogd: going down on signal 15
umount: /global/.devices/node@2 busy
umount: /global/.devices/node@1 busy
The system is down.
syncing file systems... done
WARNING: CMM: Node being shut down.
Type any key to continue 

另请参见

要重新启动已关闭的群集节点,请参见如何引导群集节点

Procedure如何引导群集节点

如果打算关闭或重新引导群集中的其他活动节点,请至少等正在引导的节点处于以下状态之后:

否则,该节点将无法从群集中要关闭或重新引导的其他节点那里接管服务。有关引导非全局区域的信息,请参见《System Administration Guide: Solaris Containers-Resource Management and Solaris Zones》中的第 20  章 “Installing, Booting, Halting, Uninstalling, and Cloning Non-Global Zones (Tasks)”


注 –

群集节点的启动可能受定额配置的影响。在双节点群集中,必须配置一个定额设备,使群集中的定额总计数为三。每个节点应有一个定额计数,定额设备有一个定额计数。在这种情况下,当第一个节点关闭后,第二个节点仍然有定额设备,并以唯一群集成员的身份运行。要使第一个节点作为群集节点返回群集,第二个节点必须启动并且正在运行。必须存在所需的群集定额计数(两个)。


此过程提供了 Sun Cluster 命令的长格式。此外,大多数命令还有简短格式。这些命令除了名称长短的不同以外,其功能都是相同的。有关命令及其简短格式的列表,请参见附录 A,Sun Cluster 面向对象的命令

  1. 要启动已关闭的群集节点,请引导该节点。

    • 在基于 SPARC 的系统中,执行以下命令:


      ok boot
      
    • 在基于 x86 的系统中执行以下操作:

      显示 GRUB 菜单后,选择相应的 Solaris 条目,然后按 Enter 键。GRUB 菜单显示如下内容:


      GNU GRUB version 0.95 (631K lower / 2095488K upper memory)
      +-------------------------------------------------------------------------+
      | Solaris 10 /sol_10_x86                                                  |
      | Solaris failsafe                                                        |
      |                                                                         |
      +-------------------------------------------------------------------------+
      Use the ^ and v keys to select which entry is highlighted.
      Press enter to boot the selected OS, 'e' to edit the
      commands before booting, or 'c' for a command-line.

    当群集组件被激活时,所引导的节点的控制台上将显示消息。


    注 –

    群集节点必须具有到群集互连的有效连接才能获得群集成员的身份。


  2. 验证引导节点时未发生错误,而且节点现在处于联机状态。

    cluster status 命令可报告节点的状态。


    # cluster status -t node
    

    注 –

    如果群集节点的 /var 文件系统已满,可能无法在该节点上重新启动 Sun Cluster。如果出现该问题,请参见如何修复已满的 /var 文件系统



示例 3–7 SPARC: 引导群集节点

以下示例显示了将节点 phys-schost-1 引导到群集中后控制台的输出。


ok boot
Rebooting with command: boot 
...
Hostname: phys-schost-1
Booting as part of a cluster
...
NOTICE: Node phys-schost-1: attempting to join cluster
...
NOTICE: Node phys-schost-1: joined cluster
...
The system is coming up.  Please wait.
checking ufs filesystems
...
reservation program successfully exiting
Print services started.
volume management starting.
The system is ready.
phys-schost-1 console login:

Procedure如何重新引导群集节点

如果打算关闭或重新引导群集中的其他活动节点,请至少等正在引导的节点处于以下状态之后:

否则,该节点将无法从群集中要关闭或重新引导的其他节点那里接管服务。有关重新引导非全局区域的信息,请参见《System Administration Guide: Solaris Containers-Resource Management and Solaris Zones》中的第 20  章 “Installing, Booting, Halting, Uninstalling, and Cloning Non-Global Zones (Tasks)”

此过程提供了 Sun Cluster 命令的长格式。此外,大多数命令还有简短格式。这些命令除了名称长短的不同以外,其功能都是相同的。有关命令及其简短格式的列表,请参见附录 A,Sun Cluster 面向对象的命令

  1. SPARC:如果群集节点运行的是 Oracle Parallel Server 或 Oracle RAC,则应关闭数据库的所有实例。

    有关关闭过程,请参阅 Oracle Parallel Server 或 Oracle RAC 产品文档。

  2. 在要关闭的群集节点上,成为超级用户或使用一个可提供 solaris.cluster.admin RBAC 授权的角色。

  3. 使用 clnode evacuateshutdown 命令关闭群集节点。

    在要关闭的节点上输入以下命令。clnode evacuate 命令可将指定节点上的所有设备组都切换到下一个首选节点。此外,该命令还可将所有资源组从指定节点的全局或非全局区域切换到位于其他节点的下一个首选全局或非全局区域。

    • 在基于 SPARC 的系统中,执行以下命令:


      # clnode evacuate  node
      # shutdown -g0 -y -i6
      
    • 在基于 x86 的系统中执行以下操作:


      # clnode evacuate  node
      

      显示 GRUB 菜单后,选择相应的 Solaris 条目,然后按 Enter 键。GRUB 菜单显示如下内容:


      GNU GRUB version 0.95 (631K lower / 2095488K upper memory)
      +-------------------------------------------------------------------------+
      | Solaris 10 /sol_10_x86                                                  |
      | Solaris failsafe                                                        |
      |                                                                         |
      +-------------------------------------------------------------------------+
      Use the ^ and v keys to select which entry is highlighted.
      Press enter to boot the selected OS, 'e' to edit the
      commands before booting, or 'c' for a command-line.

    注 –

    群集节点必须具有到群集互连的有效连接才能获得群集成员的身份。


  4. 验证引导节点时未发生错误,而且节点现在处于联机状态。


    # cluster status -t node
    

示例 3–8 SPARC: 重新引导群集节点

以下示例显示了当系统重新引导节点 phys-schost-1 时控制台的输出。有关该节点的消息(例如关闭和启动通知)会出现在群集中其他节点的控制台上。


# clnode evacuate phys-schost-1
# shutdown -g0 -y -i6
Shutdown started.    Wed Mar 10 13:47:32 phys-schost-1 cl_runtime: 

WARNING: CMM monitoring disabled.
phys-schost-1# 
INIT: New run level: 6
The system is coming down.  Please wait.
System services are now being stopped.
Notice: rgmd is being stopped.
Notice: rpc.pmfd is being stopped.
Notice: rpc.fed is being stopped.
umount: /global/.devices/node@1 busy
umount: /global/phys-schost-1 busy
The system is down.
syncing file systems... done
rebooting...
Resetting ... 
,,,
Sun Ultra 1 SBus (UltraSPARC 143MHz), No Keyboard
OpenBoot 3.11, 128 MB memory installed, Serial #5932401.
Ethernet address 8:8:20:99:ab:77, Host ID: 8899ab77.
...
Rebooting with command: boot
...
Hostname: phys-schost-1
Booting as part of a cluster
...
NOTICE: Node phys-schost-1: attempting to join cluster
...
NOTICE: Node phys-schost-1: joined cluster
...
The system is coming up.  Please wait.
The system is ready.
phys-schost-1 console login: 


示例 3–9 x86: 重新引导群集节点

以下示例显示了重新引导节点 phys-schost-1 时控制台所输出的内容。有关该节点的消息(例如关闭和启动通知)会出现在群集中其他节点的控制台上。


# clnode evacuate phys-schost-1
ok boot
Rebooting with command: boot 
...
Hostname: phys-schost-1
Booting as part of a cluster
...
NOTICE: Node phys-schost-1: attempting to join cluster
...
NOTICE: Node phys-schost-1: joined cluster
...
The system is coming up.  Please wait.
checking ufs filesystems
...
reservation program successfully exiting
Print services started.
volume management starting.
The system is ready.
phys-schost-1 console login: 

Procedure如何在非群集模式下引导群集节点

您可以引导一个节点且不使其成为群集成员(即,处于非群集模式)。当安装群集软件或执行某些管理过程(如修补一个节点)时,非群集模式很有用。

此过程提供了 Sun Cluster 命令的长格式。此外,大多数命令还有简短格式。这些命令除了名称长短的不同以外,其功能都是相同的。有关命令及其简短格式的列表,请参见附录 A,Sun Cluster 面向对象的命令

  1. 在将要以非群集模式启动的群集节点上,成为超级用户或使用一个可提供 solaris.cluster.admin RBAC 授权的角色。

  2. 使用 clnode evacuateshutdown 命令关闭节点。

    clnode evacuate 命令可将所有设备组从指定节点切换到下一个首选节点。此外,该命令还可将所有资源组从指定节点的全局或非全局区域切换到位于其他节点的下一个首选全局或非全局区域。


    # clnode evacuate  node
    # shutdown -g0 -y
    
  3. 检验节点是否显示 ok 提示符(在基于 Solaris 的系统中)或 Press any key to continue 消息(在基于 x86 的系统的 GRUB 菜单)。

  4. 以非群集模式引导节点。

    • 在基于 SPARC 的系统中,执行以下命令:


      phys-schost# boot -xs
      
    • 在基于 x86 的系统中,执行以下命令:


      phys-schost# shutdown -g -y -i0
      
      Press any key to continue
    1. 在 GRUB 菜单中,使用方向键选择适当的 Solaris 条目,然后键入 e 以编辑其命令。

      GRUB 菜单显示如下内容:


      GNU GRUB version 0.95 (631K lower / 2095488K upper memory)
      +-------------------------------------------------------------------------+
      | Solaris 10 /sol_10_x86                                                  |
      | Solaris failsafe                                                        |
      |                                                                         |
      +-------------------------------------------------------------------------+
      Use the ^ and v keys to select which entry is highlighted.
      Press enter to boot the selected OS, 'e' to edit the
      commands before booting, or 'c' for a command-line.

      有关基于 GRUB 进行引导的更多信息,请参见《System Administration Guide: Basic Administration》中的第 11  章 “GRUB Based Booting (Tasks)”

    2. 在引导参数屏幕中,使用方向键选择内核条目,然后键入 e 以编辑该条目。

      GRUB 引导参数屏幕的显示与以下内容类似:


      GNU GRUB version 0.95 (615K lower / 2095552K upper memory)
      +----------------------------------------------------------------------+
      | root (hd0,0,a)                                                       |
      | kernel /platform/i86pc/multiboot                                     |
      | module /platform/i86pc/boot_archive                                  |
      +----------------------------------------------------------------------+
      Use the ^ and v keys to select which entry is highlighted.
      Press 'b' to boot, 'e' to edit the selected command in the
      boot sequence, 'c' for a command-line, 'o' to open a new line
      after ('O' for before) the selected line, 'd' to remove the
      selected line, or escape to go back to the main menu.
    3. 向命令中添加 -x 以指定将系统引导至非群集模式。


      [ Minimal BASH-like line editing is supported. For the first word, TAB
      lists possible command completions. Anywhere else TAB lists the possible
      completions of a device/filename. ESC at any time exits. ]
      
      grub edit> kernel /platform/i86pc/multiboot -x
    4. 按 Enter 键接受所做更改,并返回到引导参数屏幕。

      屏幕将显示编辑后的命令。


      GNU GRUB version 0.95 (615K lower / 2095552K upper memory)
      +----------------------------------------------------------------------+
      | root (hd0,0,a)                                                       |
      | kernel /platform/i86pc/multiboot -x                                  |
      | module /platform/i86pc/boot_archive                                  |
      +----------------------------------------------------------------------+
      Use the ^ and v keys to select which entry is highlighted.
      Press 'b' to boot, 'e' to edit the selected command in the
      boot sequence, 'c' for a command-line, 'o' to open a new line
      after ('O' for before) the selected line, 'd' to remove the
      selected line, or escape to go back to the main menu.-
    5. 键入 b 以将节点引导至非群集模式。


      注 –

      对内核引导参数命令所做的这一更改在系统引导后将失效。下次重新引导节点时,系统将引导至群集模式。如果希望引导至非群集模式,请重新执行上述步骤,并将 -x 选项添加到内核引导参数命令中。



示例 3–10 SPARC: 在非群集模式下引导群集节点

以下示例显示了当系统关闭节点 phys-schost-1 并以非群集模式重新启动时控制台的输出。-g0 选项表示将宽限期设置为零,-y 选项表示在接收到要求确认的问题时自动回答 yes,而 -i0 选项则表示调用运行级别 0 (零)。群集中其他节点的控制台上也显示此节点的关闭消息。


# clnode evacuate phys-schost-1
# cluster shutdown -T0 -y
Shutdown started.    Wed Mar 10 13:47:32 phys-schost-1 cl_runtime: 

WARNING: CMM monitoring disabled.
phys-schost-1# 
...
rg_name = schost-sa-1 ...
offline node = phys-schost-2 ...
num of node = 0 ...
phys-schost-1# 
INIT: New run level: 0
The system is coming down.  Please wait.
System services are now being stopped.
Print services stopped.
syslogd: going down on signal 15
...
The system is down.
syncing file systems... done
WARNING: node phys-schost-1 is being shut down.
Program terminated

ok boot -x
...
Not booting as part of cluster
...
The system is ready.
phys-schost-1 console login: