Sun Cluster 系統管理指南(適用於 Solaris 作業系統)

第 10 章 修補 Sun Cluster 軟體與韌體

本章提供關於為 Sun Cluster 配置增加或移除修補程式的程序,以下各節有詳細說明。

修補 Sun Cluster 簡介

由於叢集本身的性質,所有的叢集成員節點必須在同一個修補層級,叢集才能夠正常運作。有時,在使用 Sun Cluster 修補程式修補節點時,您可能需要先從叢集成員身份暫時移除節點,或是先停止整個叢集,再安裝修補程式。本節說明這些步驟。

套用 Sun Cluster 修補程式之前,請檢查修補程式的 README 檔案。此外,請檢查您儲存裝置的升級需求以判定它們需要哪個修補程式方法。


備註 –

對於 Sun Cluster 修補程式,請務必遵循修補程式的 README 檔案與優先於本章中的程序之 SunSolve 說明。


所有叢集節點的修補程式安裝可分成以下情況:

重新啟動修補程式 (節點)

在套用修補程式或韌體之前,必須使用指令 boot -sxshutdown -g -y -i0 將節點啟動為單一使用者模式,然後再重新啟動以加入叢集。首先,您需要將所有資源群組或裝置群組從要修補的節點切換至另一個叢集成員,以使節點進入「靜止」狀態。另外,您要一次在一個叢集節點上套用修補程式或韌體,以避免關閉整個叢集。

在套用這種類型的修補程式時,叢集將保持為可用狀態,即使個別的節點可能暫時關閉。修補後的節點可重新加入叢集當作成員,即使其他節點尚未同在一個修補層次也沒有關係。

重新啟動修補程式 (叢集)

必須關閉叢集,而且必須使用指令 boot -sxshutdown -g -y -i0 將每個節點啟動為單一使用者模式,以套用軟體或韌體修補程式。然後,重新啟動節點以加入叢集。對於此類型的修補程式,叢集在套用修補程式期間是無法使用的。

不需重新啟動的修補程式

節點不必進入「靜止」狀態 (它仍將控制資源群組或裝置群組),在套用修補程式時也不必關閉或重新啟動。不過,您仍要以一次一個節點的方式套用修補程式,並在修補其他節點之前,先驗證修補程式是否可以正常運作。


備註 –

基礎叢集通訊協定不會因為修補程式而改變。


使用 patchadd 指令來將修補程式套用至叢集,並使用 patchrm 來移除修補程式 (必要時)。

Sun Cluster 修補程式秘訣

使用以下秘訣有助於您更有效地管理 Sun Cluster 修補程式:

修補 Sun Cluster 軟體

表 10–1 作業說明:修補叢集

作業 

指示 

將不需重新啟動的 Sun Cluster 修補程式一次套用到一個節點,而不必停止節點 

如何套用不需重新啟動的 Sun Cluster 修補程式

將叢集成員切換至非叢集模式之後,套用要重新啟動的 Sun Cluster 修補程式 

如何套用要重新啟動的修補程式 (節點)

如何套用需要重新啟動的修補程式 (叢集)

當您的叢集包含容錯移轉區域時,在單一使用者模式中套用修補程式 

如何以單一使用者模式對容錯移轉區域套用修補程式

移除 Sun Cluster 修補程式 

變更 Sun Cluster 修補程式

Procedure如何套用要重新啟動的修補程式 (節點)

在叢集中,以一次一個節點的方式套用修補程式,以便在修補期間保持叢集本身處於正常運作狀態。使用此程序時,您必須先關閉節點,然後使用 boot -sxshutdown -g -y -i0 指令,將其啟動至單一使用者模式,然後再套用修補程式。

