Jenkins的问题在suse linux上启动

时间:2014-02-13 06:33:15

标签: jenkins

我们在Suse linux上安装了Jenkins。它运行良好,直到2天前。从昨天开始,我们面临着一个问题。 jenkins服务启动但仅持续1-2秒并再次停止。看起来服务没有在端口80上启动。我们已经在80上配置了HTTP PORT,因此文件中没有任何更改。可能的原因是什么? 这是log contentt:

Feb 15, 2014 7:07:49 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Jenkins home directory: /var/lib/jenkins found at: System.getProperty("JENKINS_HOME")
Feb 15, 2014 7:07:52 PM winstone.Logger logInternal
INFO: Winstone shutdown successfully
Feb 15, 2014 7:07:52 PM winstone.Logger logInternal
SEVERE: Container startup failed
java.io.IOException: Failed to start a listener: winstone.HttpListener

at winstone.Launcher.spawnListener(Launcher.java:229)
at winstone.Launcher.<init>(Launcher.java:181)
at winstone.Launcher.main(Launcher.java:384)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at Main._main(Main.java:273)
at Main.main(Main.java:98)
Caused by: java.io.IOException: Failed to listen on port 80
at winstone.HttpListener.getServerSocket(HttpListener.java:119)
at winstone.HttpListener.start(HttpListener.java:72)
at winstone.Launcher.spawnListener(Launcher.java:220)
... 8 more
Caused by: java.net.BindException: Permission denied
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
at java.net.ServerSocket.bind(ServerSocket.java:328)
at java.net.ServerSocket.<init>(ServerSocket.java:194)
at java.net.ServerSocket.<init>(ServerSocket.java:150)
at winstone.HttpListener.getServerSocket(HttpListener.java:114)
... 10 more

1 个答案:

答案 0 :(得分:0)

在发布日志之后,我可以说它与我在评论中猜到的完全一样。

无法开始侦听端口(在您的情况下为80):

java.io.IOException: Failed to start a listener: winstone.HttpListener

原因是您没有权限:

Caused by: java.net.BindException: Permission denied

这是因为最多1024个端口只能由root用户打开。您现在有两个选择:

  • 以root身份运行Jenkins(我不建议将其用于安全问题)
  • 选择大于1024的端口。这是首选解决方案。然后,您可以add an iptables rule将端口80重定向到您选择的端口。