ceph基本操作:
/etc/init.d/ceph -a start/stop //即在所有節點上執行
單個操作:
start/stop ceph-osd id={id}
start/stop ceph-mon id={hostname}
start/stop ceph-mds id={hostname}
叢集監控:監控osd狀态、monitor status、placement組(pg)、中繼資料伺服器狀态;
#ceph //進入ceph會話模式
ceph> health
ceph> status
ceph> quorum_status //??
ceph> mon-status
實時監控叢集:
#ceph -w
#ceph osd stat //檢測osd的狀态
#ceph osd dump //檢測osd的詳細資訊
#ceph osd tree //根據Crush Map檢視osd的狀态
monitor監控:
#ceph mon stat
#ceph mon dump
#ceph quorum_status
mds監控:
#ceph mds stat
#ceph mds dump
使用admin socket
ceph管理者通過一個Socket接口查詢一個守護程序,預設情況下,在/var/run/ceph下
#ceph --admin-daemon /var/run/ceph/{socket-name}
#ceph --admin-daemon /var/run/ceph/{socket-name} help
監控守護程序OSD的4中狀态:
In----Out (是否在叢集裡面)
Up----Down (是否是開啟狀态)
pg叢集:(placement groups)
檢視pg清單
#ceph pg dump
#ceph pg stat
#ceph pg dump -o {filename} --format=json #輸出json格式,并保持檔案
檢視pg map 及 參數
#ceph pg map {pg-num}
#擷取池子副本個數:
#ceph osd pool get POOLNAME size
#檢視osd池子個數
ceph osd lspools
#池子名字必須是兩次
ceph osd pool delete {pool-name} {pool-name} --yes-i-really-really-mean-it
du -sh /var/local //檢視目錄下所有檔案大小
從crush map中移除osd的資訊
ceph osd out osd.x
ceph osd crush remove osd.x
ceph auth del osd.x
ceph osd down osd.x
stop ceph-osd id=x
ceph osd rm osd.x