分布式存储系统之Ceph集群部署( 四 )

提示:我们可以在命令行使用--public-network 选项来指定集群公共网络和使用--cluster-network选项来指定对应集群网络;当然也可以生成好配置文件,然后在配置文件里修改也行;
3、修改配置文件指定集群的公共网络和集群网络

分布式存储系统之Ceph集群部署

文章插图
提示:编辑生成的ceph.conf配置文件,在【global】配置段中设置ceph集群面向客户端通信的网络ip地址所在公网网络地址和面向集群各节点通信的网络ip地址所在集群网络地址,如上所示;
4、安装ceph集群
[cephadm@ceph-admin ceph-cluster]$ ceph-deploy install ceph-mon01 ceph-mon02 ceph-mon03 ceph-mgr01 ceph-mgr02提示:ceph-deploy命令能够以远程的方式连入Ceph集群各节点完成程序包安装等操作,所以我们只需要告诉ceph-deploy 那些主机需要安装即可;
集群各主机如果需要独立安装ceph程序包,方法如下
yum install ceph ceph-radosgw提示:前提是该主机基础环境都配置好了,比如关闭iptables或firewalld,同步时间,ssh免密登录,关闭selinux等;重要的是对应ceph的yum仓库配置和epel仓库配置都已经正常配置;
分布式存储系统之Ceph集群部署

文章插图
提示:这里提示我们没有安装applydeltarpm;
查找applydeltarpm安装包
分布式存储系统之Ceph集群部署

文章插图
在集群各节点安装deltarpm包来解决上述报错
yum install -y deltarpm-3.6-3.el7.x86_64再次在admin host上用ceph-deploy安装ceph集群
分布式存储系统之Ceph集群部署

文章插图
提示:这里告诉我们没有presto元数据;解决办法清除所有yum缓存,重新生成缓存;
yum clean all && yum makecache提示:以上操作都需要在集群各节点上操作;
再次在admin host上用ceph-deploy安装ceph集群
 
分布式存储系统之Ceph集群部署

文章插图
提示:如果在最后能够看到ceph的版本,说明我们指定的节点都已经安装好对应ceph集群所需的程序包了;
5、配置初始MON节点,并收集所有密钥
查看ceph-deploy mon帮助
[cephadm@ceph-admin ceph-cluster]$ ceph-deploy mon --helpusage: ceph-deploy mon [-h] {add,create,create-initial,destroy} ...Ceph MON Daemon managementpositional arguments:{add,create,create-initial,destroy}addAdd a monitor to an existing cluster:ceph-deploy mon add node1Or:ceph-deploy mon add --address 192.168.1.10 node1If the section for the monitor exists and defines a `mon addr` thatwill be used, otherwise it will fallback by resolving the hostname to anIP. If `--address` is used it will override all other options.createDeploy monitors by specifying them like:ceph-deploy mon create node1 node2 node3If no hosts are passed it will default to use the`mon initial members` defined in the configuration.create-initialWill deploy for monitors defined in `mon initialmembers`, wait until they form quorum and thengatherkeys, reporting the monitor status along theprocess. If monitors don't form quorum the commandwill eventually time out.destroyCompletely remove Ceph MON from remote host(s)optional arguments:-h, --helpshow this help message and exit[cephadm@ceph-admin ceph-cluster]$提示:add 是添加mon节点,create是创建一个mon节点,但不初始化,如果要初始化需要在对应节点的配置文件中定义配置mon成员;create-initial是创建并初始化mon成员;destroy是销毁一个mon移除mon节点;
初始化mon节点
[cephadm@ceph-admin ceph-cluster]$ ceph-deploy mon create-initial

经验总结扩展阅读