在 Windows 上重新启动 Hudson
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3759709/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Restarting Hudson on Windows
提问by TDH
I've been having an issue with Hudson on windows.
我在 Windows 上遇到了 Hudson 的问题。
Whenever I update Hudson or a plugin I get the option to restart when no jobs are running.
If I click this button Hudson hangs and doesn't restart. I've tried restarting the Hudson service but this doesn't help, so end up having to reboot the box to bring Hudson back online.
每当我更新 Hudson 或插件时,我都可以选择在没有作业运行时重新启动。
如果我单击此按钮,Hudson 会挂起并且不会重新启动。我试过重新启动 Hudson 服务,但这无济于事,因此最终不得不重新启动机器以使 Hudson 重新联机。
I've just updated to the most recent version, but didn't click the restart button and it's now vanished.
我刚刚更新到最新版本,但没有单击重新启动按钮,现在它消失了。
Is there a correct way to restart Hudson on windows?
有没有正确的方法在 Windows 上重新启动 Hudson?
Cheers
干杯
Tom
汤姆
采纳答案by Peter Schuetze
I have a this problem once in a while too. For some reason the Hudson server does not shut down completely and the server that starts up, can not use the port. To fix that problem, I run `netstat -n -o'. This way I can find out the process ID that holds the port and kill that app through taskmanager. Now I can restart the service and Hudson comes up fine.
我也偶尔遇到这个问题。由于某种原因,Hudson 服务器没有完全关闭,启动的服务器无法使用该端口。为了解决这个问题,我运行了`netstat -n -o'。这样我就可以找出持有端口的进程 ID 并通过任务管理器杀死该应用程序。现在我可以重新启动服务并且 Hudson 正常运行。
For the last few weeks I had a similar problem. The description says, that it restarts the app, when no processes are running. I missed out on one job that was hold in the build queue and because of a faulty configuration never actually build, therefore preventing Hudson from restarting.
在过去的几周里,我遇到了类似的问题。描述说,当没有进程正在运行时,它会重新启动应用程序。我错过了在构建队列中保留的一项工作,并且由于错误的配置从未真正构建过,因此阻止了 Hudson 重新启动。
After all of your jobs are finished and your server does not restart. Just visit the restart page again http://server:port/restartand try to restart again. If that doesn't work stop the service and start it again.
在您完成所有作业并且您的服务器不会重新启动之后。只需再次访问重启页面http://server:port/restart并尝试再次重启。如果这不起作用,请停止服务并重新启动它。
UPDATE:
更新:
Since I grew tired of physically logging into the Hudson/Jenkins server, I now use following commands to run the kill remotely. These commands assume that you run the service with a dedicated user (e.g. JenkinsUser). If another process running with the same credentials than the service does and might start java.exe, you need to run the netstat which needs to be executed locally on the Jenkins server or by using rexec (this was not an option for me).
由于我厌倦了物理登录 Hudson/Jenkins 服务器,我现在使用以下命令远程运行 kill。这些命令假设您使用专用用户(例如 JenkinsUser)运行服务。如果另一个进程使用与服务相同的凭据运行并且可能启动 java.exe,则您需要运行需要在 Jenkins 服务器上本地执行的 netstat 或使用 rexec(这对我来说不是一个选项)。
:: get the pid of jenkins java.exe
tasklist /S %JENKINSSERVER% /FI "IMAGENAME eq java.exe" /FI "USERNAME eq %DOMAIN\USERNAME%"
:: terminate process use pid from previous command (instead of 1234)
taskkill /S %JENKINSSERVER% /F /T /PID 1234
:: stop the Jenkins service (just in case the service is hanging)
sc \%JENKINSSERVER% stop Jenkins
:: start the Jenkins service again
sc \%JENKINSSERVER% start Jenkins
If I have to much time, I might create a script out of it.
如果我有很多时间,我可能会从中创建一个脚本。
回答by Adil B
If you've installed Jenkins on a TomCat server, one alternative solution is to simply restart your Apache TomCat service.
如果您在 TomCat 服务器上安装了 Jenkins,另一种解决方案是简单地重新启动 Apache TomCat 服务。
回答by VonC
If the Slave node has the slave.jar
used as a windows service, that service is defined as "Automatic".
It means it will try to contact the master periodically if the connection has been severed.
如果从节点slave.jar
用作 Windows 服务,则该服务被定义为“自动”。
这意味着如果连接已被切断,它将尝试定期联系主站。
You shouldn't click on anything on the server side (in the Node definition) to restart said Node: it should be back online automatically.
你不应该点击服务器端的任何东西(在节点定义中)来重新启动所述节点:它应该自动重新在线。