OS安装类型:
CentOS-7.5-aarch64-1804。
注:操作系统安装使用最小简化版安装(如上图),其余步骤安装一般安装操作系统步骤即可。
安装Ceph所在服务器需开通外网权限(开通方法:向相应网络管理人员申请)
IP(内网ip\弹性ip) OS 主机名 角色 硬盘数
192.168.0.78\172.31.96.64 CentOS7.5-arm64 ceph-1 deploy、mon1、osd1 40G2
192.168.0.187\172.31.96.59 CentOS7.5-arm64 ceph-2 mon1、osd1 40G2
192.168.0.59\172.31.96.27 CentOS7.5-arm64 ceph-3 mon1、osd1 40G*2
a.添加主机节点域名(三台机器)
vi /etc/hosts
192.168.0.78 172.31.96.64 ceph-1
192.168.0.187 172.31.96.59 ceph-2
192.168.0.59 172.31.96.27 ceph-3
b.修改hoatname,分别在三台机器上执行
hostnamectl --static set-hostname ceph-1
hostnamectl --static set-hostname ceph-2
hostnamectl --static set-hostname ceph-3
c.关闭防火墙和开机自启动(三台机器)
systemctl stop firewalld
systemctl disable firewalld
d.节点时区同步,保持一致
e.关闭selinux(三台机器)
vi /etc/selinux/config
#修改SELINUX=disabled
f.配置dns
vi /etc/resolv.conf
nameserver 114.114.114.114
[ceph]
name=Ceph packages for aarch64
baseurl=http://mirrors.aliyun.com/ceph/rpm-nautilus/el7/aarch64/
gpgcheck=0
[ceph-noarch]
name=Ceph-noarch packages for aarch64
baseurl=http://mirrors.aliyun.com/ceph/rpm-nautilus/el7/noarch/
gpgcheck=0
yum install epel-release
yum makecache
yum -y install ceph ceph-radosgw
yum -y install ceph-deploy
ceph-deploy --version
ceph –v
ssh-keygen -t rsa -P ‘’
ssh-copy-id ceph-2
ssh-copy-id ceph-3
mkdir -p /opt/ceph-cluster
cd /opt/ceph-cluster
ceph-deploy new ceph-1 ceph-2 ceph-3
若部署出现错误,需要重头开始:
ceph-deploy purge ceph-1 ceph-2 ceph-3
ceph-deploy purgedata ceph-1 ceph-2 ceph-3
ceph-deploy forgetkeys
rm ceph.*
vi /opt/ceph-cluster/ceph.conf
追加:public_network = 192.168.0.0/24
ceph-deploy – mon create-initial
ceph-deploy admin ceph-1 ceph-2 ceph-3
luminous之后mgr需要单独安装
ceph-deploy mgr create ceph-1
ceph-deploy mgr create ceph-2
ceph-deploy mgr create ceph-3
ceph-deploy osd create --data /dev/vdb ceph-1
ceph-deploy osd create --data /dev/vdb ceph-2
ceph-deploy osd create --data /dev/vdb ceph-3
ceph –s
到此,一个简单的CEPH集群已搭建成功
现象:运行ceph-deploy osd create --data /dev/vdb ceph-1
[ceph-1][WARNIN] stderr: Physical volume ‘/dev/vdb’ is already in volume group ‘ceph-0ae0b9dc-cc2d-45ff-b804-92edcc3b71c7’
[ceph-1][WARNIN] Unable to add physical volume ‘/dev/vdb’ to volume group ‘ceph-0ae0b9dc-cc2d-45ff-b804-92edcc3b71c7’
原因:可能之前运行过此任务,导致/dev/vdb已经加入了卷组
解决:vgremove ceph-0ae0b9dc-cc2d-45ff-b804-92edcc3b71c7
现象:[errno 2] error connecting to the cluster
原因:ceph.client.admin.keyring 文件未被同步到/etc/ceph下
解决:此问题有以下两种解决方式
1.ceph-deploy admin ceph-1 ceph-2 ceph-3
2. find / -name ceph.client.admin.keyring
将找到的ceph.client.admin.keyring文件copy到三台机器的/etc/ceph下