简体   繁体   English

詹金斯未能在Linux中启动

[英]Jenkins failed to start in linux

go to run jenkins after doing an upgrade, and get the following: 升级后去运行jenkins,并得到以下内容:

start jenkins
start: Job failed to start

That's it...nothing shows up in jenkin's log...so it is difficult to debug to say the least. 就是这样...... jenkin的日志中没有任何内容......所以很难调试至少。 (and it isn't running already, or anything like that). (它还没有运行,或类似的东西)。

Is there another log somewhere that I should be looking at that would be helpful? 在我应该看的某个地方是否有其他日志会有所帮助? (I am assuming answer to this problem will be somewhat iterative, so hopefully someone can start me on a path to debug this) (我假设这个问题的答案会有些迭代,所以希望有人可以启动我的路径来调试这个)

So, knowing it was a pre-start error allowed me to investigate more deeply. 所以,知道这是一个启动前错误让我更深入地调查。

Further digging allowed me to figure out that the exact line in the /etc/init/jenkins.conf file was one pointing to the /usr/share/jenkins/bin/maintain-plugins.sh 进一步的挖掘让我弄清楚/etc/init/jenkins.conf文件中的确切行是指向/usr/share/jenkins/bin/maintain-plugins.sh

Looking at this location, I found it was not present (ie. no bin directory). 看着这个位置,我发现它不存在(即没有bin目录)。 This means that jenkins-common was no longer installed for some reason...odd indeed...going into apt-get and doing an install of this component again led to the error: 这意味着jenkins-common因某种原因不再安装了......奇怪的是......进入apt-get并再次安装此组件会导致错误:

dpkg error processing /var/cache/apt/archives/jenkins-common_1.409.1-0ubuntu4.2_all.deb ...

having seen this error before and refreshing my memory via google gave the following solution: 之前看过这个错误并通过谷歌刷新我的记忆提供了以下解决方案:

dpkg -i --force-overwrite /var/cache/apt/archives/jenkins-common_1.409.1-0ubuntu4.2_all.deb

This allowed the installation of common to proceed as normal. 这允许公共安装正常进行。 After this, all I had to do was replace the /usr/share/jenkins/jenkins.war with my backed up copy (because ubuntu is far behind the latest release version), and I was able to start the server again. 在此之后,我所要做的就是用我备份的副本替换/usr/share/jenkins/jenkins.war (因为ubuntu远远落后于最新版本),我能够再次启动服务器。

I am not exactly sure what caused the problem to begin with, but it was likely during an apt-get upgrade/clean process...and because of the weirdness with jenkins conflicting with jenkins-common, it did not repopulate the /usr/share/jenkins directory properly. 我不确定是什么导致问题开始,但它可能在apt-get升级/清理过程中......并且由于jenkins与jenkins-common冲突的怪异,它没有重新填充/usr/share/jenkins正确/usr/share/jenkins目录。

regardless, am glad it is working again. 无论如何,我很高兴再次工作。 :) :)

Instead, you can run the following before the install to properly clean up any conffiles left by the distro version: 相反,您可以在安装之前运行以下命令来正确清除发行版版本留下的任何配置:

sudo apt-get purge jenkins

Then install the correct version. 然后安装正确的版本。

I went to see the jenkins logs tail -f /var/log/jenkins/jenkins.log 我去看了jenkins日志tail -f /var/log/jenkins/jenkins.log

In my case it didn't start because I used incompatible java version. 在我的情况下,它没有启动,因为我使用了不兼容的Java版本。 Update and make sure it sees correct java (In my case it should have been opened using JRE 1.7. To check, please use java -version command) and all should work 更新并确保它看到正确的java(在我的情况下它应该使用JRE 1.7打开。要检查,请使用java -version命令)并且所有应该工作

The following worked for me: 以下对我有用:

sudo rm /etc/init/jenkins.conf
sudo update-rc.d jenkins defaults
sudo service jenkins start

Then.... 然后....

root@core:/# service jenkins start
* Starting Jenkins Continuous Integration Server jenkins                    [ OK ] 

Borrowed from: https://groups.google.com/forum/#!msg/jenkinsci-users/eW_yEWLojFc/tFhb8DKoRHUJ 借鉴: https ://groups.google.com/forum/#!msg/jenkinsci-users/eW_yEWLojFc/ tFhb8DKoRHUJ

Ubuntu 18.04 LTS use Java 9 as default java Ubuntu 18.04 LTS使用Java 9作为默认java

Jenkins 2.107.2 still use Java 8 Jenkins 2.107.2仍然使用Java 8

[Solution] [解]

Install Java 8 before install Jenkins 在安装Jenkins之前安装Java 8

sudo add-apt-repository ppa:webupd8team/java
sudo apt install oracle-java8-installer
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo apt-add-repository "deb https://pkg.jenkins.io/debian-stable binary/"
sudo apt install jenkins

See https://stackoverflow.com/a/49937744/900684 请参阅https://stackoverflow.com/a/49937744/900684

I got from this link: https://serverfault.com/questions/710680/jenkins-not-starting-in-ubuntu 我从这个链接获得: https//serverfault.com/questions/710680/jenkins-not-starting-in-ubuntu

It might be caused by a full disk. 它可能是由一个完整的磁盘引起的。 To be really sure, try running it manually. 要确定,请尝试手动运行它。 Like this: /usr/bin/java -Djava.awt.headless=true -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080 --ajp13Port=-1 像这样: /usr/bin/java -Djava.awt.headless=true -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080 --ajp13Port=-1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM