Menu Close
4.3. 配置 Ansible 组
此过程仅与使用 Ansible 部署 Ceph 相关。ceph-ansible
软件包已配置了默认的 osds
组。如果集群只有一个用例和存储策略,请按照《Red Hat Ceph Storage 安装指南》的"安装 Red Hat Ceph Storage Cluster "一节中记录的步骤进行操作。如果集群支持多个用例和存储策略,请为每个集群创建一个组。每个用例都应将 /usr/share/ceph-ansible/group_vars/osd.sample
复制到为组名称命名的文件中。例如,如果存储集群具有 IOPS 优化、吞吐量优化和容量优化的用例,请为每个用例创建单独的文件来代表组:
cd /usr/share/ceph-ansible/group_vars/ cp osds.sample osds-iops cp osds.sample osds-throughput cp osds.sample osds-capacity
然后,根据用例配置每个文件。
配置组变量文件后,编辑 site.yml
文件以确保其包含每个新组。例如:
- hosts: osds-iops gather_facts: false become: True roles: - ceph-osd - hosts: osds-throughput gather_facts: false become: True roles: - ceph-osd - hosts: osds-capacity gather_facts: false become: True roles: - ceph-osd
最后,在 /etc/ansible/hosts
文件中,将 OSD 节点放在对应的组名下。例如:
[osds-iops] <ceph-host-name> devices="[ '<device_1>', '<device_2>' ]" [osds-throughput] <ceph-host-name> devices="[ '<device_1>', '<device_2>' ]" [osds-capacity] <ceph-host-name> devices="[ '<device_1>', '<device_2>' ]"