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

推荐订阅源

V
Visual Studio Blog
T
Tailwind CSS Blog
Google DeepMind News
Google DeepMind News
D
DataBreaches.Net
P
Proofpoint News Feed
Simon Willison's Weblog
Simon Willison's Weblog
Microsoft Azure Blog
Microsoft Azure Blog
MongoDB | Blog
MongoDB | Blog
腾讯CDC
月光博客
月光博客
A
Arctic Wolf
T
Threatpost
Jina AI
Jina AI
博客园 - 聂微东
美团技术团队
V
V2EX
云风的 BLOG
云风的 BLOG
宝玉的分享
宝玉的分享
Recent Commits to openclaw:main
Recent Commits to openclaw:main
M
MIT News - Artificial intelligence
S
Secure Thoughts
Martin Fowler
Martin Fowler
Webroot Blog
Webroot Blog
V
Vulnerabilities – Threatpost
爱范儿
爱范儿
人人都是产品经理
人人都是产品经理
Help Net Security
Help Net Security
Google Online Security Blog
Google Online Security Blog
博客园 - Franky
The Last Watchdog
The Last Watchdog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
阮一峰的网络日志
阮一峰的网络日志
博客园 - 【当耐特】
S
Schneier on Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Know Your Adversary
Know Your Adversary
Latest news
Latest news
有赞技术团队
有赞技术团队
AWS News Blog
AWS News Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Y
Y Combinator Blog
G
Google Developers Blog
NISL@THU
NISL@THU
H
Heimdal Security Blog
L
LangChain Blog
T
Troy Hunt's Blog
I
InfoQ
U
Unit 42
C
Check Point Blog
Engineering at Meta
Engineering at Meta

k8s入门系列 on 打工人日志

k8s RKE2 cilium L2 + envoy gateway 安装配置 k8s RKE2 vSphere 存储配置 Kubernetes — skywalking + banyanDB APM监控部署 Kubernetes — promtail + loki + grafana 日志系统部署 Kubernetes — metalLB + Traefik 部署 Kubernetes — SSL 证书自动更新 Kubernetes — RKE2 + kube-vip + cilium 部署 metallb + ingress-nginx + argocd 本地部署 Kubernetes — k8s 手动安装 1.17.9 Argo cd 安装和部署 Kubernetes — kubecost 分析 Kubernetes 成本 Kubernetes — 更新证书 Kubernetes — Rook云存储介绍和部署 Kubernetes — 基于K8S搭建Ceph分布式存储 Kubernetes — 探针和生命周期 Kubernetes — 开放标准(OCI、CRI、CNI、CSI、SMI、CPI)概述 kubernetes 部署插件 (Flannel、Web UI、CoreDNS、Ingress Controller) kubernetes 存储 kubernetes 从1.23.x 升级到 1.24.x 编写 kubernetes 资源描述文件 kubernetes manual expansion kubernetes 调度过程 k8s本地联调神器kt-connect OpenELB:让k8s私有环境对外暴露端口 kubernetes ansible自动化部署 kubernetes 脚本快速安装 kubernetes面试题汇总 Kubernetes 安装 Harbor 搭建 Kubernetes 实验手册(1) Keepalived高可用 k3s 升级版本 helm 安装 k8s 部署loki日志 Kubernetes 创建nfs存储类 Kubernetes k8s 组件
Ansible部署ceph集群
2023-07-18 · via k8s入门系列 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