配置apt源
安装ceph-deploy,一台机器即可
# apt-get install ceph-deploy
安装ceph软件,三台机器都需要安装
# apt-get install ceph
创建集群
初始化集群
# ceph-deploy mon create-initial
拷贝秘钥
# cp ceph.client.admin.keyring /etc/ceph/
添加osd
由于没有裸盘,所以直接指定目录作为osd,尝试了下新版luminous,ceph-deploy里似乎不支持指定目录作为osd
-
# mkdir -p /data/ceph/data
-
# chown ceph:ceph /data/ceph/data/
-
# ceph-deploy osd prepare k8s2:/data/ceph/data
-
# ceph-deploy osd activate k8s2:/data/ceph/data
三个节点每个节点一个osd
-
# ceph -s
-
cluster 6d8963e9-9585-4679-8dac-17b60f2d0c30
-
health HEALTH_OK
-
monmap e1: 3 mons at {tj006=172.16.41.25:6789/0,tj007=172.16.41.26:6789/0,tj008=172.16.41.27:6789/0}
-
election epoch 12, quorum 0,1,2 tj006,tj007,tj008
-
osdmap e14: 3 osds: 3 up, 3 in
-
flags sortbitwise,require_jewel_osds
-
pgmap v29: 64 pgs, 1 pools, 0 bytes data, 0 objects
-
7811 GB used, 39739 GB / 50064 GB avail
-
64 active+clean
添加mds
-
# ceph-deploy mds create k8s1
-
# ceph osd pool create k8s_data 32
-
# ceph osd pool create k8s_metadata 32
-
# ceph fs new ceph_k8s k8s_metadata k8s_data
-
# mkdir /data/ceph/cephfs
-
# mount -t ceph 172.16.13.160:6789:/ /data/ceph/cephfs -o name=admin,secretfile=/etc/ceph/admin.secret
转载于:https://my.oschina.net/xiaozhublog/blog/2986134