linux Installation and configuration jenkins

linux Installation and configuration jenkins ...
The first big problem: download the installation package
install
Open port
Start service
Initialize configuration
linux Installation and configuration jenkins

The first big problem: download the installation package

I don't want to choose the war package. I want to download it by installing the package. But I can't find the place to download the npm package on the official website. There are war packages everywhere. Finally, I found the location of the rpm package and recorded it
Official website portal



Because my is centos, I choose the long-term supported version of redhat

rpm package, he came and chose one he wanted. The version is not important. The important thing is to start first.


Then we wget copy the link and download the installation package on the host

[root@hecs-82454 local]# wget https://get.jenkins.io/redhat-stable/jenkins-2.222.1-1.1.noarch.rpm

install

After a long wait, the download is finished, and the installation starts now

i indicates the installation, v indicates the installation process, and h indicates the progress

[root@hecs-82454 local]# rpm -ivh jenkins-2.222.1-1.1.noarch.rpm warning: jenkins-2.222.1-1.1.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID d50582e6: NOKEY Preparing... ################################# [100%] Updating / installing... 1:jenkins-2.222.1-1.1 ################################# [100%] [root@hecs-82454 local]#

After the installation, these directories will appear

/usr/lib/jenkins/jenkins.war WAR package /etc/sysconfig/jenkins configuration file /var/lib/jenkins/ default JENKINS_HOME catalogue,This can be seen from the above configuration file /var/log/jenkins/jenkins.log Jenkins log file

If you don't want jenkins to start on port 8080, let's change it. For example, I changed it to 8087


Here, the installation is over

Open port

Mine belongs to Huawei cloud. Since we need to access 8087, we need to open the 8087 port

Start service

[root@hecs-82454 sysconfig]# service jenkins start 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] [root@hecs-82454 sysconfig]#

No, it's embarrassing. It's wrong, but fortunately, the error has prompted us how to view the details. Let's have a look

[root@hecs-82454 sysconfig]# systemctl status jenkins.service ● jenkins.service - LSB: Jenkins Automation Server Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled) Active: failed (Result: exit-code) since Sun 2021-09-26 18:07:54 CST; 6min ago Docs: man:systemd-sysv-generator(8) Process: 2848 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=1/FAILURE) Sep 26 18:07:54 hecs-82454 systemd[1]: Starting LSB: Jenkins Automation Server... Sep 26 18:07:54 hecs-82454 runuser[2853]: pam_unix(runuser:session): session opened for user jenkins by (uid=0) Sep 26 18:07:54 hecs-82454 jenkins[2848]: Starting Jenkins bash: /usr/bin/java: No such file or directory Sep 26 18:07:54 hecs-82454 systemd[1]: jenkins.service: control process exited, code=exited status=1 Sep 26 18:07:54 hecs-82454 jenkins[2848]: [FAILED] Sep 26 18:07:54 hecs-82454 systemd[1]: Failed to start LSB: Jenkins Automation Server. Sep 26 18:07:54 hecs-82454 systemd[1]: Unit jenkins.service entered failed state. Sep 26 18:07:54 hecs-82454 systemd[1]: jenkins.service failed.

Oh, Starting Jenkins bash: /usr/bin/java: No such file or directory. Originally, there was no Java directory, but in fact, our environment has java. The only reason is that the path we installed is inconsistent with its default, and there is also the path / etc/rc.d/init.d/jenkins in the error message. To be honest, I haven't seen this path. I'm very curious, so I searched it, I found such an article, which well explained what this directory is for. Fortunately, there are these big guys who are willing to share. Otherwise, self-study is so difficult
Portal

Find your own java path and copy it to the red box in the figure below.

[root@hecs-82454 init.d]# whereis java java: /usr/local/jdk1.8/bin/java

If you execute the start command again, you may report the following warning

Warning: jenkins.service changed on disk. Run 'systemctl daemon-reload' to reload units.

Let's just follow the warning

Execute the start command again, success!

[root@hecs-82454 sysconfig]# service jenkins start Starting jenkins (via systemctl): [ OK ]

Initialize configuration

Now we can access our jenkins page on the Internet
http: / / host ip: open port

It's so sweet. Even the password was told. Go back to the host and cat it out. Copy it to the administrator password. Click continue. The screen will shake like the following for a while. Don't worry

After loading, that's it. I chose to install the recommended plug-ins

Click once, it will be very slow, or even lose the connection. Just reconnect, and then that's it. Wait

Many can't be installed. Forget it. Let's talk about it when we need plug-ins. We don't have to install them now



After installation, sprinkle flowers

26 September 2021, 06:54 | Views: 3548

Add new comment

For adding a comment, please log in
or create account

0 comments