sudo firewall-cmd --zone=public --add-service=ceph-mon --permanent # on monitors
sudo firewall-cmd --zone=public --add-service=ceph --permanent # on OSDs and MDSs
sudo firewall-cmd --reload
也可以直接关闭或禁用防火墙
1.9 安装yum插件
1
sudo yum install yum-plugin-priorities
Ensure that your package manager has priority/preferences packages installed and enabled. On CentOS, you may need to install EPEL. On RHEL, you may need to enable optional repositories.
2、部署ceph
2.1 创建部署目录
1 2 3 4
$ mkdir my-cluster $ cd my-cluster $ pwd /home/cephDeploy/my-cluster
$ ceph-deploy new ceph71 [ceph_deploy.conf][DEBUG ] found configuration file at: /home/cephDeploy/.cephdeploy.conf [ceph_deploy.cli][INFO ] Invoked (2.0.1): /usr/bin/ceph-deploy new ceph71 [ceph_deploy.cli][INFO ] ceph-deploy options: [ceph_deploy.cli][INFO ] username : None [ceph_deploy.cli][INFO ] func : <function new at 0x7f7f15a43e60> [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 0x7f7f151ba950> [ceph_deploy.cli][INFO ] cluster : ceph [ceph_deploy.cli][INFO ] ssh_copykey : True [ceph_deploy.cli][INFO ] mon : ['ceph71'] [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 [ceph71][DEBUG ] connection detected need for sudo [ceph71][DEBUG ] connected to host: ceph71 [ceph71][DEBUG ] detect platform information from remote host [ceph71][DEBUG ] detect machine type [ceph71][DEBUG ] find the location of an executable [ceph71][INFO ] Running command: sudo /usr/sbin/ip link show [ceph71][INFO ] Running command: sudo /usr/sbin/ip addr show [ceph71][DEBUG ] IP addresses found: [u'240e:f8:a903:2455:5054:ff:fe99:871', u'192.168.122.71', u'192.168.100.71'] [ceph_deploy.new][DEBUG ] Resolving host ceph71 [ceph_deploy.new][DEBUG ] Monitor ceph71 at 192.168.122.71 [ceph_deploy.new][DEBUG ] Monitor initial members are ['ceph71'] [ceph_deploy.new][DEBUG ] Monitor addrs are ['192.168.122.71'] [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...
2.3 指定网卡
由于我们这里的虚拟机每台都有两个网卡,因此我们需要指定ceph集群用于通信的网卡所在的网段
2.4 安装ceph
在所有的节点上都安装ceph
1
ceph-deploy install ceph71 ceph72 ceph73
初始化mon
1
ceph-deploy mon create-initial
顺利执行后会在当前目录下生成一系列相关的密钥文件
使用ceph-deploy复制配置文件和密钥
Use ceph-deploy to copy the configuration file and admin key to your admin node and your Ceph Nodes so that you can use the ceph CLI without having to specify the monitor address and ceph.client.admin.keyring each time you execute a command.