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.