24.2. 将 OSD 从 FileStore 迁移到 BlueStore
要从 FileStore 迁移到 BlueStore,director 使用 Ansible 删除并重新创建节点上的所有 OSD。director 在迁移过程前执行容量检查。最后,director 使用 BlueStore 后端重新定义 OSD。
先决条件
一个正常运行的 Red Hat Ceph Storage (RHCS) 4 集群。您可以通过在 Controller 或 Standalone Ceph MON 节点上的 ceph MON 容器中输入以下命令来检查集群:
podman exec -it ceph-mon-overcloud-controller-1 sh -c "ceph -s"
[root@overcloud-controller-1 ~]# podman exec -it ceph-mon-overcloud-controller-1 sh -c "ceph -s"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
流程
确保
CephAnsibleDisksConfig
参数中的osd_objectstore
不默认为filestore
。如果任何自定义 heat 环境文件中存在osd_objectstore
参数,则必须明确定义bluestore
的值。Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注意如果您使用任何特定的 FileStore 配置,例如日志,请确保相应地更新配置。有关高级配置的更多信息,请参阅 Deploying an overcloud with containerized Red Hat Ceph 指南中的 Mapping the Ceph Storage Node Disk Layout。
-
以
stack
用户的身份登录 undercloud。 使用
ceph_fstobs
标签输入openstack overcloud external-upgrade run
命令。将<NODE_NAME
> 替换为您要升级的 Ceph OSD 节点的名称。您可以使用openstack server list
命令查找节点名称。[stack@undercloud ~] $ openstack overcloud external-upgrade run --tags ceph_fstobs -e ceph_ansible_limit=<NODE_NAME> | tee oc-fstobs.log
[stack@undercloud ~] $ openstack overcloud external-upgrade run --tags ceph_fstobs -e ceph_ansible_limit=<NODE_NAME> | tee oc-fstobs.log
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 登录具有 Ceph MON 服务的节点,并查询 Ceph 集群来检查您升级的节点 OSD 的状态。在开始迁移下一个 OSD 节点前,您必须确保您已成功迁移升级:
sudo -i podman exec -it ceph-mon-overcloud-controller-1 sh -c "ceph -f json osd metadata" | jq -c '.[] | select(.hostname == "<NODE_NAME>") | ["host", .hostname, "osd_id", .id, "objectstore", .osd_objectstore]' exit
[heat-admin@overcloud-controller-1 ~]$ sudo -i [root@overcloud-controller-1 ~]# podman exec -it ceph-mon-overcloud-controller-1 sh -c "ceph -f json osd metadata" | jq -c '.[] | select(.hostname == "<NODE_NAME>") | ["host", .hostname, "osd_id", .id, "objectstore", .osd_objectstore]' [root@overcloud-controller-1 ~]# exit
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将 <NODE_NAME> 替换为迁移的节点的名称。如果结果显示 OSD 使用 BlueStore,则其迁移成功。
可选: 要查看特定 OSD 的更多详情,请输入以下命令:
podman exec -it ceph-mon-overcloud-controller-1 sh -c "ceph osd metadata <ID>"
[root@overcloud-controller-1 ~]# podman exec -it ceph-mon-overcloud-controller-1 sh -c "ceph osd metadata <ID>"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将 <ID> 替换为您要查询的 OSD 的 ID。
在下一个节点上启动迁移过程前,您必须等待集群同步。
podman exec -it ceph-mon-overcloud-controller-1 sh -c "ceph -s"
[root@overcloud-controller-1 ~]# podman exec -it ceph-mon-overcloud-controller-1 sh -c "ceph -s"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Review the command output and ensure that the health of the cluster is `HEALTH_OK` and the PGs are in the `active+clean` state.
Review the command output and ensure that the health of the cluster is `HEALTH_OK` and the PGs are in the `active+clean` state.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在下一个节点上启动迁移过程前,您必须等待集群重新平衡过程完成。要遵循状态,请运行以下命令:
sudo podman exec ceph-mon-<NODE_NAME> ceph -w
[heat-admin@overcloud-controller-0 ~]$ sudo podman exec ceph-mon-<NODE_NAME> ceph -w
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将 <NODE_NAME> 替换为迁移的节点的名称。
- 为存储集群中的每个节点重复迁移过程。
有关从 FileStore 迁移到 BlueStore 的更多信息,请参阅 Red Hat Ceph Storage 管理指南中的 BlueStore。