如何在不重启的情况下停止服务

How to stop service without restart

我已经在 cloudify 2.7 和 OpenStack 云上部署了一个 "helloworld" 服务。我会停止服务 tomcat 而不重新启动服务。

所以,在 cloudify 中 shell 我执行了:

cloudify@default> 连接 cloudify-manager-1_IP 连接成功 cloudify@default> 使用应用程序 helloworld 使用应用程序 helloworld cloudify@helloworld> 调用 tomcat cloudify:start-维护模式 60 调用结果: 1:实例 #1@tomcat_IP 正常,结果:成功禁用代理故障检测 60 分钟 调用成功完成

此时,我已经通过 ssh 连接到 tomcat VM 和 运行:

CATALINA_HOME/bin/catalina.sh 停止

在 CATALINA_HOME/log/catalina.out 中我可以看到应用服务器正在停止并立即重新启动!

那么,我应该怎么做才能停止应用服务器并仅在我决定重新启动它时才重新启动它?

Cloudify 2.7 中的维护模式用于防止系统在服务 VM 发生故障时启动新的 VM。

您正在寻找的是防止 Cloudify 自动修复进程 - Cloudify 检查已配置进程的活跃度,如果它死了,它会再次执行 'start' 生命周期。

在您的情况下,受监视的进程可能会发生变化,因为您将手动重新启动它。所以你不应该使用默认的进程监控。这里有一个类似的问题:cloudify 2.7 locator NO_PROCESS_LOCATORS