1.添加mds配置
# vi ceph.conf
[mds.a]
host = hostname
2.为mds元数据服务器创建一个目录
# mkdir -p /var/lib/ceph/mds/ceph-a
3.为bootstrap-mds客户端创建一个密钥
# ceph-authtool --create-keyring /var/lib/ceph/bootstrap-mds/ceph.keyring --gen-key -n client.bootstrap-mds
4.在ceph auth库中创建bootstrap-mds客户端,赋予权限添加之前创建的密钥
# ceph auth add client.bootstrap-mds mon 'allow profile bootstrap-mds' -i /var/lib/ceph/bootstrap-mds/ceph.keyring
5.在ceph auth库中创建mds.a用户,并赋予权限和创建密钥,密钥保存在/var/lib/ceph/mds/ceph-a/keyring文件里
# ceph --name client.bootstrap-mds --keyring /var/lib/ceph/bootstrap-mds/ceph.keyring auth get-or-create mds.a osd 'allow rwx' mds 'allow' mon 'allow profile mds' -o /var/lib/ceph/mds/ceph-a/keyring
6.启动mds服务进程
# service ceph start mds.a
=== mds.a ===
Starting Ceph mds.a on DEV-L0003542...
starting mds.a at :/0
# ceph mds stat #查看mds节点状态
e4: 1/1/1 up {0=a=up:active}
7.查看集群状态
# ceph -s
cluster 1c7ec934-1595-11e5-aa3f-06aed00006d5
health HEALTH_WARN 1360 pgs degraded; 4820 pgs stuck unclean; recovery 62423/138288 objects degraded (45.140%)
monmap e1: 1 mons at {mon1=10.20.15.156:6789/0}, election epoch 2, quorum 0 mon1
mdsmap e4: 1/1/1 up {0=a=up:active}
osdmap e143: 7 osds: 7 up, 7 in
pgmap v5095: 4820 pgs, 14 pools, 9919 kB data, 46096 objects
9251 MB used, 150 GB / 159 GB avail
62423/138288 objects degraded (45.140%)
667 active
1360 active+degraded
2793 active+remapped
client io 3058 B/s wr, 5 op/s