how to add a node to Jenkins2 min read
Hi Readers, this document deals with how to add a node to Jenkins.
Jenkins is an open source automation server written in Java. Jenkins helps to automate the non-human part of the software development process, with continuous integration and facilitating technical aspects of continuous delivery. It is a server-based system that runs in servlet containers such as Apache Tomcat.
Jenkins is one of the best DevOps tools which performs continuous integration and continuous deployment. Using Single Jenkins server would be fine only if it handles few jobs. But whenever the number of jobs increases the single server won’t be sufficient to do all the jobs. In order to solve this issue add a node/slave to the Jenkins server so some jobs can be assigned to Slave server as per the job configuration.
Here we will show you how to set up this.
Two servers one with Installed Jenkins server, if not installed check this link and another server with Java Installed.
Step 1: Login to the Jenkins UI using IP address:8080
Step 2: Once logged in go to Manage Jenkins -> Nodes
Step 3: Login to Slave server via SSH and generate ssh access key for the user. Execute the below command to generate the ssh key.
Step 4: Copy the private key
Step 5: Add the public key to the authorized file
Step 6: Now goto Jenkin server and go to credentials
Step 7: Add new credentials.
Step 8: Go to Manage Jenkins and click on the new node.
Step 9: Enter the new name for the new node and mark it as a Permanent agent.
Step 10: Enter the following details
Usage: Only jobs with label expressions matching the node
Step 11: Now Select the agent and click Launch agent.
Step 12: After that, you can see output says Agent successfully launched and online.
Now you have successfully added a node to your Jenkins server.
While creating a job you can assign the slave by adding the label while job configuration. So the specific job runs only in slave server only.