惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
爱范儿
爱范儿
J
Java Code Geeks
L
LangChain Blog
V
V2EX
大猫的无限游戏
大猫的无限游戏
S
SegmentFault 最新的问题
博客园 - Franky
Microsoft Azure Blog
Microsoft Azure Blog
Jina AI
Jina AI
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Cloudflare Blog
博客园 - 司徒正美
B
Blog
G
Google Developers Blog
Stack Overflow Blog
Stack Overflow Blog
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
Engineering at Meta
Engineering at Meta
MyScale Blog
MyScale Blog
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog

博客 on 打工人日志

k8s RKE2 cilium L2 + envoy gateway 安装配置 k8s RKE2 vSphere 存储配置 OpenClaw 全能指南:从安装到进阶自动化实战 (2026 最终版) Kubernetes — skywalking + banyanDB APM监控部署 Kubernetes — promtail + loki + grafana 日志系统部署 k8s master 节点 Unauthorized Kubernetes — metalLB + Traefik 部署 Kubernetes — SSL 证书自动更新 Kubernetes — RKE2 + kube-vip + cilium 部署 使用TLSv1.3 升级nginx和openssl Proxmox VE(PVE) 更新到最新版本 kindle 邮件发送失败,错误代码E999 metallb + ingress-nginx + argocd 本地部署 iStoreOS(旁路由)使用openclash实现dns劫持 异常流量分析:图片库服务黑客入侵 openwrt 硬盘扩容 搭建ip地址检索服务 Kubernetes — k8s 手动安装 1.17.9 SELinux 问题:导致端口无法创建,无法访问 【福利】免费!本地部署!去除视频中移动的物体 通知:《打工人日报》迁移到独立板块 KyBook 3 | calibre-web - IOS系统最佳图书伴侣 Tmux 安装和使用教程 DockerHub 加速镜像部署 - 使用cloudflare 代理 docker的零停机部署 SD-webui 批量处理图片 ubuntu 安装 ComfyUI ubuntu 安装 stable-diffusion-webui 测试策略:微服务架构 单元测试:测试单元质量提升
Ansible部署ceph集群
2023-07-18 · via 博客 on 打工人日志

基础配置

三台环境为centos7.9,以下配置需要在每台机器上执行

配置hosts解析

1cat >> /etc/hosts <<EOF
2192.168.2.23 node1
3192.168.2.24 node2
4192.168.2.25 node3
5EOF

关闭防火墙和selinux

1systemctl stop firewalld && systemctl disable firewalld
2setenforce 0 && sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

分别在三个节点设置主机名

1hostnamectl set-hostname node1
2hostnamectl set-hostname node2
3hostnamectl set-hostname node3

配置主机时间同步

1systemctl restart chronyd.service && systemctl enable chronyd.service

配置免密登录

1ssh-keygen
2ssh-copy-id -i .ssh/id_rsa.pub node1
3ssh-copy-id -i .ssh/id_rsa.pub node2
4ssh-copy-id -i .ssh/id_rsa.pub node3

安装pip和ansible、git

1yum install python-pip ansible git -y

部署ceph集群

克隆存储库

这里我选择安装的是ceph nautilus版本

1git clone https://github.com/ceph/ceph-ansible.git
2cd ceph-ansible
3git checkout stable-4.0

安装ansible依赖包

1pip install --upgrade pip
2pip install -r requirements.txt

修改hosts文件,添加安装的节点

 1cat >> /etc/ansible/hosts <<EOF
 2[mons]
 3node1
 4node2
 5node3
 6
 7[osds]
 8node1
 9node2
10node3
11
12[mgrs]
13node1
14
15[mdss]
16node1
17node2
18node3
19
20[clients]
21node1
22node2
23node3
24
25[rgws]
26node1
27node2
28node3
29
30[grafana-server]
31node1
32
33EOF

备份group_vars下的yml文件

1cd ceph-ansible/group_vars
2for file in *;do cp $file ${file%.*};done

修改group_vars/all.yml配置

 1---
 2dummy:
 3mon_group_name: mons
 4osd_group_name: osds
 5rgw_group_name: rgws
 6mds_group_name: mdss
 7client_group_name: clients
 8mgr_group_name: mgrs
 9grafana_server_group_name: grafana-server
10configure_firewall: False
11ceph_origin: repository
12ceph_origin: repository
13ceph_repository: community
14ceph_mirror: http://mirrors.aliyun.com/ceph
15ceph_stable_key: http://mirrors.aliyun.com/ceph/keys/release.asc
16ceph_stable_release: nautilus
17ceph_stable_repo: "{{ ceph_mirror }}/rpm-{{ ceph_stable_release }}"
18public_network: "192.168.2.0/24"
19cluster_network: "192.168.2.0/24"
20monitor_interface: ens33
21osd_auto_discovery: true
22osd_objectstore: filestore
23radosgw_interface: ens33
24dashboard_admin_password: asd123456
25grafana_admin_password: admin
26pg_autoscale_mode: True

修改group_vars/osds.yml配置

修改site.yml配置
ceph-site

开始进行安装

剩下的交给时间吧,十分钟左右就装好了

1ansible-playbook -i /etc/ansible/hosts site.yml

查看安装状态,发现有一个警告,这是因为在之前的all.yml配置没有开启允许自动调整pool中的pg数 pg_autoscale_mode: False ,手动设置下即可

1ceph osd pool set <pool-name> pg_autoscale_mode on