3.2. 使用 Ceph Orchestrator 添加多个主机
您可以通过 Ceph Orchestrator 使用 YAML 文件格式的服务规格同时将多个主机添加到 Red Hat Ceph Storage 集群。
先决条件
- 一个正在运行的 Red Hat Ceph Storage 集群。
流程
创建
hosts.yaml
文件:示例
[root@host01 ~]# touch hosts.yaml
编辑
hosts.yaml
文件使其包含以下详情:示例
service_type: host addr: host01 hostname: host01 labels: - mon - osd - mgr --- service_type: host addr: host02 hostname: host02 labels: - mon - osd - mgr --- service_type: host addr: host03 hostname: host03 labels: - mon - osd
将 YAML 文件挂载到容器中的一个目录下:
示例
[root@host01 ~]# cephadm shell --mount hosts.yaml:/var/lib/ceph/hosts.yaml
进入该目录:
示例
[ceph: root@host01 /]# cd /var/lib/ceph/
使用服务规格部署主机:
语法
ceph orch apply -i FILE_NAME.yaml
示例
[ceph: root@host01 hosts]# ceph orch apply -i hosts.yaml
验证
列出主机:
示例
[ceph: root@host01 /]# ceph orch host ls
其它资源
- 请参阅 Red Hat Ceph Storage Operations Guide 中的使用 Ceph Orchestrator 列出主机。