本文中,Ceph的集群规划为3台服务端节点和3台客户端节点。
若有外网条件则无需配置。
将OS对应的everything镜像源文件上传到服务器,通过SFTP工具将“openEuler-***-everything-aarch64-dvd.iso”上传到服务器上“/root”目录下。
1 2 |
mkdir -p /iso mount /root/openEuler-***-everything-aarch64-dvd.iso /iso |
1
|
vi /etc/yum.repos.d/openEuler.repo
|
1 2 3 4 5 6 |
[Base] name=Base baseurl=file:///iso enabled=1 gpgcheck=0 priority=1 |
wget https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/30/Everything/aarch64/os/Packages/c/compat-openssl10-1.0.2o-5.fc30.aarch64.rpm --no-check-certificate rpm -ivh compat-openssl10-1.0.2o-5.fc30.aarch64.rpm
关闭本节点防火墙,需在所有服务端节点和客户端节点依次执行如下命令。
1 2 3 |
systemctl stop firewalld systemctl disable firewalld systemctl status firewalld |
1
|
hostnamectl --static set-hostname ceph1 |
1
|
hostnamectl --static set-hostname client1 |
其余节点以此类推。
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 |
以上的IP地址仅为示例,需根据实际情况进行替换。可通过ip a命令查询实际IP地址。服务端节点主机名建议配置为ceph1~ceph3,客户端节点主机名建议配置为client1~client3。上述示例以3节点服务端和3节点客户端为例,根据实际节点数量调整。
1
|
yum -y install ntp ntpdate |
1
|
cd /etc && mv ntp.conf ntp.conf.bak |
1
|
vi /etc/ntp.conf
|
1 2 3 4 5 6 7 8 9 |
restrict 127.0.0.1 restrict ::1 restrict 192.168.3.0 mask 255.255.255.0 server 127.127.1.0 fudge 127.127.1.0 stratum 8 restrict default kod nomodify notrap nopeer noquery interface ignore wildcard interface listen x.x.x.x(此处为服务器的IP地址) |
其中,“restrict 192.168.3.0 mask 255.255.255.0”是ceph1所在的IP网段与掩码。
1
|
vi /etc/ntp.conf
|
1
|
server 192.168.3.166 |
1 2 3 |
systemctl start ntpd systemctl enable ntpd systemctl status ntpd |
1
|
ntpdate ceph1 |
1
|
hwclock -w |
1 2 3 4 |
yum install -y crontabs systemctl enable crond.service systemctl start crond crontab -e |
1
|
*/10 * * * * /usr/sbin/ntpdate 192.168.3.166 |
在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 |
1 2 3 |
ssh-keygen -t rsa ssh-copy-id ceph1 ssh-copy-id client1 |
输入第一条命令“ssh-keygen -t rsa”之后,按回车使用默认配置。
设置permissive模式,需在所有服务端节点和客户端节点执行。
1
|
setenforce permissive
|
1
|
vi /etc/selinux/config
|
修改SELINUX=permissive。