Ceph添加/刪除Mon(ceph.conf)


操作環境

ceph 0.87.7

Openstack liberty

ubuntu 14.04 

當前ceph配置文件如下

[global]
fsid = c010eb34-ccc6-458d-9a03-faccff8991a7
mon_initial_members = controller, computer-1, computer-2
mon_host = 2.2.2.14,2.2.2.11,2.2.2.12
auth_cluster_required = cephx
auth_service_required = cephx
auth_client_required = cephx
filestore_xattr_use_omap = true
mon_pg_warn_max_per_osd = 1000

操作步驟

添加Mon

1.查看當前mon節點

root@computer-1# ceph mon stat
e3: 3 mons at {computer-1=2.2.2.11:6789/0,computer-2=2.2.2.12:6789/0,controller=2.2.2.14:6789/0}, election epoch 82, quorum 0,1,2 computer-1,computer-2
我之前的是3個,這里一個mon節點出故障了,不能參加投票,這里從新添加進去到集群里
 
3.獲取mon的keyring
[root@mon1 ~]#  ceph auth get mon. -o /tmp/keyring  
  1. exported keyring for mon.  

4.獲取mon的map

  1. [root@mon1 ~]# ceph mon getmap -o /tmp/mapfile  
  2. got monmap epoch 3  

5.初始化mon.gamma節點的數據目錄

 

root@controller# ceph-mon -i controller --mkfs --monmap /tmp/mapfile --keyring /tmp/keyring  
ceph-mon: set fsid to c010eb34-ccc6-458d-9a03-faccff8991a7
ceph-mon: created monfs at /var/lib/ceph/mon/ceph-controller for mon.controller6.添加mon.gamma節點至ceph cluster中

6.添加mon.gamma節點至ceph cluster中
root@controller:/tmp# ceph mon add controller 2.2.2.14:6789
added mon.controller at 2.2.2.14:6789/0
 
7.啟動mon.controller
root@controller:/tmp# ceph-mon -i controller --public-addr 2.2.2.14:6789
 

8.查看當前mon節點

root@controller# ceph mon stat
e3: 3 mons at {computer-1=2.2.2.11:6789/0,computer-2=2.2.2.12:6789/0,controller=2.2.2.14:6789/0}, election epoch 82, quorum 0,1,2 computer-1,computer-2,controller  
可以看出controller已經參加投票了,哈哈。大功告成

 

刪除Mon

1.查看當前mon節點

[plain] view plain copy
 
  1. [root@mon1 ~]# ceph mon stat  
  2. e2: 3 mons at {alpha=10.10.200.3:6789/0,beta=10.10.200.4:6789/0,gamma=10.10.200.10:6789/0}, election epoch 84, quorum 0,1,2 alpha,beta,gamma  


2.例如刪除mon.gamma節點,首先停止mon.gamma節點

[plain] view plain copy
 
  1. [root@mon1 ~]# /etc/init.d/ceph -a stop mon.gamma  
  2. === mon.gamma ===   
  3. Stopping Ceph mon.gamma on mon3...kill 1576...done  


3.將mon.gamma節點從ceph cluster中刪除掉

[plain] view plain copy
 
  1. [root@mon1 ~]# ceph mon remove gamma  
  2. removed mon.gamma at 10.10.200.10:6789/0, there are now 2 monitors  


4.在ceph.conf配置文件中刪除mon.gamma字段

 

5.查看當前mon節點

[plain] view plain copy
 
  1. [root@mon1 ~]# ceph mon stat  
  2. e3: 2 mons at {alpha=10.10.200.3:6789/0,beta=10.10.200.4:6789/0}, election epoch 88, quorum 0,1 alpha,b


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM