2021-05-12 14:32:11
Linux RHCS 基礎維護命令
本文只是介紹Linux RHCS最基本的一些維護命令,屬於DBA應該了解的層面。
1.檢視叢集狀態
2.叢集正常啟動
3.叢集正常關閉
4.檢視服務是否關閉開機啟動
1. 檢視叢集狀態
clustat
cman_tool status
cman_tool nodes -a
下面是這些命令查詢的顯示結果範例:
#1.1 clustat檢視叢集狀態(最常用)
在節點1檢視的,狀態中的Local就在節點1上顯示。
# 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
#1.2 cman_tool status 檢視
# cman_tool status
Version: 6.2.0
Config Version: 18
Cluster Name: new_cluster
Cluster Id: 23732
Cluster Member: Yes
Cluster Generation: 432
Membership state: Cluster-Member
Nodes: 2
Expected votes: 1
Total votes: 2
Quorum: 1
Active subsystems: 8
Flags: 2node Dirty
Ports Bound: 0 177
Node name: heartdb1
Node ID: 1
Multicast addresses: 239.192.92.17
Node addresses: 192.168.1.1
#1.3 cman_tool 檢視nodes資訊
# 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
2. 叢集正常啟動
先啟動cman,再啟動rgmanager.
service cman start
service rgmanager start
下面是叢集正常啟動過程範例:
注: 各節點先依次啟動cman再依次啟動rgmanager,注意啟動順序。
# service cman start
Starting cluster:
Loading modules... done
Mounting configfs... done
Starting ccsd... done
Starting cman... done
Starting daemons... done
Starting fencing... done
[確定]
# service rgmanager start
啟動 Cluster Service Manager:[確定]
3. 叢集正常關閉
先關閉rgmanager,再關閉cman.
service rgmanager stop
service cman stop
下面是叢集正常關閉過程範例:
注: 各節點先依次關閉rgmanager,再依次關閉cman,注意關閉順序。
# service rgmanager stop
Shutting down Cluster Service Manager...
等待服務停止:[確定]
Cluster Service Manager is stopped.
# service cman stop
Stopping cluster:
Stopping fencing... done
Stopping cman... done
Stopping ccsd... done
Unmounting configfs... done
[確定]
4. 檢視服務是否關閉開機啟動
chkconfig --list |grep cman
chkconfig --list |grep rgmanager
下面的檢視結果都是關閉的:
# chkconfig --list |grep cman
cman 0:關閉 1:關閉 2:關閉 3:關閉 4:關閉 5:關閉 6:關閉
# chkconfig --list |grep rgmanager
rgmanager 0:關閉 1:關閉 2:關閉 3:關閉 4:關閉 5:關閉 6:關閉
RHCS+GFS(紅帽HA+GFS) http://www.linuxidc.com/Linux/2014-04/99574.htm
基於RHCS+iSCSI+CLVM實現Web服務的共用儲存叢集架構 http://www.linuxidc.com/Linux/2013-05/84888.htm
RHCS多節點部署應用企業環境 http://www.linuxidc.com/Linux/2013-05/84456.htm
RedHat 5.8 x64 RHCS Oracle 10gR2 HA實踐設定 http://www.linuxidc.com/Linux/2013-03/81589.htm
RHCS基於Java的HA雙機熱備 http://www.linuxidc.com/Linux/2012-12/76587.htm
圖解RHCS的安裝設定與應用 http://www.linuxidc.com/Linux/2012-11/75111.htm
本文永久更新連結地址:http://www.linuxidc.com/Linux/2015-09/122606.htm
相關文章