Jenkins Linux's slave configuration __linux

Source: Internet
Author: User

As a slave Linux machine for the CentOS system.

1 Linux slave Machine setup

Create Jenkins user sudo/usr/sbin/useradd-m jenkins-d/home/jenkins;

View information ID Jenkins for Jenkins Users and groups:

uid=506 (Jenkins) gid=506 (Jenkins) groups=506 (Jenkins);

Use the SUDO/USR/BIN/PASSWD Jenkins to set the user's Jenkins password to 0;

Switch to the user Jenkins Environment Su-jenkins;

Ensure Java installation is correct: Java--version;

Make sure sshd is running correctly:/sbin/service--status-all | grep ssh;

Install ant, run yum install ant under root;

2 Create Public/private key pair on a slave Linux machine:

Ensure the current user is Jenkins;

Execute Ssh-keygen to create public/private key pair, enter directly to indicate that key will be stored under/HOME/JENKINS/.SSH/ID_RSA, then enter directly to indicate that no password is set. Enter again to confirm that the password is empty;

Create Authorized_keys:

CD. SSH

Cat id_rsa.pub > Authorized_keys

chmod Authorized_keys

;

Copy the Id_rsa (equivalent of Privatekey) to the Jenkins Master machine, for example, under C:\jenkins\id_rsa.

3 Create slave (note), configured as follows:


Make sure that the SSH slave plugin is properly installed in Jenkins, and is generally installed by default.

Then lunch slave, making master and slave successfully connected via SSH. In fact, when the launch Jenkins automatically from the Http://yourserver:port/jnlpJars/slave.jar copy Slave.jar to Slave, and then run through the command Java-jar Slave.jar to run slave.

4 Run the Javahelloworld (Jenkins build Javahelloworld) in the previous section on the new Linux slave and need to modify the Javahelloworld The job's label is javahelloworldlinux to use this slave and runs as follows:


Finish.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.