Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> 關於 Linux

Linux RHCS 叢集維運指令速查:clustat、cman_tool 狀態檢視與節點管理

編輯:關於 Linux

Red Hat Cluster Suite (RHCS) 整合叢集管理工具,廣泛用於高可用服務。本文整理 clustat、cman_tool 核心指令,含叢集狀態、節點成員、Quorum 計算、服務遷移等實戰輸出範例,適用 RHEL/CentOS 6/7 環境。

RHCS 架構圖

核心查詢指令

clustat                    # 最常用:叢集/服務/節點一覽
cman_tool status           # 叢集詳細參數 (版本、配置版本、Quorum、節點 ID)
cman_tool nodes -a         # 節點加入時間、狀態、IP 位址

實戰輸出範例解讀

clustat

Cluster Status for new_cluster @ Tue Sep 1 12:23:09 2015
Member Status: Quorate
 Member Name  ID  Status
 ------ ---- ---- ------
 heartdb1     1  Online, Local, rgmanager
 heartdb2     2  Online, rgmanager

 Service Name   Owner (Last)  State
 ------- ---- ----- ------ -----
 service:orares heartdb1      started
  • Local 表示查詢發起節點。
  • rgmanager 代表資源群組管理器運行中。
  • 服務 service:orares 目前在 heartdb1 上運行。

cman_tool status

Version: 6.2.0
Config Version: 18
Cluster Name: new_cluster
Cluster Id: 23732
Cluster Member: Yes
Quorum: 1
Total votes: 2
Expected votes: 1
Flags: 2node Dirty
  • 2node Dirty:兩節點叢集未啟用 Quorum Disk,單節點故障即失去 Quorum。

cman_tool nodes -a

Node Sts Inc Joined Name
1 M 404 2015-08-03 17:52:20 heartdb1
  Addresses: 192.168.1.1
2 M 432 2015-09-01 14:32:27 heartdb2
  Addresses: 192.168.1.2
  • Inc:配置版本遞增計數。
  • M:Member 狀態。

常見維運操作

# 手動遷移服務
clusvcadm -r service:orares -m heartdb2

# 凍結/解凍節點 (維護模式)
ccs_tool freeze
ccs_tool unfreeze

# 重新載入叢集配置
cman_tool version -r

熟練上述指令,可快速掌握叢集健康度並執行故障切換演練。

Copyright © Windows教程網 All Rights Reserved