cephadm搭建ceph文件集群存储

一、基础配置
1、配置主机名

[root@ecs-cd34 ~]hostnamectl set-hostname node1
	[root@ecs-cd34 ~]exec bash    #主机名生效

2、配置hosts解析(根据自己的服务器id修改)

cat >> /etc/hosts <

3、关闭防火墙和selinux

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

4、配置时间同步

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

5、安装python3,才能执行cephadm脚本

dnf install -y epel-release
dnf install -y python3

二、安装docker

2# 删除历史版本docker

yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine

3# 安装docker 基础包

yum install -y yum-utils device-mapper-persistent-data lvm2

4# 设置稳定仓库

yum-config-manager \
--add-repo \
https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

5#安装docker

[root@ceph-node1 ~]# yum install -y https://mirrors.aliyun.com/docker-ce/linux/centos/8/x86_64/stable/Packages/containerd.io-1.4.3-3.1.el8.x86_64.rpm
[root@ceph-node1 ~]# yum install docker-ce docker-ce-cli
[root@ceph-node1 ~]# docker ps

6#配置docker镜像加速

mkdir -p /etc/docker
cat > /etc/docker/daemon.json <

7#修改docker默认的存储路径到挂载盘

[root@xb-edu-dev-01 ]# mkdir -p /data/docker
[root@xb-edu-dev-01 data]# vim /usr/lib/systemd/system/docker.service
*******************************************
ExecStart=/usr/bin/dockerd --graph /data/docker -H fd:// --containerd=/run/containerd/containerd.sock
*******************************************

8#启动和设置docker跟随操作系统一起启动服务

systemctl enable docker
systemctl daemon-reload
systemctl start docker

三、安装cephadm
1、HOSTS 文件中添加的内容, 解决无法访问下载cephadm

# GitHub 
140.82.113.4    github.com
199.232.28.133 githubusercontent.com
199.232.28.133 raw.githubusercontent.com
192.30.253.112 github.com
192.30.253.113 github.com
192.30.253.119 gist.github.com
192.30.255.112 github.com git
151.101.185.194 github.global.ssl.fastly.net
151.101.88.249 github.global.ssl.fastly.net
151.101.100.133 assets-cdn.github.com
151.101.100.133 raw.githubusercontent.com
185.31.16.184    github.global.ssl.fastly.net

52.74.223.119 github.com
192.30.253.119 gist.github.com
54.169.195.247 api.github.com
185.199.111.153 assets-cdn.github.com
151.101.76.133 raw.githubusercontent.com
151.101.108.133 user-images.githubusercontent.com
151.101.76.133 gist.githubusercontent.com
151.101.76.133 cloud.githu

你可能感兴趣的:(服务器)