Ceph經常使用命令


(1) 監控命令
    1.1 ceph健康狀態檢查 http://docs.ceph.com/docs/master/rados/operations/monitoring/
        a) ceph集羣狀態查詢(靜態)
        # ceph -s
        b) ceph集羣狀態查詢(動態更新最新信息)
        # ceph -w node

    1.2 磁盤Disk
        a) 查看集羣節點上有多少磁盤
        # ceph-deploy disk list <節點Host名>
       
        b) 在單個節點上查詢節點的磁盤信息
        # sudo /usr/sbin/ceph-disk list
       
        c) 參看塊設備信息
        # lsblk
   
    1.3 配置信息推送
        a) Copy ceph.conf to/from remote host(s)
        # ceph-deploy config [-h] {push,pull}
        # ceph-deploy config push node1 node2 node3
       
        d) 推進配置文件和admin key
        # ceph-deploy admin admnode node1 node2 node3
       
(2) OSD 相關
    2.1 OSD信息
        a) 查看全部OSD狀態
        # ceph osd tree
       
    2.2 OSD配置相關    http://docs.ceph.com/docs/master/rados/configuration/osd-config-ref/vim

    2.3 建立OSD http://docs.ceph.com/docs/master/rados/deployment/ceph-deploy-osd/
        a) List Disks on a node
        # ceph-deploy disk list {node-name [node-name]...}
       
        b) prepare the OSDs and deploy them to the OSD node(s).
        # ceph-deploy osd prepare {node-name}:{data-disk}[:{journal-disk}]
        # ceph-deploy osd prepare osdserver1:sdb:/dev/ssd
       
        c) Once you prepare an OSD you may activate it
        # ceph-deploy osd activate {node-name}:{data-disk-partition}[:{journal-disk-partition}]
        # ceph-deploy osd activate osdserver1:/dev/sdb1:/dev/ssd1
       
        d) The create command is a convenience method for executing the prepare and activate command sequentially
        # ceph-deploy osd create {node-name}:{disk}[:{path/to/journal}]
        # ceph-deploy osd create osdserver1:sdb:/dev/ssd1
    2.4 刪除OSD  http://docs.ceph.com/docs/master/rados/operations/add-or-rm-osds/#removing-the-osd
        a) Take the OSD out of the Cluster
        # ceph osd out {osd-num}
       
        b) Stopping your OSD before you remove it from the configuration.Once you stop your OSD, it is down.
        # ssh {osd-host}
        # sudo /etc/init.d/ceph stop osd.{osd-num}
       
        c) Removing the OSD
            c.1) Remove the OSD from the CRUSH map
                # ceph osd crush remove {The full name of the OSD, eg osd.0}
           
            c.2) Remove the OSD authentication key.
                # ceph auth del osd.{osd-num}
               
            c.3) Remove the OSD
                # ceph osd rm {osd-num}
                # ceph osd rm 1   ==》 output: ceph osd rm 1
               
            c.4) 若是在管理節點存在該ceph.conf 文件中相關OSD的配置信息(例如 [osd.1]配置區域),刪除它。
                # ssh {admin-host}
                # vim /etc/ceph/ceph.conf
           
            c.5) 若是執行了c.4步驟後,須要將更新後的ceph.conf推送到其餘全部的節點,更新其餘節點的ceph.conf文件
    2.5 啓動OSD服務
        #sudo /etc/init.d/ceph  -a start osd.{osd-num}
           
(3) Monitor相關
    3.1 配置文件 Monitor Config Reference. http://docs.ceph.com/docs/master/rados/configuration/mon-config-ref/
   
    3.2 新增Monitor
        ssh

       
(4) 日誌相關
    4.1 查看相關日誌 http://docs.ceph.com/docs/master/rados/troubleshooting/log-and-debug/
        # sudo vim /var/log/ceph/ceph*.log
       
(5) 服務啓動 http://docs.ceph.com/docs/master/rados/operations/operating/#running-ceph-with-sysvinitdebug

(6) Block Device Image日誌

相關文章
相關標籤/搜索