计算机名 角色 IP cephmaster1 管理节点 ,mon 192.168.10.40;192.168.20.40 cephmaster2 管理节点 192.168.10.41;192.168.20.41 cephnode1 osd 192.168.10.43;192.168.10.43 cephnode2 osd 192.168.10.44;192.168.10.44 cephnode3 osd 192.168.10.45;192.168.10.45 防火墙 Ceph Ceph-monitors 之间默认使用 6789 端口通信, OSD 之间默认用 6800:7300 这个范围内的端口通信。详情见网络配置参考。 Ceph OSD 能利用多个网络连接进行与客户端、Ceph-monitors、其他 OSD 间的复制和心跳的通信。 某些发行版(如 RHEL )的默认防火墙配置非常严格,你可能需要调整防火墙,允许相应的入站请求,这样客户端才能与 Ceph 节点上的守护进程通信。 对于 RHEL 7 上的 firewalld ,要对公共域开放 Ceph Ceph-monitors 使用的 6789 端口和 OSD 使用的 6800:7300 端口范围,并且要配置为永久规则,这样重启后规则仍有效 关闭防火墙 systemctl stop firewalld.service && systemctl disable firewalld.service 开放防火墙端口 firewall-cmd --zone=public --add-port=6789/tcp --permanent 关闭selinuix CentOS 和 RHEL 上, SELinux 默认为 Enforcing 开启状态。为简化安装,我们建议把 SELinux 设置为 Permissive 或者完全禁用,也就是在加固系统配置前先确保集群的安装、配置没问题。用下列命令把 SELinux 设置为disabled : sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config Iptables设置 若使用 iptables ,要开放 Ceph Ceph-monitors 使用的 6789 端口和 OSD 使用的 6800:7300 端口范围,命令如下: sudo iptables -A INPUT -i {iface} -p tcp -s {ip-address}/{netmask} --dport 6789 -j ACCEPT 在每个节点上配置好 iptables 之后要一定要保存,这样重启之后才依然有效。例如: /sbin/service iptables save 关闭Iptables iptables -F 来清除iptables策略 systemctl disable iptables.service && systemctl stop iptables.service 设置开机禁用和停止使用iptables服务 添加hosts 192.168.10.40 cephmaster1 192.168.10.41 cephmaster2 192.168.10.43 cephnode1 192.168.10.44 cephnode2 192.168.10.45 cephnode3 设置计算机名 hostnamectl set-hostname cephmaster1 添加yum源 下载yum配置文件到本地 删除所有的源 rm -rf /etc/yum.repos.d/* *下载Base源 curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo 下载epel源 curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo 添加ceph源 vi /etc/yum.repos.d/ceph.repo [Ceph] name=Ceph packages for $basearch baseurl=http://mirrors.aliyun.com/ceph/rpm-octopus/el7/$basearch enabled=1 gpgcheck=0 type=rpm-md

[Ceph-noarch] name=Ceph noarch packages baseurl=http://mirrors.aliyun.com/ceph/rpm-octopus/el7/noarch enabled=1 gpgcheck=0 type=rpm-md

[ceph-source] name=Ceph source packages baseurl=http://mirrors.aliyun.com/ceph/rpm-octopus/el7/SRPMS enabled=1 gpgcheck=0 type=rpm-md 关闭系统克隆虚拟机