首先机器需要联网,并且配置网络yum源,epel源,可从阿里开源镜像站中下载源文件。
注:EPEL (Extra Packages for Enterprise Linux)是基于Fedora的一个项目,为“红帽系”的操作系统提供额外的软件包,适用于RHEL、CentOS和Scientific Linux.
网址:阿里云官方镜像站
例如:我所使用的是Centos7,接下来给对应版本的linux下载yum源,epel源。
具体操作如下:
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum makecache
不使用阿里云的ECS,就会出现Couldn’t resolve host 'mirrors.cloud.aliyuncs.com信息,但不影响其正常使用。
配置Ceph源
将其中这两项的路径写入到Ceph源文件,其目录内就是具体的软件包
# cat /etc/yum.repos.d/ceph.repo
[ceph]
name=ceph
baseurl=http://mirrors.aliyun.com/ceph/rpm-nautilus/el7/x86_64/
gpgcheck=0
priority=1
[ceph-noarch]
name=cephnoarch
baseurl=http://mirrors.aliyun.com/ceph/rpm-nautilus/el7/noarch/
gpgcheck=0
priority=1
[ceph-source]
name=Ceph source packages
baseurl=http://mirrors.aliyun.com/ceph/rpm-nautilus/el7/SRPMS
gpgcheck=0
priority=1
或者采用这一种办法:
[ceph]
name=ceph
baseurl=http://mirrors.aliyun.com/ceph/rpm-15.2.4/el7//x86_64/
gpgcheck=0
priority=1
[ceph-noarch]
name=cephnoarch
baseurl=http://mirrors.aliyun.com/ceph/rpm-15.2.4/el7//noarch/
gpgcheck=0
priority=1
[ceph-source]
name=Ceph source packages
baseurl=http://mirrors.aliyun.com/ceph/rpm-15.2.4/el7//SRPMS
gpgcheck=0
priority=1
注意:不建议采用最新版本进行安装,可以采用最新版本的次一个版本安装
安装epel-release及yum相关组件
yum -y install epel-release yum-plugin-priorities yum-utils
安装Ceph及相关组件
yum install -y ceph-deploy ceph ceph-radosgw snappy leveldb gdisk python-argparse gperftools-libs
查看ceph版本
ceph -v
问题:
执行ceph-deploy new node1
报错:
[ceph_deploy][ERROR ] File “/usr/lib/python2.7/site-packages/ceph_deploy/cli.py”, line 162, in _main
[ceph_deploy][ERROR ] return args.func(args)
[ceph_deploy][ERROR ] File “/usr/lib/python2.7/site-packages/ceph_deploy/new.py”, line 141, in new
[ceph_deploy][ERROR ] ssh_copy_keys(host, args.username)
[ceph_deploy][ERROR ] File “/usr/lib/python2.7/site-packages/ceph_deploy/new.py”, line 35, in ssh_copy_keys
[ceph_deploy][ERROR ] if ssh.can_connect_passwordless(hostname):
[ceph_deploy][ERROR ] File “/usr/lib/python2.7/site-packages/ceph_deploy/util/ssh.py”, line 15, in can_connect_passwordless
[ceph_deploy][ERROR ] if not remoto.connection.needs_ssh(hostname):
[ceph_deploy][ERROR ] AttributeError: ‘module’ object has no attribute ‘needs_ssh’
[ceph_deploy][ERROR ]
请检查ceph.repo文件是否无误,然后卸载重新安装,安装次一级的版本,别安装最新版本,也别安装老版本