文章目录
一、环境准备
各节点IP分配如下表:
操作系统 | 主机名 | VM网段IP | NAT网段IP | 硬盘规划 | 内存 | CPU |
---|---|---|---|---|---|---|
Centos 7 | ceph01 | 192.168.100.101 | 192.168.11.134 | 20G+1024G | 4G | 双核双线程 |
Centos 7 | ceph02 | 192.168.100.102 | 192.168.11.135 | 20G+1024G | 4G | 双核双线程 |
Centos 7 | ceph03 | 192.168.100.103 | 192.168.11.136 | 20G+1024G | 4G | 双核双线程 |
1、主机名
#三个节点分别配置主机名
[root@localhost ~]# hostnamectl set-hostname ceph01
[root@localhost ~]# hostnamectl set-hostname ceph02
[root@localhost ~]# hostnamectl set-hostname ceph03
2、关闭防火墙、核心防护
#三个节点均需要操作,以ceph01为例
[root@ceph01 ~]# systemctl stop firewalld
[root@ceph01 ~]# systemctl disable firewalld
[root@ceph01 ~]# setenforce 0
[root@ceph01 ~]# sed -i '7s/enforcing/disabled/' /etc/selinux/config
3、配置hosts
#三个节点均需要操作,以ceph01为例
[root@ceph01 ~]# vim /etc/hosts
192.168.100.101 ceph01
192.168.100.102 ceph02
192.168.100.103 ceph03
4、创建免交互
#三个节点均需要操作,以ceph01为例
[root@ceph01 ~]# ssh-keygen
[root@ceph01 ~]# ssh-copy-id root@ceph01
[root@ceph01 ~]# ssh-copy-id root@ceph02
[root@ceph01 ~]# ssh-copy-id root@ceph03
#免交互登录测试
5、配置YUM源
#三个节点均需要操作,以ceph01为例
[root@ceph01 ~]# vim /etc/yum.conf
keepcache=1 //开启缓存 三个节点都改
[root@ceph01 ~]# yum -y install wget curl net-tools bash-completion //安装wget curl net-tools bash-completion
[root@ceph01 ~]# cd /etc/yum.repos.d/
[root@ceph01 yum.repos.d]# mkdir backup
[root@ceph01 yum.repos.d]# mv C* backup
[root@ceph01 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@ceph01 yum.repos.d]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
[root@ceph01 yum.repos.d]# cat << EOF > /etc/yum.repos.d/ceph.repo
[ceph]
name=Ceph packages for
baseurl=https://mirrors.aliyun.com/ceph/rpm-mimic/el7/$basearch
enabled=1
gpgcheck=1
type=rpm-md
gpgkey=https://mirrors.aliyun.com/ceph/keys/release.asc
priority=1
[ceph-noarch]
name=Ceph noarch packages
baseurl=https://mirrors.aliyun.com/ceph