4.4. 停止 Red Hat OpenStack Platform 服务
在 OpenShift (RHOSO)上启动 Red Hat OpenStack Services 前,您必须停止 Red Hat OpenStack Platform (RHOSP)服务,以避免为 data plane 采用数据不一致。不一致性是由数据库复制到新部署后资源更改造成的。
您不应该停止基础架构管理服务,例如:
- 数据库
- RabbitMQ
- HAProxy Load Balancer
- ceph-nfs
- 计算服务
- 容器化模块 libvirt 守护进程
- Object Storage 服务(swift)后端服务
先决条件
确保没有需要您计划停止的服务的长时间运行任务,如实例实时迁移、卷迁移、卷创建、备份和恢复、附加、分离和其他类似的操作:
$ openstack server list --all-projects -c ID -c Status |grep -E '\| .+ing \|' $ openstack volume list --all-projects -c ID -c Status |grep -E '\| .+ing \|'| grep -vi error $ openstack volume backup list --all-projects -c ID -c Status |grep -E '\| .+ing \|' | grep -vi error $ openstack share list --all-projects -c ID -c Status |grep -E '\| .+ing \|'| grep -vi error $ openstack image list -c ID -c Status |grep -E '\| .+ing \|'- 收集特定于服务拓扑的配置。如需更多信息,请参阅 检索特定于拓扑的服务配置。
定义以下 shell 变量:值是示例,引用单一节点独立 director Operator 部署。将这些示例值替换为适合您的环境的值:
CONTROLLER1_SSH="ssh -i <path to SSH key> root@<controller-1 IP>"1 CONTROLLER2_SSH="ssh -i <path to SSH key> root@<controller-2 IP>" CONTROLLER3_SSH="ssh -i <path to SSH key> root@<controller-3 IP>"指定所有 Controller 节点的 IP 地址,例如:
CONTROLLER1_SSH="ssh -i <path to SSH key> root@<controller-1 IP>"1 CONTROLLER2_SSH="ssh -i <path to SSH key> root@<controller-2 IP>" CONTROLLER3_SSH="ssh -i <path to SSH key> root@<controller-3 IP>" # ...
流程
如果您的部署通过 NFS 作为共享文件系统服务(manila)的后端启用 CephFS,请删除以下 Pacemaker 排序和共同定位约束,以管理
ceph-nfs服务和manila-share服务的虚拟 IP 地址:# check the co-location and ordering constraints concerning "manila-share" sudo pcs constraint list --full # remove these constraints sudo pcs constraint remove colocation-openstack-manila-share-ceph-nfs-INFINITY sudo pcs constraint remove order-ceph-nfs-openstack-manila-share-Optional禁用 RHOSP control plane 服务:
# Update the services list to be stopped ServicesToStop=("tripleo_aodh_api.service" "tripleo_aodh_api_cron.service" "tripleo_aodh_evaluator.service" "tripleo_aodh_listener.service" "tripleo_aodh_notifier.service" "tripleo_ceilometer_agent_central.service" "tripleo_ceilometer_agent_notification.service" "tripleo_octavia_api.service" "tripleo_octavia_health_manager.service" "tripleo_octavia_rsyslog.service" "tripleo_octavia_driver_agent.service" "tripleo_octavia_housekeeping.service" "tripleo_octavia_worker.service" "tripleo_horizon.service" "tripleo_keystone.service" "tripleo_barbican_api.service" "tripleo_barbican_worker.service" "tripleo_barbican_keystone_listener.service" "tripleo_cinder_api.service" "tripleo_cinder_api_cron.service" "tripleo_cinder_scheduler.service" "tripleo_cinder_volume.service" "tripleo_cinder_backup.service" "tripleo_collectd.service" "tripleo_glance_api.service" "tripleo_gnocchi_api.service" "tripleo_gnocchi_metricd.service" "tripleo_gnocchi_statsd.service" "tripleo_manila_api.service" "tripleo_manila_api_cron.service" "tripleo_manila_scheduler.service" "tripleo_neutron_api.service" "tripleo_placement_api.service" "tripleo_nova_api_cron.service" "tripleo_nova_api.service" "tripleo_nova_conductor.service" "tripleo_nova_metadata.service" "tripleo_nova_scheduler.service" "tripleo_nova_vnc_proxy.service" "tripleo_aodh_api.service" "tripleo_aodh_api_cron.service" "tripleo_aodh_evaluator.service" "tripleo_aodh_listener.service" "tripleo_aodh_notifier.service" "tripleo_ceilometer_agent_central.service" "tripleo_ceilometer_agent_compute.service" "tripleo_ceilometer_agent_ipmi.service" "tripleo_ceilometer_agent_notification.service" "tripleo_ovn_cluster_northd.service" "tripleo_ironic_neutron_agent.service" "tripleo_ironic_api.service" "tripleo_ironic_inspector.service" "tripleo_ironic_conductor.service") PacemakerResourcesToStop=("openstack-cinder-volume" "openstack-cinder-backup" "openstack-manila-share") echo "Stopping systemd OpenStack services" for service in ${ServicesToStop[*]}; do SSH_CMD=CONTROLLER_SSH if [ ! -z "${!SSH_CMD}" ]; then echo "Stopping the $service in controller $i" if ${!SSH_CMD} sudo systemctl is-active $service; then ${!SSH_CMD} sudo systemctl stop $service fi fi done echo "Checking systemd OpenStack services" for service in ${ServicesToStop[*]}; do for i in {1..3}; do SSH_CMD=CONTROLLER${i}_SSH if [ ! -z "${!SSH_CMD}" ]; then if ! ${!SSH_CMD} systemctl show $service | grep ActiveState=inactive >/dev/null; then echo "ERROR: Service $service still running on controller $i" else echo "OK: Service $service is not running on controller $i" fi fi done done echo "Stopping pacemaker OpenStack services" SSH_CMD=CONTROLLER_SSH if [ ! -z "${!SSH_CMD}" ]; then echo "Using controller $i to run pacemaker commands" for resource in ${PacemakerResourcesToStop[*]}; do if ${!SSH_CMD} sudo pcs resource config $resource &>/dev/null; then echo "Stopping $resource" ${!SSH_CMD} sudo pcs resource disable $resource else echo "Service $resource not present" fi break fi done echo "Checking pacemaker OpenStack services" SSH_CMD=CONTROLLER_SSH if [ ! -z "${!SSH_CMD}" ]; then echo "Using controller $i to run pacemaker commands" for resource in ${PacemakerResourcesToStop[*]}; do if ${!SSH_CMD} sudo pcs resource config $resource &>/dev/null; then if ! ${!SSH_CMD} sudo pcs resource status $resource | grep Started; then echo "OK: Service $resource is stopped" else echo "ERROR: Service $resource is started" fi fi done break fi如果每个服务的状态为
OK,则服务成功停止。