Slave configuration in Linux of Jenkins

Source: Internet
Author: User

 

Linux machines used as slave are centos systems.

 

1) Linux Server Load balancer settings

Create Jenkins user sudo/usr/sbin/useradd-M Jenkins-D/home/Jenkins;

View Jenkins user and group information Id Jenkins:

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

Use sudo/usr/bin/passwd Jenkins to set the user's Jenkins password to 0;

Switch to Su-Jenkins in the Jenkins environment;

Ensure that Java is correctly installed: Java -- version;

Make sure that sshd runs correctly:/sbin/service -- Status-All | grep SSH;

Install ant and run Yum install ant under root;

 

2) create public/private key pair on the Linux Server of slave:

Make sure the current user is Jenkins;

Run ssh-keygen to create public/private key pair. Enter directly, indicating that the key will be stored in/home/Jenkins /. enter directly under ssh/id_rsa, indicating no password is set. Enter again to confirm that the password is blank;

Create authorized_keys:

CD. SSH

Cat id_rsa.pub> authorized_keys

Chmod 700 authorized_keys

;

Copy id_rsa (equivalent to privatekey) to the Jenkins master machine, for example, C: \ Jenkins \ id_rsa.

 

3) create an slave (Note) and configure it as follows:

Make sure that the SSH slave Plugin in Jenkins is correctly installed. Generally, it is installed by default.

Then, lunch slave makes the master and slave connect successfully through SSH. In fact, Jenkins automatically downloadsHttp: // yourserver: Port/jnlpjars/slave. Jar copy slave. jar to slave, and then run the commandJava-jar slave. jar to run slave.

 

4) on the new Linux Server Load balancer, run javahelloworld (Jenkins builds javahelloworld) in the previous section, and modify the label of javahelloworld job to javahelloworldlinux to use this Server Load balancer. Run the following command:

 

Complete!

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.