jenkins修改80端口后报错
一、问题现象
#jenkins修改80端口后报错
Aug 10 10:47:40 jenkins systemd[1]: Unit jenkins.service entered failed state.
Aug 10 10:47:40 jenkins systemd[1]: jenkins.service failed.
Aug 10 10:47:41 jenkins systemd[1]: jenkins.service holdoff time over, scheduling restart.
...skipping...
Aug 10 14:46:03 jenkins jenkins[30282]: at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
Aug 10 14:46:03 jenkins jenkins[30282]: at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
Aug 10 14:46:03 jenkins jenkins[30282]: at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
Aug 10 14:46:03 jenkins jenkins[30282]: at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
Aug 10 14:46:03 jenkins jenkins[30282]: at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
Aug 10 14:46:03 jenkins jenkins[30282]: at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
Aug 10 14:46:03 jenkins jenkins[30282]: at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
Aug 10 14:46:03 jenkins jenkins[30282]: at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
Aug 10 14:46:03 jenkins jenkins[30282]: at org.eclipse.jetty.server.Server.doStart(Server.java:397)
Aug 10 14:46:03 jenkins jenkins[30282]: at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
Aug 10 14:46:03 jenkins jenkins[30282]: at winstone.Launcher.<init>(Launcher.java:200)
Aug 10 14:46:03 jenkins jenkins[30282]: Caused: java.io.IOException: Failed to start Jetty
Aug 10 14:46:03 jenkins jenkins[30282]: at winstone.Launcher.<init>(Launcher.java:204)
Aug 10 14:46:03 jenkins jenkins[30282]: at winstone.Launcher.main(Launcher.java:403)
Aug 10 14:46:03 jenkins jenkins[30282]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Aug 10 14:46:03 jenkins jenkins[30282]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
Aug 10 14:46:03 jenkins jenkins[30282]: at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Aug 10 14:46:03 jenkins jenkins[30282]: at java.base/java.lang.reflect.Method.invoke(Method.java:566)
Aug 10 14:46:03 jenkins jenkins[30282]: at executable.Main._main(Main.java:334)
Aug 10 14:46:03 jenkins jenkins[30282]: at executable.Main.main(Main.java:116)
Aug 10 14:46:03 jenkins systemd[1]: jenkins.service: main process exited, code=exited, status=1/FAILURE
二、解决思路
vim /usr/lib/systemd/system/jenkins.service
#修改用户为root
34 User=root
35 Group=root
#修改端口为80
67 Environment="JENKINS_PORT=80"
systemctl daemon-reload
systemctl restart jenkins
#原因:
应该是权限不够,修改完80,就会报错,改成root权限就可以了
https://blog.csdn.net/qq_33982898/article/details/130933640
标签:10,java,14,Aug,03,端口,切换,jenkins
From: https://www.cnblogs.com/world-of-yuan/p/17970325