service start jenkins- jenkins.service failed because the control process exited with error code

huangapple go评论76阅读模式
英文:

service start jenkins- jenkins.service failed because the control process exited with error code

问题

我在AWS Linux上安装了Jenkins,如官方文档所述。但是,当我运行以下命令时:

service start jenkins

我收到以下错误消息:

Starting jenkins (via systemctl):  Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details.
[FAILED]

运行systemctl status jenkins.service命令给我以下结果:

● jenkins.service - LSB: Jenkins Continuous Integration Server
   Loaded: loaded (/etc/rc.d/init.d/jenkins)
   Active: failed (Result: exit-code) since Wed 2016-09-21 16:45:28 BST; 3min 59s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 2818 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=1/FAILURE)

Sep 21 16:45:28 webstack.local.caplib jenkins[2818]: at com.sun.akuma.JavaVMArguments.of(JavaVMArguments...04)
Sep 21 16:45:28 webstack.local.caplib jenkins[2818]: at com.sun.akuma.JavaVMArguments.current(JavaVMArgu...92)
Sep 21 16:45:28 webstack.local.caplib jenkins[2818]: at com.sun.akuma.Daemon.daemonize(Daemon.java:106)
Sep 21 16:45:28 webstack.local.caplib jenkins[2818]: at com.sun.akuma.Daemon.all(Daemon.java:88)
Sep 21 16:45:28 webstack.local.caplib jenkins[2818]: ... 6 more
Sep 21 16:45:28 webstack.local.caplib systemd[1]: jenkins.service: control process exited, code=exited s...s=1
Sep 21 16:45:28 webstack.local.caplib systemd[1]: Failed to start LSB: Jenkins Continuous Integration Server.
Sep 21 16:45:28 webstack.local.caplib systemd[1]: Unit jenkins.service entered failed state.
Sep 21 16:45:28 webstack.local.caplib systemd[1]: jenkins.service failed.
Sep 21 16:45:28 webstack.local.caplib jenkins[2818]: [FAILED]
Hint: Some lines were ellipsized, use -l to show in full.

在我的AWS机器上完成所有Jenkins设置后,我们遇到了错误-----
Starting jenkins (via systemctl):  Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details.
[FAILED]

**我有一个解决方法,请尝试一次并在这里投票。**

1) 卸载所有已安装的Java版本
   命令- sudo yum remove java*   

2) 使用以下命令安装Java 11
   命令 - sudo amazon-linux-extras install java-openjdk11

我确信这将解决您的问题。
注意:此问题是因为我们的Jenkins已更新,Java8中的某些内容与最新的Jenkins版本不兼容。

<details>
<summary>英文:</summary>

I installed jenkins on Aws linux 

    sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins.io/redhat-stable/jenkins.repo
    sudo rpm --import http://pkg.jenkins.io/redhat-stable/jenkins.io.key
    yum install jenkins

as described on the official documentation

However when I run:

service start jenkins
I get the following error message:

    Starting jenkins (via systemctl):  Job for jenkins.service failed because the control process exited with error code. See &quot;systemctl status jenkins.service&quot; and &quot;journalctl -xe&quot; for details.
                                                               [FAILED]

Running systemctl status jenkins.service gives me this:

● jenkins.service - LSB: Jenkins Continuous Integration Server
   Loaded: loaded (/etc/rc.d/init.d/jenkins)
   Active: failed (Result: exit-code) since Wed 2016-09-21 16:45:28 BST; 3min 59s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 2818 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=1/FAILURE)

Sep 21 16:45:28 webstack.local.caplib jenkins[2818]: at com.sun.akuma.JavaVMArguments.of(JavaVMArguments...04)
Sep 21 16:45:28 webstack.local.caplib jenkins[2818]: at com.sun.akuma.JavaVMArguments.current(JavaVMArgu...92)
Sep 21 16:45:28 webstack.local.caplib jenkins[2818]: at com.sun.akuma.Daemon.daemonize(Daemon.java:106)
Sep 21 16:45:28 webstack.local.caplib jenkins[2818]: at com.sun.akuma.Daemon.all(Daemon.java:88)
Sep 21 16:45:28 webstack.local.caplib jenkins[2818]: ... 6 more
Sep 21 16:45:28 webstack.local.caplib systemd[1]: jenkins.service: control process exited, code=exited s...s=1
Sep 21 16:45:28 webstack.local.caplib systemd[1]: Failed to start LSB: Jenkins Continuous Integration Server.
Sep 21 16:45:28 webstack.local.caplib systemd[1]: Unit jenkins.service entered failed state.
Sep 21 16:45:28 webstack.local.caplib systemd[1]: jenkins.service failed.
Sep 21 16:45:28 webstack.local.caplib jenkins[2818]: [FAILED]
Hint: Some lines were ellipsized, use -l to show in full.

After doing all jenkins setup in my AWS machine we got error-----
Starting jenkins (via systemctl):  Job for jenkins.service failed because the control process exited with error code. See &quot;systemctl status jenkins.service&quot; and &quot;journalctl -xe&quot; for details.
                                                           [FAILED]


**I have a work around this. please try once and vote here .**

    1)Uninstall all  java version installed
    command- sudo yum remove java*   
    
    2) install java 11 by using below command
     command -sudo amazon-linux-extras install java-openjdk11

i&#39;m sure it will resolve your issue .
Note: this issue is because our Jenkins were updated and few things in Java8 was not compatible with latest Jenkins version

</details>


# 答案1
**得分**: 1

你需要安装Java 11,而不是Java 8。我已经提供了所有必要的命令:

1. `sudo yum install java-11-amazon-corretto-headless`
2. `sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins.io/redhat-stable/jenkins.repo`
3. `sudo rpm --import http://pkg.jenkins.io/redhat-stable/jenkins.io.key`
4. `sudo yum install jenkins`
5. `sudo systemctl restart jenkins`
6. `sudo systemctl enable jenkins`

### 配置Jenkins
Jenkins现在已安装并在您的EC2实例上运行。要配置Jenkins:
1. 从您的浏览器连接到`http://<your_server_public_DNS>:8080`。您将能够通过其管理界面访问Jenkins。
2. 解锁Jenkins:`sudo cat /var/lib/jenkins/secrets/initialAdminPassword`

<details>
<summary>英文:</summary>

You need to install Java 11, not Java 8. I have documents all the commands to do so:

1. `sudo yum install java-11-amazon-corretto-headless`
2. `sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins.io/redhat-stable/jenkins.repo`
3. `sudo rpm --import http://pkg.jenkins.io/redhat-stable/jenkins.io.key`
4. `sudo yum install jenkins`
5. `sudo systemctl restart jenkins`
6. `sudo systemctl enable jenkins`

### Configuring Jenkins
Jenkins is now installed and running on your EC2 instance. To configure Jenkins:
1. Connect to `http://&lt;your_server_public_DNS&gt;:8080` from your browser. You will be able to access Jenkins through its management interface.
2. Unlock Jenkins: `sudo cat  /var/lib/jenkins/secrets/initialAdminPassword`



</details>



huangapple
  • 本文由 发表于 2023年1月6日 14:34:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/75027716.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定