> CentOS > CentOS教程 >

CentOS 7.2 Ceph 安装

今天刚好在红帽官方网站看到Ceph安装文档,我顺便动手测试一下。

参考文档

红帽官方Ceph安装文档

Ceph installation on CentOS 7.2

Install Ceph Infernalis(v9.2.0) in CentOS 7.2

 

管理节点

对于分布式文件系统,都是需要同步时间。而且这点经常由于忽略导致大问题。

yum install ntp
systemctl start ntpd
systemctl enable ntpd

设置FQDN

hostnamectl set-hostname ceph-admin.chenshake.com

设置 /etc/hosts

cat << EOF >> /etc/hosts
192.168.1.120   ceph-admin.chenshake.com          ceph-admin
192.168.1.121   ceph-monitor1.chenshake.com       ceph-monitor1
192.168.1.122   ceph-monitor2.chenshake.com       ceph-monitor2
192.168.1.123   ceph-node1.chenshake.com          ceph-node1
192.168.1.124   ceph-node2.chenshake.com          ceph-node2
192.168.1.125   ceph-node3.chenshake.com          ceph-node3
EOF

Cephuser 账号

groupadd -g 2000 cephgroup
useradd -c "ceph user" -g cephgroup -u 2000 cephuser
echo "cephuser:shake-pass" | chpasswd

sudo和tty

cat << EOF >/etc/sudoers.d/cephuser
cephuser ALL = (root) NOPASSWD:ALL
Defaults:cephuser !requiretty
EOF
chmod 0440 /etc/sudoers.d/cephuser

 

SSH (admin only)

创建ssh秘钥分发到所有节点上

su - cephuser
ssh-keygen -t rsa
cp -p .ssh/id_rsa.pub .ssh/authorized_keys
for H in ceph-monitor1 ceph-monitor2 ceph-node1 ceph-node2 ceph-node3 ; do scp -rp .ssh $H:. ; done




(责任编辑:IT)