标签:quincy -- 离线 osd ceph ceph17 node1 docker orch
ceph-ansible集群搭建
主机名 |
IP |
node1 |
10.0.0.18 |
node2 |
10.0.0.19 |
node3 |
10.0.0.20 |
操作系统 |
虚拟化软件 |
Ubuntu22.04 |
VMware15 |
1.配置hosts解析(所有节点)
cat >> /etc/hosts <<EOF
10.0.0.10 node1
10.0.0.11 node2
10.0.0.12 node3
EOF
2.制作离线源(所有节点)
tar zxvf ceph_quincy.tar.gz -C /opt/
cp /etc/apt/sources.list{,.bak}
cat > /etc/apt/sources.list << EOF
deb [trusted=yes] file:// /opt/ceph_quincy/debs/
EOF
apt-get clean all
apt-get update
3.配置时间同步
# 可配置开启
timedatectl set-ntp true
# 配置上海时区
timedatectl set-timezone Asia/Shanghai
# 系统时钟与硬件时钟同步
hwclock –-systohc
4.安装docker(所有节点)
apt -y install docker-ce
5.安装cephadm(node1)
apt install -y cephadm
6.导入ceph镜像(所有节点)
docker load -i cephadm_images_v17.tar
6.1.搭建制作本地仓库(node1)
# 导入镜像
docker load -i registry.tar
# 启动
docker run -d --name registry -p 5000:5000 --restart always 3a0f7b0a13ef
cat >> /etc/docker/daemon.json << EOF
{
"insecure-registries":["10.0.0.20:5000"]
}
EOF
systemctl daemon-reload
systemctl restart docker
docker tag 0912465dcea5 10.0.0.20:5000/ceph:v17
docker push 10.0.0.20:5000/ceph:v17
6.2.配置私有仓库
cat >> /etc/docker/daemon.json << EOF
{
"insecure-registries":["10.0.0.20:5000"]
}
EOF
systemctl daemon-reload
systemctl restart docker
7.引导集群(node1)
mkdir -p /etc/ceph
cephadm --image 10.0.0.20:5000/ceph:v17 bootstrap --mon-ip 10.0.0.20 --initial-dashboard-user admin --initial-dashboard-password 000000 --skip-pull
ps
# 要部署其他监视器
ceph orch apply mon "test01,test02,test03"
# 删除集群
cephadm rm-cluster --fsid d92b85c0-3ecd-11ed-a617-3f7cf3e2d6d8 --force
8.安装ceph-common工具(node1)
apt install -y ceph-common
9.添加主机到集群(node1)
ssh-copy-id -f -i /etc/ceph/ceph.pub node2
ssh-copy-id -f -i /etc/ceph/ceph.pub node3
ceph orch host add node2
ceph orch host add node3
10.部署OSD
# 查看可用的磁盘设备
ceph orch device ls
# 添加到ceph集群中,在未使用的设备上自动创建osd
ceph orch apply osd --all-available-devices
PS:
# 从特定主机上的特定设备创建OSD:
ceph orch daemon add osd node1:/dev/sdb
ceph orch daemon add osd node2:/dev/sdb
ceph orch daemon add osd node3:/dev/sdb
# 查看osd磁盘
ceph -s
ceph df
11.部署MDS
- CephFS 需要两个 Pools,cephfs-data 和 cephfs-metadata,分别存储文件数据和文件元数据
ceph osd pool create cephfs-metadata 16 16
ceph osd pool create cephfs-data 32 32
ceph fs new cephfs cephfs-metadata cephfs-data
ceph orch apply mds cephfs --placement="3 node1 node2 node3"
# 查看mds有三个,两个预备状态
ceph -s
12.部署RGW
ceph orch apply rgw myorg cn-east-1 --placement="3 node1 node2 node3"
# 最后一个,需要等一会
ceph orch ls
标签:quincy,
--,
离线,
osd,
ceph,
ceph17,
node1,
docker,
orch
From: https://www.cnblogs.com/wsxier/p/16736973.html