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!