1.基础环境配置
IP | 主机名 |
---|---|
10.0.0.10 | storage01 |
10.0.0.11 | storage02 |
10.0.0.12 | storage03 |
1.1关闭防火墙与selinux
- 所有节点
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config; setenforce 0; systemctl stop firewalld; systemctl disable firewalld
1.2配置离线源
- storage01节点
tar xvf ceph.tar.gz -C /opt/
mkdir /etc/yum.repos.d/bak
mv /etc/yum.repos.d/CentOS-* /etc/yum.repos.d/bak/
cat >> /etc/yum.repos.d/local.repo << EOF
[ceph]
name=ceph
baseurl=file:///opt/ceph/
gpgcheck=0
EOF
yum clean all; yum makecache
yum install -y vsftpd
echo "anon_root=/opt" >> /etc/vsftpd/vsftpd.conf
systemctl enable --now vsftpd
- storage02/03节点
mkdir /etc/yum.repos.d/bak
mv /etc/yum.repos.d/CentOS-* /etc/yum.repos.d/bak/
cat >> /etc/yum.repos.d/local.repo << EOF
[ceph]
name=ceph
baseurl=ftp://10.0.0.10/ceph/
gpgcheck=0
EOF
yum clean all; yum makecache
1.3配置hosts解析
- 所有节点
hostnamectl set-hostname storage01/02/03
cat >> /etc/hosts << EOF
10.0.0.10 storage01
10.0.0.11 storage02
10.0.0.12 storage03
EOF
1.4 配置免密
- storage01
ssh-copy-id -i /root/.ssh/id_rsa.pub root@storage01
ssh-copy-id -i /root/.ssh/id_rsa.pub root@storage02
ssh-copy-id -i /root/.ssh/id_rsa.pub root@storage03
2.安装部署ceph集群
2.1 安装服务
- storage01节点
yum install -y ceph-deploy
2.2配置集群
- storage01节点
mkdir ceph-cluster
cd ceph-cluster
ceph-deploy new --cluster-network 10.0.0.0/24 --public-network 10.0.0.0/24 storage01
- 所有节点安装
yum install -y ceph ceph-radosgw
- storage01节点
ceph-deploy install --no-adjust-repos storage01 storage02 storage03
- 配置初始MON节点,并收集所有密钥(storage01节点)
# 不用配置主机,会根据配置文件完成
ceph-deploy mon create-initial
# 把配置文件和admin密钥拷贝Ceph集群各节点,以免得每次执行"ceph"命令时不得不明确指定MON节点地址和ceph.client.admin.keyring
ceph-deploy admin storage01 storage02 storage03
- 配置mgr
ceph-deploy mgr create storage02
- 所有节点安装
yum install ceph-common -y
3.添加osd
- storage01节点
- 向RADOS集群添加OSD
ceph-deploy disk list storage01 storage02 storage03
-
storage01节点
-
在管理节点上使用ceph-deploy命令擦除计划专用于OSD磁盘上的所有分区表和数据以便用于OSD,命令格式为"ceph-deploy disk zap {osd-server-name}{disk-name}",需要注意的是此步会清除目标设备上的所有数据。下面分别擦净机器用于OSD的一个磁盘设备sdb
ceph-deploy disk zap storage01 /dev/sdb
ceph-deploy disk zap storage02 /dev/sdb
ceph-deploy disk zap storage03 /dev/sdb
- storage01节点
ceph-deploy osd create storage01 --data /dev/sdb
ceph-deploy osd create storage02 --data /dev/sdb
ceph-deploy osd create storage03 --data /dev/sdb
4.扩展监视器节点
- storage01节点
ceph-deploy mon add storage02
ceph-deploy mon add storage03
5.扩展管理器节点
- storage01节点
ceph-deploy mgr create storage01
6.禁用不安全模式
- storage01节点
ceph config set mon auth_allow_insecure_global_id_reclaim false
标签:deploy,部署,storage01,ceph,etc,yum,ceph14,版本,节点
From: https://www.cnblogs.com/wsxier/p/17441653.html