简体   繁体   English

从 kolla-ansible 中删除以前部署的服务的正确方法是什么

[英]What is the proper way to remove a previously deployed service from kolla-ansible

I have a recently deployed kolla-ansible stable/victoria with several services I wanted to try but no longer need (designate, octavia, etc.) What is the "right" way to remove these services?我最近部署了一个 kolla-ansible stable/victoria,其中包含一些我想尝试但不再需要的服务(designate、octavia 等)。删除这些服务的“正确”方法是什么? I have attempted:我尝试过:

  • kolla-ansible -i multinode reconfigure --tags <services>
  • kolla-ansible -i multinode reconfigure --tags common,haproxy,<services>
  • kolla-ansible -i multinode deploy --tags <services>

In each case I'm left with still-running containers, leftover configuration artifacts (/etc/kolla/.*.conf) and haproxy config files.在每种情况下,我都会留下仍在运行的容器、剩余的配置工件 (/etc/kolla/.*.conf) 和 haproxy 配置文件。

I know it's been a while since you posted this question, but I recently had the same problem and haven't found documentation about this anywhere.我知道你发布这个问题已经有一段时间了,但我最近遇到了同样的问题,并且没有在任何地方找到关于这个的文档。

The reason why reconfigure and deploy don't do anything even if you set enable_<service> to no is because the Ansible playbooks only run tasks involving a given service if its corresponding enable is true.即使您将enable_<service>设置为 no,重新配置和部署也不做任何事情的原因是因为 Ansible playbooks 只运行涉及给定服务的任务,如果其相应的 enable 为真。 If you look at the output of your commands run with --tags , you'd see that Ansible isn't really doing anything with regards to your disabled service.如果您查看使用--tags运行的命令的输出,您会发现 Ansible 并没有真正对您禁用的服务做任何事情。

Since Kolla-Ansible deploys everything with containers, I've found most services can simply be removed by doing the following:由于 Kolla-Ansible 使用容器部署所有内容,我发现大多数服务可以通过执行以下操作简单地删除:

  • Stop and delete all the containers running the service to be removed停止并删除运行要删除的服务的所有容器
  • Delete those containers' volumes删除这些容器的卷
  • Remove the configuration and log files (under /etc/kolla and /var/log/kolla respectively)删除配置和日志文件(分别在 /etc/kolla 和 /var/log/kolla 下)
  • Remove databases used by the service you're deleting删除您要删除的服务使用的数据库
  • You can remove the HAproxy config files for each service you're removing.您可以为要删除的每个服务删除 HAproxy 配置文件。

I know this is perhaps not in the spirit of automating the Openstack management with Ansible, but I've done this a few times without too many problems.我知道这可能不符合使用 Ansible 自动化 Openstack 管理的精神,但我已经这样做了几次,没有太多问题。 I would avoid removing core services like Keystone, Neutron, Nova, Mariadb or Rabbitmq though because if you're doing that you're destroying your entire Openstack deployment anyways.我会避免删除 Keystone、Neutron、Nova、Mariadb 或 Rabbitmq 等核心服务,因为如果你这样做,无论如何你都会破坏整个 Openstack 部署。

You can run the cleanup-host and cleanup-containers scripts on hosts running your containers, but those remove everything related to Kolla-Ansible.您可以在运行容器的主机上运行cleanup-hostcleanup-containers脚本,但这些脚本会删除与 Kolla-Ansible 相关的所有内容。 If you want to remove a specific service, you could modify those scripts though.如果要删除特定服务,则可以修改这些脚本。 I'm aware certain services like Nova, Neutron, Openvswitch and Zun reconfigure the host too for networking but I haven't been able to find a reliable way to revert those changes, and cleanup-host/cleanup-containers don't address those either.我知道某些服务,如 Nova、Neutron、Openvswitch 和 Zun 也为网络重新配置主机,但我无法找到一种可靠的方法来恢复这些更改,并且清理主机/清理容器没有解决这些问题任何一个。 If you stop and delete the openvswitch containers, Openvswitch's interfaces go away on the next host reboot and that may be a viable method for you too.如果您停止并删除 openvswitch 容器,Openvswitch 的接口将在下次主机重新启动时消失,这对您来说也可能是一种可行的方法。 Remember Kolla-Ansible loads the openvswitch kernel module persistently so that's something else you may want to remove as well.请记住,Kolla-Ansible 会持续加载 openvswitch 内核模块,因此您可能还想删除它。

I was also struggling with such scenario recently and I've found just these:我最近也在为这种情况而苦苦挣扎,我发现了这些:

https://bugs.launchpad.net/kolla-ansible/+bug/1874044 https://bugs.launchpad.net/kolla-ansible/+bug/1874044

https://review.opendev.org/c/openstack/kolla-ansible/+/504592 https://review.opendev.org/c/openstack/kolla-ansible/+/504592

Unfortunately, seems like a work already started some time ago, but no big progress has been done yet.不幸的是,似乎已经开始了一段时间的工作,但还没有取得大的进展。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM