1.添加ceph.repo,安装ceph-deploy
[root@ss04 yum.repos.d]# cat /etc/yum.repos.d/ceph.repo [Ceph] name=Ceph packages for $basearch baseurl=http://hk.ceph.com/rpm-jewel/el7/$basearch enabled=1 gpgcheck=0 [Ceph-noarch] name=Ceph noarch packages baseurl=http://hk.ceph.com/rpm-jewel/el7/noarch enabled=1 gpgcheck=0 [ceph-source] name=Ceph source packages baseurl=http://hk.ceph.com/rpm-jewel/el7/SRPMS enabled=1 gpgcheck=0
# yum clean all
# yum install ceph-deploy
2.创建集群,并安装ceph相关软件包
# 创建目录 mkdir /home/ceph # 进入目录,创建集群 cd /home/ceph ceph-deploy new ss04 # 安装ceph软件包 yum install ceph ceph-radosgw
3.修改配置文件,配置初始化
[root@ss04 ceph]# cat ceph.conf [global] fsid = 90602ee8-b900-44f2-b218-9dd4fc8273af mon_initial_members = ss04 mon_host = 10.64.37.54 auth_cluster_required = cephx auth_service_required = cephx auth_client_required = cephx osd pool default size = 2 public network = 10.64.37.0/24
# 初始化
ceph-deploy mon create-initial
4.添加osd
# 创建文件夹 mkdir osd0 osd1 chown ceph:ceph osd0 osd1 # 添加osd ceph-deploy osd prepare ss04:/home/ceph/osd0 ceph-deploy osd prepare ss04:/home/ceph/osd1 ceph-deploy osd activate ss04:/home/ceph/osd0 ceph-deploy osd activate ss04:/home/ceph/osd1