jenkins端口报错
java.io.IOException: Failed to start Jettyat winstone.Launcher.<init>(Launcher.java:209)at winstone.Launcher.main(Launcher.java:496)at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.base/java.lang.reflect.Method.invoke(Method.java:568)at executable.Main.main(Main.java:351)
Caused by: java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:8080at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:344)at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:304)at org.eclipse.jetty.server.Server.lambda$doStart$0(Server.java:402)
更换端口运行启动jenkins
./jenkins start --httpPort=8088
还是出现报错
WARNING hudson.model.UpdateCenter#updateDefaultSite: Upgrading
解决方法
1.查询宿主主机防火墙NAT转发情况:firewall-cmd --query-masquerade
2.开启NAT转发: firewall-cmd --zone=public --add-masquerade --permanent
3.重启防火墙: firewall-cmd --reload
如果使用命令出现 FirewallD is not running 问题 :
1.查看firewalld状态:systemctl status firewalld
,如果是dead状态,即防火墙未开启。
2.开启防火墙:systemctl start firewalld
3.确认firewalld状态:systemctl status firewalld
(根据需求是否关闭防火墙)关闭防火墙:systemctl stop firewalld
再次启动
./jenkins start --httpPort=8088
输入IP及端口可正常启动jenkins