【ceph】Centos7.1安装Ceph
一、环境介绍
环境:三台Centos 7.1的主机
专注于为中小企业提供成都网站制作、做网站服务,电脑端+手机端+微信端的三站合一,更高效的管理,为中小企业鱼台免费做网站提供优质的服务。我们立足成都,凝聚了一批互联网行业人才,有力地推动了超过千家企业的稳健成长,帮助中小企业通过网站建设实现规模扩充和转变。
角色 | IP |
---|---|
admin/node1 | 192.168.209.100 |
node2 | 192.168.209.101 |
node3 | 192.168.209.102 |
二、安装前准备(所有主机)
2.1 关闭防火墙和selinux
关闭 SELINUX
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenforce 0
关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
2.2 修改hosts文件
vi /etc/hosts
192.168.209.100 admin
192.168.209.100 node1
192.168.209.101 node2
192.168.209.102 node3
测试:
[root@localhost /]# ping node1
PING 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 0ms
rtt min/avg/max/mdev = 0.096/0.096/0.096/0.000 ms
[root@localhost /]# ping node2
PING 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 0ms
rtt min/avg/max/mdev = 0.317/0.317/0.317/0.000 ms
[root@localhost /]# ping node3
PING 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 0ms
rtt 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
安装NTP
yum -y install ntp
systemctl enable ntpd
systemctl start ntpd
ntpstat
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 packages
baseurl=http://mirrors.163.com/ceph/rpm-hammer/el7/x86_64/
enabled=1
gpgcheck=1
type=rpm-md
gpgkey=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@node1
ssh-copy-id root@node2
ssh-copy-id root@node3
测试,ssh到各个节点,看是否需要输入密码
四、安装完成
验证安装效果
命令行输入ceph按Tab键不齐,如果出现其余命令,则说明已经安装完成啦!
[root@localhost /]# ceph
ceph ceph-dencoder ceph-mon
ceph-authtool ceph-deploy ceph-objectstore-tool
ceph-brag ceph-disk ceph-osd
ceph-client-debug ceph-disk-activate ceph-post-file
ceph-clsinfo ceph-disk-prepare ceph-rbdnamer
ceph-conf ceph-disk-udev ceph-rest-api
ceph-coverage cephfs ceph-run
ceph-create-keys cephfs-journal-tool ceph-syn
ceph-crush-location cephfs-table-tool
ceph-debugpack ceph-mds
[root@localhost /]# ceph
网页名称:【ceph】Centos7.1安装Ceph
分享链接:http://ybzwz.com/article/jccegd.html