gpt4 book ai didi

linux - knife ssh - jetty 会突然停止

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:28:22 25 4
gpt4 key购买 nike

我有一个带有 chef-server/chef-client 的 chef 基础设施。我想使用 knife ssh 从所有机器上重启 jetty。

有一个非常奇怪的行为。当 jetty 启动时,它会收到一个终止信号并停止。只有当我使用 knife ssh 时才会发生这种情况。

2015-06-25 17:37:29.171:INFO:oejs.ServerConnector:main: Started ServerConnector@673b21af{HTTP/1.1}{0.0.0.0:8080}
2015-06-25 17:37:29.171:INFO:oejs.Server:main: Started @17901ms
2015-06-25 17:37:31.302:INFO:oejs.ServerConnector:Thread-1: Stopped ServerConnector@673b21af{HTTP/1.1}{0.0.0.0:8080}
2015-06-25 17:37:31.303:INFO:/:Thread-1: Destroying Spring FrameworkServlet 'spring'
INFO : org.springframework.web.context.support.XmlWebApplicationContext - Closing WebApplicationContext for namespace 'spring-servlet': startup date [Thu Jun 25 17:37:29 CEST 2015]; parent: Root WebApplicationContext
2015-06-25 17:37:31.307:INFO:/:Thread-1: Closing Spring root WebApplicationContext
INFO : org.springframework.web.context.support.XmlWebApplicationContext - Closing Root WebApplicationContext: startup date [Thu Jun 25 17:37:20 CEST 2015]; root of context hierarchy
INFO : org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default'
INFO : org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler - Shutting down ExecutorService 'taskScheduler'
INFO : org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor - Shutting down ExecutorService
2015-06-25 17:37:31.509:INFO:oejsh.ContextHandler:Thread-1: Stopped o.e.j.w.WebAppContext@675e8fe2{/,file:/tmp/jetty-0.0.0.0-8080-root.war-_-any-6087241756199243276.dir/webapp/,UNAVAILABLE}{/opt/idm/root.war}

用于重启jetty的命令是:

knife ssh -x root "name:*" "sh /opt/jetty/jetty-current/bin/jetty.sh start"

正如我上面所说,如果我从 ssh 执行命令,在每台机器上手动执行(不使用 knife),jetty 会启动并且工作正常。 knife ssh 除了在每台机器上创建 ssh 并运行该命令还有什么其他功能?

我已尝试通过不同的方式解决此问题,包括使用 & at 命令/创建另一个执行命令的 shell 脚本,但没有成功。

Here是带有 jetty.sh 的 paste2

当我用 Knife 启动 jetty 时,有些东西会杀死它。有什么想法吗?

编辑:尝试将 jetty.sh 放入/etc/init.d/jetty 并使用 service jetty start 作为服务启动,但结果相同。

最佳答案

我找到了解决问题的方法。

事情是 knife ssh 一旦完成执行,将杀死每个产生的进程。也许这有一个错误。

我创建了一本 Recipe ,在其中我运行了一个 Recipe service jetty restart。然后,使用 knife ssh 我只从 chef-client 执行这个 Recipe 。

关于linux - knife ssh - jetty 会突然停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31057612/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com