此程序提供長形式的 Sun Cluster 指令。大多數指令還有簡短的形式。除了指令名稱有長形式和短形式之分外,指令本身是相同的。如需指令及其短形式的清單,請參閱附錄 ASun Cluster 以物件為導向的指令

  1. 在套用修補程式之前,先檢查 Sun Cluster 產品網站有無特殊的安裝前、安裝後相關指示。

  2. 成為超級使用者,或在您要套用修補程式的節點上成為提供 solaris.cluster.admin RBAC 授權的角色。

  3. 列示要修補之節點上的資源群組與裝置群組。


    # clresourcegroup status -n node
    # cldevicegroup status -n node
    
  4. 將所有的資源群組、資源及裝置群組從要修補的節點切換到其他叢集成員。


    # clnode evacuate -n node
    
    evacuate

    撤除所有裝置群組和資源群組,包括來自特定節點的所有非全域區域。

    -n node

    指定您要用從中切換資源群組及裝置群組的節點。

  5. 關閉節點。


    # shutdown -g0 [-y]
     [-i0]
  6. 以非叢集單一使用者模式啟動節點。

    • 在 SPARC 架構的系統上,執行下列指令:


      ok boot -sx
      
    • 在 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. -sx 增加至指令以指定系統啟動至非叢集模式。


      [ 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 將節點啟動至非叢集模式。


      備註 –

      對核心啟動參數指令所做的這個變更不會在系統啟動後持續。下次您重新啟動節點時,將會啟動至叢集模式。若要啟動至非叢集模式,請再一次執行這些步驟來增加 -sx 選項到核心啟動參數指令。


  7. 套用軟體或韌體修補程式。


    # patchadd -M patch-dir patch-id
    
    patch-dir

    指定修補程式的目錄位置。

    patch-id

    指定修補程式的修補程式編號。


    備註 –

    務必遵循取代本章敘述之程序的修補程式目錄中的指示。


  8. 確認已成功安裝修補程式。


    # showrev -p | grep patch-id
    
  9. 重新啟動節點,進入叢集。


    # reboot
    
  10. 確認修補程式可以作業,並且節點與叢集正常作業。

  11. 對於其餘的所有叢集節點,重複執行步驟 2步驟 10

  12. 視需要切換資源群組與裝置群組。

    重新啟動所有的節點後,最後一個重新啟動的節點不會使資源群組及裝置群組連線。


    # cldevicegroup switch -n node   + | devicegroup ...
    # clresourcegroup switch -n node[:zone][,...] + | resource-group ...
    
    node

    您要用來切換資源群組及裝置群組的節點名稱。

    zone

    可控制資源群組的 節點 上的非全域區域名稱。僅在當您建立資源群組時已指定非全域區域的情況下指定區域。

  13. 使用 scversions 指令檢查是否需要確定修補程式軟體。


    # /usr/cluster/bin/scversions
    

    您將看到以下結果之一:


    Upgrade commit is needed.
    
    Upgrade commit is NOT needed. All versions match.
  14. 如果需要確定,請確定該修補程式軟體。


    # scversions -c
    

    備註 –

    視情況而定,執行 scversions 將會導致一次或多次重新配置 CMM。



範例 10–1 安裝需要重新啟動的修補程式 (節點)

以下範例顯示將將要重新啟動的 Sun Cluster 修補應用程式套用到節點。


# clresourcegroup status -n rg1
...Resource Group     Resource
--------------     --------
rg1                rs-2
rg1                rs-3
...
# cldevicegroup status -n nodedg-schost-1
...
Device Group Name:											dg-schost-1
...
# clnode evacuate  phys-schost-2
# shutdown -g0 -y -i0
...

以非叢集單一使用者模式啟動節點。


# patchadd -M /var/tmp/patches 234567-05
...
# showrev -p | grep 234567-05

...
# reboot
...
# cldevicegroup switch -n  phys-schost-1 dg-schost-1
# clresourcegroup switch -n  phys-schost-1 schost-sa-1
# scversions
Upgrade commit is needed.
# scversions -c

另請參閱

如果需要解除安裝修補程式,請參閱變更 Sun Cluster 修補程式

Procedure如何套用需要重新啟動的修補程式 (叢集)

使用此程序時,您必須先關閉叢集,然後使用 boot -sxshtudown -g -y -i0 指令將每個節點啟動至單一使用者模式,然後再套用修補程式。

  1. 在套用修補程式之前,先檢查 Sun Cluster 產品網站有無特殊的安裝前、安裝後相關指示。

  2. 成為叢集中任何節點的超級使用者。

  3. 關閉叢集。


    # cluster shutdown -y -g grace-period message
    
    -y

    對確認提示指定回答 yes (是)。

    -g grace-period

    指定關機前的等待秒數,預設的寬限期為 60 秒。

    message

    指定要廣播的警告訊息。如果訊息含有多個文字,請使用引號括住。

  4. 以非叢集單一使用者模式啟動每一個節點。

    在每一個節點的主控台上,執行下列指令。

    • 在 SPARC 架構的系統上,執行下列指令:


      ok boot -sx
      
    • 在 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. -sx 增加至指令以指定系統啟動至非叢集模式。


      [ 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 將節點啟動至非叢集模式。


      備註 –

      對核心啟動參數指令所做的這個變更不會在系統啟動後持續。下次您重新啟動節點時,將會啟動至叢集模式。若要啟動至非叢集模式,請再一次執行這些步驟來增加 -sx 選項到核心啟動參數指令。


  5. 套用軟體或韌體修補程式。

    一次對一個節點執行下列指令。


    # patchadd -M patch-dir patch-id
    
    patch-dir

    指定修補程式的目錄位置。

    patch-id

    指定修補程式的修補程式編號。


    備註 –

    務必遵循取代本章敘述之程序的修補程式目錄中的指示。


  6. 確認修補程式已成功安裝在每個節點上。


    # showrev -p | grep patch-id
    
  7. 在所有的節點套用修補程式後,將節點重新啟動至叢集。

    在每一個節點上執行下列指令。


    # reboot
    
  8. 使用 scversions 指令檢查是否需要確定修補程式軟體。


    # /usr/cluster/bin/scversions
    

    您將看到以下結果之一:


    Upgrade commit is needed.
    
    Upgrade commit is NOT needed. All versions match.
  9. 如果需要確定,請確定該修補程式軟體。


    # scversions -c
    

    備註 –

    視情況而定,執行 scversions 將會導致一次或多次重新配置 CMM。


  10. 確認修補程式可運作,以及節點與叢集正常運作。


範例 10–2 安裝需要重新啟動的修補程式 (叢集)

以下範例顯示將要重新開機的 Sun Cluster 修補應用程式套用到叢集。


# cluster shutdown -g0 -y
...

以非叢集單一使用者模式啟動叢集。


...
# patchadd -M /var/tmp/patches 234567-05
(Apply patch to other cluster nodes)
...
# showrev -p | grep 234567-05
# reboot
# scversions
Upgrade commit is needed.
# scversions -c

另請參閱

如果需要解除安裝修補程式,請參閱變更 Sun Cluster 修補程式

Procedure如何套用不需重新啟動的 Sun Cluster 修補程式

將修補程式一次套用至叢集中的一個節點。套用不需重新啟動的修補程式時,不必先關閉要修補的節點。

  1. 在套用修補程式之前,請檢查 Sun Cluster 產品網頁有無特殊安裝前指示或安裝後指示。

  2. 對單一節點套用修補程式。


    # patchadd -M patch-dir patch-id
    
    patch-dir

    指定修補程式的目錄位置。

    patch-id

    指定修補程式的修補程式編號。

  3. 確認已成功安裝修補程式。


    # showrev -p | grep patch-id
    
  4. 確認修補程式可以作業,並且節點與叢集正常作業。

  5. 對於其餘的叢集節點上,請重複執行步驟 2步驟 4

  6. 使用 scversions 指令檢查是否需要確定修補程式軟體。


    # /usr/cluster/bin/scversions
    

    您將看到以下結果之一:


    Upgrade commit is needed.
    
    Upgrade commit is NOT needed. All versions match.
  7. 如果需要確定,請確定該修補程式軟體。


    # scversions -c
    

    備註 –

    視情況而定,執行 scversions 將會導致一次或多次重新配置 CMM。



範例 10–3 安裝不需重新啟動的 Sun Cluster 修補程式


# patchadd -M /tmp/patches 234567-05
...
# showrev -p | grep 234567-05
# scversions
Upgrade commit is needed.
# scversions -c

另請參閱

如果需要解除安裝修補程式,請參閱變更 Sun Cluster 修補程式

Procedure如何以單一使用者模式對容錯移轉區域套用修補程式

執行此作業以單一使用者模式對容錯移轉區域套用修補程式。如果您將容錯移轉配置中的 Sun Cluster Data Service for Solaris Container 與 Sun Cluster 軟體搭配使用,需要此修補方法。

  1. 驗證沒有為任何一個被當作磁碟組 (包括此程序中手動操作的區域路徑) 共用儲存的 LUN 設定法定裝置。

    1. 判定法定裝置是否用於包含區域路徑的磁碟組中,並判定法定裝置是否使用 scsi2 或 scsi3 保留。


      # clquorum show
      
    2. 如果法定裝置位於磁碟組的 LUN 中,請將新的 LUN 增加為包含區域路徑且不屬於任何磁碟組的法定裝置。


      # clquorum add new-didname
      
    3. 移除舊的法定裝置。


      # clquorum remove old-didname
      
    4. 如果使用 scsi2 保留作為舊的法定裝置,請從舊的法定裝置中清理 scsi2 保留並驗證沒有剩下任何 scsi2 保留。


      # /usr/cluster/lib/sc/pgre -c pgre_scrub -d /dev/did/rdsk/old-didnames2
      # /usr/cluster/lib/sc/pgre -c pgre_inkeys -d /dev/did/rdsk/old-didnames2
      

      備註 –

      如果您意外清理掉使用中裝置的保留金鑰,您必須移除並重新增加法定裝置以新增新的保留金鑰至法定裝置上。


  2. 撤除您想修補的節點。


    # clresourcegroup evacuate -n node1
    
  3. 使資源或包含 HA Solaris Container 資源的資源群組離線。


    # clresourcegroup offline resourcegroupname
    
  4. 停用資源群組中所有離線的資源。


    # clresource disable resourcename
    
  5. 取消管理您使之離線的資源群組。


    # clresourcegroup unmanage resourcegroupname
    
  6. 使對應的一個或多個裝置群組離線。


    # cldevicegroup offline cldevicegroupname
    
  7. 停用您使之離線的裝置群組


    # cldevicegroup disable devicegroupname
    
  8. 從叢集啟動被動節點。


    # reboot -- -x
    
  9. 在繼續之前,驗證是否已在被動節點上完成 SMF 啟動方法。


    # svcs -x
    
  10. 驗證使用中節點上的重新配置程序是否皆已完成。


    # cluster status
    
  11. 判定磁碟組中的磁碟上是否有任何 scsi3 保留。

    1. 在磁碟組中的所有磁碟上執行下列指令。


      # /usr/cluster/lib/sc/scsi -c inkeys -d /dev/did/rdsk/didnames2
      
    2. 如果列出金鑰,請將它們清除。


      # /usr/cluster/lib/sc/scsi -c scrub -d /dev/did/rdsk/didnames2
      
  12. 在被動節點上取得 metaset 的所有權


    # metaset -s disksetname -C take -f
    
  13. 在被動節點上掛載檔案系統或掛載包含區域路徑的檔案系統。


    # mount device mountpoint
    
  14. 在被動節點上切換至單一使用者模式。


    # init s
    
  15. 停止所有可能已啟動且不受 Sun Cluster Data Service for Solaris Container 所控制的區域。


    # zoneadm -z zonename halt
    
  16. (可選擇) 如果您安裝多個修補程式,基於效能的理由,您可選擇在單一使用者模式中啟動所有已配置的區域。


    # zoneadm -z zonename boot -s
    
  17. 套用修補程式。

  18. 重新啟動節點並等待到它所有的 SMF 啟動方法完成為止。僅在重新啟動節點後才執行 svcs -a 指令。


    # reboot
    

    # svcs -a
    

    現在,第一個節點已就緒。

  19. 撤除您要修補的第二個節點。


    # clresourcegroup evacuate -n node2
    
  20. 對第二個節點重複步驟 8 至 13。

  21. 中斷連接您已修補的區域以加速修補程序。


    # zoneadm -z zonename detach
    
  22. 在被動節點上切換至單一使用者模式。


    # init s
    
  23. 停止所有可能已啟動且不受 Sun Cluster Data Service for Solaris Container 所控制的區域。


    # zoneadm -z zonename halt
    
  24. (可選擇) 如果您安裝多個修補程式,基於效能的理由,您可選擇在單一使用者模式中啟動所有已配置的區域。


    # zoneadm -z zonename boot -s
    
  25. 套用修補程式。

  26. 連接您已中斷連接的區域。


    # zoneadm -z zonename attach -F
    
  27. 將節點重新啟動到叢集模式。


    # reboot
    
  28. 將一個或多個裝置群組連線。

  29. 啟動資源群組。

  30. 使用 scversions 指令檢查是否需要確定修補程式軟體。


    # /usr/cluster/bin/scversions
    

    您將看到以下結果之一:


    Upgrade commit is needed.
    
    Upgrade commit is NOT needed. All versions match.
  31. 如果需要確定,請確定該修補程式軟體。


    # scversions -c
    

    備註 –

    視情況而定,執行 scversions 將會導致一次或多次重新配置 CMM。


變更 Sun Cluster 修補程式

若要移除已套用至叢集的 Sun Cluster 修補程式,您必須先移除新的 Sun Cluster 修補程式,然後重新套用先前的修補程式或更新發行版本。若要移除新的 Sun Cluster 修補程式,請參閱下列程序。若要重新套用先前的 Sun Cluster 修補程式,請參閱下列程序之一:


備註 –

套用 Sun Cluster 修補程式之前,請檢查修補程式的 README 檔案。


Procedure如何移除不需重新啟動的 Sun Cluster 修補程式

  1. 在叢集中任何節點上成為超級使用者。

  2. 移除不需重新啟動的修補程式。


    # patchrm patchid
    

Procedure如何移除需要重新啟動的 Sun Cluster 修補程式

  1. 成為叢集中任何節點的超級使用者。

  2. 將叢集節點啟動為非叢集模式。如需關於將節點啟動為非叢集模式的資訊, 請參閱如何以非叢集模式啟動叢集節點

  3. 移除需要重新啟動的修補程式。


    # patchrm patchid
    
  4. 將叢集節重新點啟動回叢集模式。


    # reboot
    
  5. 請對每個節點重複步驟 2 到步驟 4。