ceph-nautilus
cat << EOM > /etc/yum.repos.d/ceph.repo
[ceph-noarch]
name=Ceph noarch packages
#baseurl=https://download.ceph.com/rpm-nautilus/el7/noarch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/ceph/rpm-nautilus/el7/noarch
enabled=1
gpgcheck=1
type=rpm-md
gpgkey=https://download.ceph.com/keys/release.asc
EOM
yum install ceph-deploy
所有机器需要同步时间
管理机器需要免密其它机器
192.168.31.100 xpc100
192.168.31.101 xpc101 管理节点
192.168.31.102 xpc102
192.168.31.103 xpc103
ceph node setup
yum install yum-plugin-priorities
ceph-deploy new xpc100
每个节点创建cephuser用户,设置sudo权限
# useradd -d /home/cephuser -m cephuser
# echo "cephuser"|passwd --stdin cephuser
# echo "cephuser ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/cephuser
# chmod 0440 /etc/sudoers.d/cephuser
# sed -i s'/Defaults requiretty/#Defaults requiretty'/g /etc/sudoers
fdisk -l /dev/sdb
sudo parted -s /dev/sdb mklabel gpt mkpart primary xfs 0% 100%
sudo mkfs.xfs /dev/sdb -f
sudo blkid -o value -s TYPE /dev/sdb
192.168.31.101 ceph-admin
192.168.31.100 ceph-node1
192.168.31.102 ceph-node2
192.168.31.103 ceph-node3
报错
[root@xpc101 /data/my-cluster]# ceph-deploy new xpc100
Traceback (most recent call last):
File "/usr/bin/ceph-deploy", line 18, in <module>
from ceph_deploy.cli import main
File "/usr/lib/python2.7/site-packages/ceph_deploy/cli.py", line 1, in <module>
import pkg_resources
ImportError: No module named pkg_resources
[root@xpc101 /data/my-cluster]#
#2. 安装
yum install python-pip
yum install python-wheel
#3. 更新到最新
/usr/bin/python2 -m pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple/
冗余输出
[root@xpc101 ~]# ceph-deploy new xpc100
[ceph_deploy.conf][DEBUG ] found configuration file at: /root/.cephdeploy.conf
[ceph_deploy.cli][INFO ] Invoked (2.0.1): /usr/bin/ceph-deploy new xpc100
[ceph_deploy.cli][INFO ] ceph-deploy options:
[ceph_deploy.cli][INFO ] username : None
[ceph_deploy.cli][INFO ] func : <function new at 0x7fc1488142a8>
[ceph_deploy.cli][INFO ] verbose : False
[ceph_deploy.cli][INFO ] overwrite_conf : False
[ceph_deploy.cli][INFO ] quiet : False
[ceph_deploy.cli][INFO ] cd_conf : <ceph_deploy.conf.cephdeploy.Conf instance at 0x7fc147f81a70>
[ceph_deploy.cli][INFO ] cluster : ceph
[ceph_deploy.cli][INFO ] ssh_copykey : True
[ceph_deploy.cli][INFO ] mon : ['xpc100']
[ceph_deploy.cli][INFO ] public_network : None
[ceph_deploy.cli][INFO ] ceph_conf : None
[ceph_deploy.cli][INFO ] cluster_network : None
[ceph_deploy.cli][INFO ] default_release : False
[ceph_deploy.cli][INFO ] fsid : None
[ceph_deploy.new][DEBUG ] Creating new cluster named ceph
[ceph_deploy.new][INFO ] making sure passwordless SSH succeeds
[xpc100][DEBUG ] connected to host: xpc101
[xpc100][INFO ] Running command: ssh -CT -o BatchMode=yes xpc100
[xpc100][DEBUG ] connected to host: xpc100
[xpc100][DEBUG ] detect platform information from remote host
[xpc100][DEBUG ] detect machine type
[xpc100][DEBUG ] find the location of an executable
[xpc100][INFO ] Running command: /usr/sbin/ip link show
[xpc100][INFO ] Running command: /usr/sbin/ip addr show
[xpc100][DEBUG ] IP addresses found: [u'192.168.31.100']
[ceph_deploy.new][DEBUG ] Resolving host xpc100
[ceph_deploy.new][DEBUG ] Monitor xpc100 at 192.168.31.100
[ceph_deploy.new][DEBUG ] Monitor initial members are ['xpc100']
[ceph_deploy.new][DEBUG ] Monitor addrs are ['192.168.31.100']
[ceph_deploy.new][DEBUG ] Creating a random mon key...
[ceph_deploy.new][DEBUG ] Writing monitor keyring to ceph.mon.keyring...
[ceph_deploy.new][DEBUG ] Writing initial config to ceph.conf...
[root@xpc101 ~]# ls
ceph.conf ceph-deploy-ceph.log ceph.mon.keyring
清空环境
[cephuser@ceph-admin ~/cluster]$
ceph-deploy purge ceph-node1 ceph-node2 ceph-node3
ceph-deploy purgedata ceph-node1 ceph-node2 ceph-node3
ceph-deploy forgetkeys
rm ceph.*
开始安装
ceph-deploy new ceph-node1 ceph-node2 ceph-node3
ceph-deploy install --repo-url https://mirrors.tuna.tsinghua.edu.cn/ceph/rpm-nautilus/el7/ --gpg-url https://mirrors.tuna.tsinghua.edu.cn/ceph/keys/release.asc ceph-node1 ceph-node2 ceph-node3