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


分布式存储系统之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是没有读权限;
设置管理员密钥能够被cephadm用户有读权限
分布式存储系统之Ceph集群部署

文章插图
提示:上述设置权限的命令需要在每个节点都要设置;
7、配置Manager节点,启动ceph-mgr进程(仅Luminious+版本)
查看ceph-deploy mgr帮助
[cephadm@ceph-admin ceph-cluster]$ ceph-deploy mgr --helpusage: ceph-deploy mgr [-h] {create} ...Ceph MGR daemon managementpositional arguments:{create}createDeploy Ceph MGR on remote host(s)optional arguments:-h, --helpshow this help message and exit[cephadm@ceph-admin ceph-cluster]$提示:mgr子命令就只有一个create命令用于部署mgr;
[cephadm@ceph-admin ceph-cluster]$ ceph-deploy mgr create ceph-mgr01 ceph-mgr02[ceph_deploy.conf][DEBUG ] found configuration file at: /home/cephadm/.cephdeploy.conf[ceph_deploy.cli][INFO] Invoked (2.0.1): /bin/ceph-deploy mgr create ceph-mgr01 ceph-mgr02[ceph_deploy.cli][INFO] ceph-deploy options:[ceph_deploy.cli][INFO]username: None[ceph_deploy.cli][INFO]verbose: False[ceph_deploy.cli][INFO]mgr: [('ceph-mgr01', 'ceph-mgr01'), ('ceph-mgr02', 'ceph-mgr02')][ceph_deploy.cli][INFO]overwrite_conf: False[ceph_deploy.cli][INFO]subcommand: create[ceph_deploy.cli][INFO]quiet: False[ceph_deploy.cli][INFO]cd_conf: <ceph_deploy.conf.cephdeploy.Conf instance at 0x7f58a0514950>[ceph_deploy.cli][INFO]cluster: ceph[ceph_deploy.cli][INFO]func: <function mgr at 0x7f58a0d8d230>[ceph_deploy.cli][INFO]ceph_conf: None[ceph_deploy.cli][INFO]default_release: False[ceph_deploy.mgr][DEBUG ] Deploying mgr, cluster ceph hosts ceph-mgr01:ceph-mgr01 ceph-mgr02:ceph-mgr02[ceph-mgr01][DEBUG ] connection detected need for sudo[ceph-mgr01][DEBUG ] connected to host: ceph-mgr01[ceph-mgr01][DEBUG ] detect platform information from remote host[ceph-mgr01][DEBUG ] detect machine type[ceph_deploy.mgr][INFO] Distro info: CentOS Linux 7.9.2009 Core[ceph_deploy.mgr][DEBUG ] remote host will use systemd[ceph_deploy.mgr][DEBUG ] deploying mgr bootstrap to ceph-mgr01[ceph-mgr01][DEBUG ] write cluster configuration to /etc/ceph/{cluster}.conf[ceph-mgr01][WARNIN] mgr keyring does not exist yet, creating one[ceph-mgr01][DEBUG ] create a keyring file[ceph-mgr01][DEBUG ] create path recursively if it doesn't exist[ceph-mgr01][INFO] Running command: sudo ceph --cluster ceph --name client.bootstrap-mgr --keyring /var/lib/ceph/bootstrap-mgr/ceph.keyring auth get-or-create mgr.ceph-mgr01 mon allow profile mgr osd allow * mds allow * -o /var/lib/ceph/mgr/ceph-ceph-mgr01/keyring[ceph-mgr01][INFO] Running command: sudo systemctl enable ceph-mgr@ceph-mgr01[ceph-mgr01][WARNIN] Created symlink from /etc/systemd/system/ceph-mgr.target.wants/ceph-mgr@ceph-mgr01.service to /usr/lib/systemd/system/ceph-mgr@.service.[ceph-mgr01][INFO] Running command: sudo systemctl start ceph-mgr@ceph-mgr01[ceph-mgr01][INFO] Running command: sudo systemctl enable ceph.target[ceph-mgr02][DEBUG ] connection detected need for sudo[ceph-mgr02][DEBUG ] connected to host: ceph-mgr02[ceph-mgr02][DEBUG ] detect platform information from remote host[ceph-mgr02][DEBUG ] detect machine type[ceph_deploy.mgr][INFO] Distro info: CentOS Linux 7.9.2009 Core[ceph_deploy.mgr][DEBUG ] remote host will use systemd[ceph_deploy.mgr][DEBUG ] deploying mgr bootstrap to ceph-mgr02[ceph-mgr02][DEBUG ] write cluster configuration to /etc/ceph/{cluster}.conf[ceph-mgr02][WARNIN] mgr keyring does not exist yet, creating one[ceph-mgr02][DEBUG ] create a keyring file[ceph-mgr02][DEBUG ] create path recursively if it doesn't exist[ceph-mgr02][INFO] Running command: sudo ceph --cluster ceph --name client.bootstrap-mgr --keyring /var/lib/ceph/bootstrap-mgr/ceph.keyring auth get-or-create mgr.ceph-mgr02 mon allow profile mgr osd allow * mds allow * -o /var/lib/ceph/mgr/ceph-ceph-mgr02/keyring[ceph-mgr02][INFO] Running command: sudo systemctl enable ceph-mgr@ceph-mgr02[ceph-mgr02][WARNIN] Created symlink from /etc/systemd/system/ceph-mgr.target.wants/ceph-mgr@ceph-mgr02.service to /usr/lib/systemd/system/ceph-mgr@.service.[ceph-mgr02][INFO] Running command: sudo systemctl start ceph-mgr@ceph-mgr02[ceph-mgr02][INFO] Running command: sudo systemctl enable ceph.target[cephadm@ceph-admin ceph-cluster]$

经验总结扩展阅读