分布式存储系统之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
分布式存储系统之Ceph集群部署

文章插图
提示:从上面的输出信息可以看到该命令是从当前配置文件读取mon节点信息,然后初始化;我们在上面的new 命令里只有给了mon01,所以这里只初始化了mon01;并在当前目录生成了引导mds、mgr、osd、rgw和客户端连接ceph集群的管理员密钥;
6、拷贝配置文件和admin密钥到集群各节点
查看ceph-deploy admin的帮助
[cephadm@ceph-admin ceph-cluster]$ ceph-deploy admin --helpusage: ceph-deploy admin [-h] HOST [HOST ...]Push configuration and client.admin key to a remote host.positional arguments:HOSThost to configure for Ceph administrationoptional arguments:-h, --helpshow this help message and exit[cephadm@ceph-admin ceph-cluster]$提示:ceph-deploy admin命令主要作用是向指定的集群主机推送配置文件和客户端管理员密钥;以免得每次执行”ceph“命令行时不得不明确指定MON节点地址和ceph.client.admin.keyring;
[cephadm@ceph-admin ceph-cluster]$ ceph-deploy admin ceph-mon01 ceph-mon02 ceph-mon03 ceph-stor04 ceph-stor05提示:推送配置和管理员密钥我们只需要后面跟上对应集群主机即可,注意主机名要做对应的解析;这里还需要多说一句 , 配置文件是集群每个节点都需要推送的,但是管理密钥通常只需要推送给需要在对应主机上执行管理命令的主机上使用;所以ceph-deploy config命令就是用于专门推送配置文件,不推送管理密钥;
查看ceph-deploy config帮助
[cephadm@ceph-admin ceph-cluster]$ ceph-deploy config --helpusage: ceph-deploy config [-h] {push,pull} ...Copy ceph.conf to/from remote host(s)positional arguments:{push,pull}pushpush Ceph config file to one or more remote hostspullpull Ceph config file from one or more remote hostsoptional arguments:-h, --helpshow this help message and exit[cephadm@ceph-admin ceph-cluster]$ ceph-deploy config push --helpusage: ceph-deploy config push [-h] HOST [HOST ...]positional arguments:HOSThost(s) to push the config file tooptional arguments:-h, --helpshow this help message and exit[cephadm@ceph-admin ceph-cluster]$ ceph-deploy config pull --helpusage: ceph-deploy config pull [-h] HOST [HOST ...]positional arguments:HOSThost(s) to pull the config file fromoptional arguments:-h, --helpshow this help message and exit[cephadm@ceph-admin ceph-cluster]$提示:ceph-deploy config 有两个子命令,一个是push,表示把本机配置推送到对应指定的主机;pull表示把远端主机的配置拉去到本地;
验证:查看mon01主机上,对应配置文件和管理员密钥文件是否都推送过去了?
分布式存储系统之Ceph集群部署

文章插图
提示:可以看到对应配置文件和管理员密钥都推送到对应主机上,但是管理员密钥的权限对于cephadm是没有读权限;

推荐阅读