千家信息网

【ceph】Centos 7.1 安装Ceph

发表于:2025-01-24 作者:千家信息网编辑
千家信息网最后更新 2025年01月24日,一、环境介绍环境:三台Centos 7.1的主机角色IPadmin/node1192.168.209.100node2192.168.209.101node3192.168.209.102二、安装前准
千家信息网最后更新 2025年01月24日【ceph】Centos 7.1 安装Ceph

一、环境介绍

环境:三台Centos 7.1的主机

角色IP
admin/node1192.168.209.100
node2192.168.209.101
node3192.168.209.102

二、安装前准备(所有主机)

2.1 关闭防火墙和selinux

关闭 SELINUXsed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/configsetenforce 0关闭防火墙systemctl stop firewalld.service systemctl disable firewalld.service 

2.2 修改hosts文件

vi /etc/hosts192.168.209.100 admin192.168.209.100 node1192.168.209.101 node2192.168.209.102 node3测试:[root@localhost /]# ping node1PING node1 (192.168.209.100) 56(84) bytes of data.64 bytes from admin (192.168.209.100): icmp_seq=1 ttl=64 time=0.096 ms^C--- node1 ping statistics ---1 packets transmitted, 1 received, 0% packet loss, time 0msrtt min/avg/max/mdev = 0.096/0.096/0.096/0.000 ms[root@localhost /]# ping node2PING node2 (192.168.209.101) 56(84) bytes of data.64 bytes from node2 (192.168.209.101): icmp_seq=1 ttl=64 time=0.317 ms^C--- node2 ping statistics ---1 packets transmitted, 1 received, 0% packet loss, time 0msrtt min/avg/max/mdev = 0.317/0.317/0.317/0.000 ms[root@localhost /]# ping node3PING node3 (192.168.209.102) 56(84) bytes of data.64 bytes from node3 (192.168.209.102): icmp_seq=1 ttl=64 time=0.323 ms^C--- node3 ping statistics ---1 packets transmitted, 1 received, 0% packet loss, time 0msrtt min/avg/max/mdev = 0.323/0.323/0.323/0.000 ms[root@localhost /]# 

2.3 修改时区并安装NTP

修改时区cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime安装NTPyum -y install ntpsystemctl enable ntpdsystemctl start ntpdntpstat

2.4 安装epel仓库(重要,不安装可能后面安装ceph会失败)

rpm -Uvh https://dl.fedoraproject.org/pub/epel/7Server/x86_64/Packages/e/epel-release-7-11.noarch.rpm这个包在写这个博文的时候是可用的,过段时间可能会失效,如果失效了请大家按照这个路径去找,release的包,不一定是7-11的,不过没关系,安装了这个包之后,后面的安装一般没有问题。

2.5 添加ceph的yum源

添加之前请先确认mirrors.163.com/ceph/rpm-hammer/el7/x86_64/是否存在,如果不存在,那么需要修改一下网址vi ceph.repo[ceph]name=Ceph noarch packagesbaseurl=http://mirrors.163.com/ceph/rpm-hammer/el7/x86_64/enabled=1gpgcheck=1type=rpm-mdgpgkey=http://mirrors.163.com/ceph/keys/release.asc

三、安装ceph

3.1 安装ceph(admin)

yum -y update && yum -y install --release hammer ceph ceph-deploy

3.2 安装ceph(其余node)

yum -y update && yum -y install --release hammer ceph 

3.3 允许无密码 SSH 登录(admin)

生成密钥对(一路回车即可)ssh-keygen 将公钥拷贝到其余节点ssh-copy-id root@node1ssh-copy-id root@node2ssh-copy-id root@node3测试,ssh到各个节点,看是否需要输入密码

四、安装完成

验证安装效果命令行输入ceph按Tab键不齐,如果出现其余命令,则说明已经安装完成啦![root@localhost /]# cephceph                   ceph-dencoder          ceph-monceph-authtool          ceph-deploy            ceph-objectstore-toolceph-brag              ceph-disk              ceph-osdceph-client-debug      ceph-disk-activate     ceph-post-fileceph-clsinfo           ceph-disk-prepare      ceph-rbdnamerceph-conf              ceph-disk-udev         ceph-rest-apiceph-coverage          cephfs                 ceph-runceph-create-keys       cephfs-journal-tool    ceph-synceph-crush-location    cephfs-table-tool      ceph-debugpack         ceph-mds               [root@localhost /]# ceph
0