Linux installation jenkins+jdk1.8
Because I am still using jdk1.8, I downloaded the jenkins 2.346.1 version, because jenkins 2.346.1 is the last version that supports jdk1.8.
1. Download from jenkins official website
Jenkins official website address
Download jenkins.war, and then put it in tomcat to start
ps: If tomcat has not been installed, see my blog post about installing tomcat
2. Jenkins installation and deployment
Deploy using tomcat
Start tomcat, you will see one more jenkins directory after success
Visit jenkins: http://IP:port/jenkins
The first page is to let you unlock Jenkins,
he will tell you that the password has been output on the console, if you can't find it, use the above command to go to the server where jenkins is located Execute, you will see the password
Excuting an order
[root@localhost logs]# cat /root/.jenkins/secrets/initialAdminPassword
After successful execution, the administrator password will appear, ebce571d213848fb831459c1dbadebc1 is the administrator password
Use the administrator password to continue
Click Continue to jump to the following page for you to install the plug-in, here I choose the recommended plug-in installation, the progress
bar is full, the installation is successful
here Plug-in installation failed, ignore it, click to continue
If you choose to use the admin account to continue, the user name for logging in to Jenkins next time is admin, and the password is the initial password above
If you choose to save and complete, the next time you log in to Jenkins, you will log in with the administrator user and password you created this time. Keep it
and finish .
You can log in
. The first time you log in successfully by default, you need to log in with the admin account next time.
3. Jenkins plug-in installation failure solution
There was a plug-in installation that failed during the installation just now.
solution
1. Switch the download source address
The plug-in that failed to install just now
Click Correct
Click Advanced
to replace the URL (you can see it at the bottom)
New RUL
https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
2. Modify the server configuration
Return to the page below
, scroll to the bottom to see [Plug-in Management]
and click [Get Now]
After clicking, go back to the server to stop tomcat, and then go back to the root directory
[root@localhost ~]# cd /root
[root@localhost ~]# ls -a
You can see .jenkins, go
in and modify the default.json file
[root@localhost ~]# cd .jenkins/updates/
[root@localhost updates]# ls
You can see that there is a default.json file
edit content
[root@localhost updates]# vim default.json
Replace www.google.com with www.baidu.com
Hold Shift+: and enter
%s/www.google.com/www.baidu.com/g
Then globally replace https://updates.jenkins.io/download/ - to https://mirrors.tuna.tsinghua.edu.cn/jenkins/
%s/https:\/\/updates.jenkins.io\/download\//https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins\//g
After the replacement, be careful not to execute the [Get Now] update plugin list button at the bottom, otherwise the content of default.json will be changed.
start tomcat again