操作环境
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节点
- exported keyring for mon.
4.获取mon的map
- [root@mon1 ~]# ceph mon getmap -o /tmp/mapfile
- 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中
8.查看当前mon节点
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
删除Mon
1.查看当前mon节点
- [root@mon1 ~]# ceph mon stat
- 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节点
- [root@mon1 ~]# /etc/init.d/ceph -a stop mon.gamma
- === mon.gamma ===
- Stopping Ceph mon.gamma on mon3...kill 1576...done
3.将mon.gamma节点从ceph cluster中删除掉
- [root@mon1 ~]# ceph mon remove gamma
- removed mon.gamma at 10.10.200.10:6789/0, there are now 2 monitors
4.在ceph.conf配置文件中删除mon.gamma字段
5.查看当前mon节点
- [root@mon1 ~]# ceph mon stat
- 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