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

验证:以cephadm用户远程集群节点,看看是否是免密登录

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

文章插图
提示:能够正常远程执行命令说明我们的免密登录就没有问题;
在admin host上安装ceph-deploy
[cephadm@ceph-admin ~]$ sudo yum update[cephadm@ceph-admin ~]$ sudo yum install ceph-deploy python-setuptools python2-subprocess32验证ceph-deploy是否成功安装
[cephadm@ceph-admin ~]$ ceph-deploy --version2.0.1[cephadm@ceph-admin ~]$提示:能够正常看到ceph-deploy的版本,说明ceph-deploy安装成功;
部署RADOS存储集群
1、在admin host以cephadm用户创建集群相关配置文件目录
[cephadm@ceph-admin ~]$ mkdir ceph-cluster[cephadm@ceph-admin ~]$ cd ceph-cluster[cephadm@ceph-admin ceph-cluster]$ pwd/home/cephadm/ceph-cluster[cephadm@ceph-admin ceph-cluster]$ 2、初始化第一个mon节点
[cephadm@ceph-admin ceph-cluster]$ ceph-deploy --helpusage: ceph-deploy [-h] [-v | -q] [--version] [--username USERNAME][--overwrite-conf] [--ceph-conf CEPH_CONF]COMMAND ...Easy Ceph deployment-^-/\|O o|ceph-deploy v2.0.1).-.('/|||\`| '|` |'|`Full documentation can be found at: http://ceph.com/ceph-deploy/docsoptional arguments:-h, --helpshow this help message and exit-v, --verbosebe more verbose-q, --quietbe less verbose--versionthe current installed version of ceph-deploy--username USERNAMEthe username to connect to the remote host--overwrite-confoverwrite an existing conf file on remote host (ifpresent)--ceph-conf CEPH_CONFuse (or reuse) a given ceph.conf filecommands:COMMANDdescriptionnewStart deploying a new cluster, and write aCLUSTER.conf and keyring for it.installInstall Ceph packages on remote hosts.rgwCeph RGW daemon managementmgrCeph MGR daemon managementmdsCeph MDS daemon managementmonCeph MON Daemon managementgatherkeysGather authentication keys for provisioning new nodes.diskManage disks on a remote host.osdPrepare a data disk on remote host.repoRepo definition managementadminPush configuration and client.admin key to a remotehost.configCopy ceph.conf to/from remote host(s)uninstallRemove Ceph packages from remote hosts.purgedataPurge (delete, destroy, discard, shred) any Ceph datafrom /var/lib/cephpurgeRemove Ceph packages from remote hosts and purge alldata.forgetkeysRemove authentication keys from the local directory.pkgManage packages on remote hosts.calamariInstall and configure Calamari nodes. Assumes that arepository with Calamari packages is alreadyconfigured. Refer to the docs for examples(http://ceph.com/ceph-deploy/docs/conf.html)See 'ceph-deploy <command> --help' for help on a specific command[cephadm@ceph-admin ceph-cluster]$提示:我们通过查看ceph-deploy 的帮助可以知道 它的子命令new就是创建一个集群配置和生成一个keyring文件;
查看ceph-deploy new的用法
[cephadm@ceph-admin ceph-cluster]$ ceph-deploy new --helpusage: ceph-deploy new [-h] [--no-ssh-copykey] [--fsid FSID][--cluster-network CLUSTER_NETWORK][--public-network PUBLIC_NETWORK]MON [MON ...]Start deploying a new cluster, and write a CLUSTER.conf and keyring for it.positional arguments:MONinitial monitor hostname, fqdn, or hostname:fqdn pairoptional arguments:-h, --helpshow this help message and exit--no-ssh-copykeydo not attempt to copy SSH keys--fsid FSIDprovide an alternate FSID for ceph.conf generation--cluster-network CLUSTER_NETWORKspecify the (internal) cluster network--public-network PUBLIC_NETWORKspecify the public network for a cluster[cephadm@ceph-admin ceph-cluster]$提示:ceph-deploy new的命令格式 我们只需要对应节点的主机名即可;但是前提是对应主机名做了正确的解析;
[cephadm@ceph-admin ceph-cluster]$ ceph-deploy new ceph-mon01[ceph_deploy.conf][DEBUG ] found configuration file at: /home/cephadm/.cephdeploy.conf[ceph_deploy.cli][INFO] Invoked (2.0.1): /bin/ceph-deploy new ceph-mon01[ceph_deploy.cli][INFO] ceph-deploy options:[ceph_deploy.cli][INFO]username: None[ceph_deploy.cli][INFO]func: <function new at 0x7f0660799ed8>[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 0x7f065ff11b48>[ceph_deploy.cli][INFO]cluster: ceph[ceph_deploy.cli][INFO]ssh_copykey: True[ceph_deploy.cli][INFO]mon: ['ceph-mon01'][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[ceph-mon01][DEBUG ] connected to host: ceph-admin.ilinux.io[ceph-mon01][INFO] Running command: ssh -CT -o BatchMode=yes ceph-mon01[ceph-mon01][DEBUG ] connection detected need for sudo[ceph-mon01][DEBUG ] connected to host: ceph-mon01[ceph-mon01][DEBUG ] detect platform information from remote host[ceph-mon01][DEBUG ] detect machine type[ceph-mon01][DEBUG ] find the location of an executable[ceph-mon01][INFO] Running command: sudo /usr/sbin/ip link show[ceph-mon01][INFO] Running command: sudo /usr/sbin/ip addr show[ceph-mon01][DEBUG ] IP addresses found: [u'172.16.30.71', u'192.168.0.71'][ceph_deploy.new][DEBUG ] Resolving host ceph-mon01[ceph_deploy.new][DEBUG ] Monitor ceph-mon01 at 192.168.0.71[ceph_deploy.new][DEBUG ] Monitor initial members are ['ceph-mon01'][ceph_deploy.new][DEBUG ] Monitor addrs are ['192.168.0.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...[cephadm@ceph-admin ceph-cluster]$

经验总结扩展阅读