jenkins installation

  1. The preconditions
    jdk and maven are all configured environments, so I won't go into details.

  2. Download the installation file and
    select an rpm package http://pkg.jenkins-ci.org/redhat/
    and execute the command sudo rpm -ivh jenkins-2.118-1.1.noarch.rpm after completion

● 2.54 (2017-04) and newer: Java 8
● 1.612 (2015-05) and newer: Java 7

  1. Basic information after installation
    jenkins configuration file /etc/sysconfig/jenkins below.
    Looking at the configuration file, you can see that the default JENKINS_HOME directory is /var/lib/jenkins.
    Execute whereis jenkins and find that jenkins.war is under /usr/lib/jenkins/.

  2. start jenkins

The first way is to
cd to /usr/lib/jenkins/, in theory, execute the following command to enter the formal configuration process, and the online tutorials are generally like this:
java -jar jenkins.jar --httpPort=8080 Start
But, There are two problems in the execution of the above command. One is that the java memory usage information is not set, and jenkins is more memory-intensive. If it is not restricted, it is easy to crash, so it is best to modify the above command
java -jar -Xms512m -Xmx512m -XX:MaxNewSize=256m -XX:MaxPermSize=256m jenkins.jar

Method 2 (recommended)
The second problem with the above command is that it uses the java command directly, and the console cannot be closed. For tools like jenkins, it should run in the background for a long time, so the second method should be used, which is The system service method is as follows: After
executing the command sudo service jenkins start
, an error message may be reported. I have encountered the following:
[ yinjd@yinjd-t1 yinjd]$ sudo service jenkins start
Starting Jenkins bash: /usr /bin/java: No such file or directory
This is obviously caused by not modifying the configuration file. The default java path of jenkins is different from the actual configuration of the system, so the configuration file needs to be modified here, and other cases are handled similarly. If java cannot be found, you need to add the corresponding jdk path in /etc/init.d/jenkins.

After that, there will be a bunch of log information, and the last one will look like the following. After this, it is necessary to open the browser immediately to perform the next action.




Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:

857bb49d8cc******e8dc0220e57c2e4

This may also be found at: /home/yxgly/.jenkins/secrets/initialAdminPassword
*************************************************************
*************************************************************
*************************************************************

After entering http://youripaddress:port in the browser, the following interface appears, enter the password given above

I chose to install the recommended plugin, and then entered the plugin download and installation interface

After installing the plugin, the next interface is to set the administrator username and password. After completing this step, you can start using jenkins.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324694382&siteId=291194637