配置部署环境

本文档中,不同操作系统下的操作若有不同,会进行说明区分,若未说明,则该操作在两个操作系统下一致。
关闭SMMU
在部署Ceph前请关闭SMMU,以防其对Ceph性能造成影响。
配置主机名
- 配置永久静态主机名,主机配置为ceph1~ceph3,客户机配置为client1~client3。
- 修改域名解析文件。
1
vi /etc/hosts
在各个集群和客户端节点的“/etc/hosts”中添加如下内容:1 2 3 4 5 6
192.168.3.166 ceph1 192.168.3.167 ceph2 192.168.3.168 ceph3 192.168.3.160 client1 192.168.3.161 client2 192.168.3.162 client3
配置免密登录
需配置ceph1节点对所有主/客户机节点的免密(包括ceph1本身),此外需要配置client1节点对所有主/客户机节点的免密(包括client1本身)。
- 在ceph1节点生成公钥,并发放到各个主机/客户机节点。
1 2 3
ssh-keygen -t rsa for i in {1..3}; do ssh-copy-id ceph$i; done for i in {1..3}; do ssh-copy-id client$i; done
输入第一条命令“ssh-keygen -t rsa”之后,按回车使用默认配置。
- 在client1节点生成公钥,并发放到各个主机/客户机节点。
1 2 3
ssh-keygen -t rsa for i in {1..3}; do ssh-copy-id ceph$i; done for i in {1..3}; do ssh-copy-id client$i; done
输入第一条命令“ssh-keygen -t rsa”之后,按回车使用默认配置。
关闭防火墙
关闭本节点防火墙,需在所有Ceph节点和Client节点依次执行如下命令。
1 2 3 |
systemctl stop firewalld systemctl disable firewalld systemctl status firewalld |
设置permissive模式
设置permissive模式,需在所有主客户机节点执行。
- 临时修改,下次重启自动失效,与下一条互补。
1
setenforce permissive
- 永久设置,下次重启自动生效。
1
vi /etc/selinux/config
修改SELINUX=permissive
配置repo源
本文档提供在线和离线两种repo源的安装方式,推荐使用在线安装方式。
方法一:在线方式安装
- 在所有集群和客户端节点建立ceph.repo。
1
vi /etc/yum.repos.d/ceph.repo
并加入如下内容:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
[Ceph] name=Ceph packages for $basearch baseurl=http://download.ceph.com/rpm-nautilus/el7/$basearch enabled=1 gpgcheck=1 type=rpm-md gpgkey=https://download.ceph.com/keys/release.asc priority=1 [Ceph-noarch] name=Ceph noarch packages baseurl=http://download.ceph.com/rpm-nautilus/el7/noarch enabled=1 gpgcheck=1 type=rpm-md gpgkey=https://download.ceph.com/keys/release.asc priority=1 [ceph-source] name=Ceph source packages baseurl=http://download.ceph.com/rpm-nautilus/el7/SRPMS enabled=1 gpgcheck=1 type=rpm-md gpgkey=https://download.ceph.com/keys/release.asc priority=1
- 更新yum源。
1
yum clean all && yum makecache
- 安装epel源。(openEuler系统下无需操作此步骤,请跳过。)
1
yum -y install epel-release
- 修改所有节点
代理 配置。1
vim /etc/environment
添加如下内容使其支持相关依赖包的安装:
1 2 3 4
export http_proxy=http://{Proxy-User-Name}:{Proxy-Password}@<Proxy-Server-IP-Address>:<Proxy-Port> export https_proxy= http://{Proxy-User-Name}:{Proxy-Password}@<Proxy-Server-IP-Address>:<Proxy-Port> export ftp_proxy= http://{Proxy-User-Name}:{Proxy-Password}@<Proxy-Server-IP-Address>:<Proxy-Port> export no_proxy=127.0.0.1,localhost
方法二:离线方式安装
集群中所有节点均需配置repo源,分别在各个节点进行如下操作。
- 将source.zip传到“/home”目录后进入该目录。
1
cd /home
- 解压。
1
unzip source.zip
- 安装createrepo。
1
yum install -y createrepo/*.rpm
- 创建本地源。
1 2
cd /home/local_source createrepo .
- 进入“yum.repo.d”目录。
1
cd /home/yum.repo.d
- 将系统自带repo文件备份移除。
1 2
mkdir bak mv *.repo bak
- 创建repo文件。
1
vi local.repo
添加如下内容:1 2 3 4 5
[local] name=local baseurl=file:///home/local_source enabled=1 gpgcheck=0
编译python-enum34软件包

编译python-enum34软件包的操作仅需在openEuler操作系统下进行,CentOS操作系统请跳过此部分内容。
以下操作需要在所有节点进行。
- 下载源码及补丁。
1
git clone –b openEuler-20.03-LTS-SP1 https://gitee.com/src-openeuler/python-enum34.git
- 将源码包移动到“/root/rpmbuild/SOURCES”目录下。
1
mv enum34-1.1.6.tar.gz /root/rpmbuild/SOURCES
- 修改spec文件。
1
vim python-enum34.spec
将第42行的“%files -n python2-%{_name}”改为“%files -n python-%{_name}”。
- 编译软件包。
1 2
mv python-enum34.spec /root/rpmbuild/SPECS/ rpmbuild -bb /root/rpmbuild/SPECS/python-enum34.spec
- 将编译好的rpm包移动到指定文件夹。
1 2
mkdir -p /home/rpm/local cp -r /root/rpmbuild/RPMS/* /home/rpm/local/
- 获取liboath软件包并制作repo源。
1 2 3 4 5 6
cd /home/rpm/local wget http://mirrors.tools.huawei.com/openeuler/openEuler-21.03/everything/aarch64/Packages/liboath-2.6.5-2.oe1.aarch64.rpm wget http://mirrors.tools.huawei.com/openeuler/openEuler-21.03/everything/aarch64/Packages/liboath-devel-2.6.5-2.oe1.aarch64.rpm wget http://mirrors.tools.huawei.com/openeuler/openEuler-21.03/everything/aarch64/Packages/liboath-doc-2.6.5-2.oe1.noarch.rpm yum install -y createrepo cd /home/rpm/local & createrepo .
- 配置repo文件。
1
vim /etc/yum.repos.d/local.repo
文件中加入以下内容:
1 2 3 4 5 6
[local-rpm] name=local-rpm baseurl=file:///home/rpm/local enabled=1 gpgcheck=0 priority=1
- 清理yum缓存。
1
yum clean all && yum makecache