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

推荐订阅源

C
Check Point Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 聂微东
月光博客
月光博客
博客园 - 司徒正美
爱范儿
爱范儿
aimingoo的专栏
aimingoo的专栏
量子位
Recent Announcements
Recent Announcements
V
V2EX
P
Proofpoint News Feed
小众软件
小众软件
云风的 BLOG
云风的 BLOG
腾讯CDC
宝玉的分享
宝玉的分享
Microsoft Azure Blog
Microsoft Azure Blog
大猫的无限游戏
大猫的无限游戏
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
A
About on SuperTechFans
B
Blog
博客园_首页
GbyAI
GbyAI
博客园 - Franky

jobcher on 打工人日志

2023-12-21 打工人日报 2023-12-20 打工人日报 2023-12-19 打工人日报 2023-12-18 打工人日报 2023-12-17 打工人日报 2023-12-16 打工人日报 2023-12-15 打工人日报 2023-12-14 打工人日报 2023-12-13 打工人日报 2023-12-12 打工人日报 2023-12-11 打工人日报 2023-12-10 打工人日报 2023-12-09 打工人日报 2023-12-08 打工人日报 2023-12-07 打工人日报 2023-12-06 打工人日报 2023-12-05 打工人日报 2023-12-04 打工人日报 2023-12-03 打工人日报 2023-12-02 打工人日报 2023-12-01 打工人日报 2023-11-30 打工人日报 2023-11-29 打工人日报 2023-11-28 打工人日报 2023-11-27 打工人日报 2023-11-26 打工人日报 2023-11-25 打工人日报 2023-11-24 打工人日报 2023-11-23 打工人日报 2023-11-22 打工人日报
Ansible部署ceph集群
2023-07-18 · via jobcher 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