Editing
Jenkins Node Addition
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= Jenkins Node Addition and Configuration Guide = This guide describes how to add and configure a new Jenkins node, install Java 11 on it, configure SSH keys, and connect it successfully to the Jenkins master. == 1. Install Java 11 on the New Node == On the new Jenkins node server, install Java 11 (required for Jenkins agents to run). Example (Debian/Ubuntu): apt update apt install openjdk-11-jdk -y Verify installation: java -version == 2. Configure SSH Keys for Jenkins Connection == Jenkins communicates with the node over SSH. We use the Jenkins master’s SSH key to connect to the node. === Step 2.1: Locate the Jenkins Master SSH Key === On the Jenkins master server, the SSH key pair for Jenkins is typically stored in: /var/lib/jenkins/.ssh/id_rsa (private key) /var/lib/jenkins/.ssh/id_rsa.pub (public key) === Step 2.2: Add Jenkins Master Public Key to Node === On the node server, add the Jenkins master’s public key to: /var/lib/jenkins/.ssh/authorized_keys Ensure correct permissions: chmod 700 /var/lib/jenkins/.ssh chmod 600 /var/lib/jenkins/.ssh/authorized_keys chown -R jenkins:jenkins /var/lib/jenkins/.ssh == 3. Add Jenkins Node in Jenkins UI == 1. Open Jenkins master web UI. 2. Go to **Manage Jenkins → Nodes → New Node**. 3. Enter the node name (e.g., ci-node). 4. Select "Permanent Agent". 5. Configure: - Remote root directory: `/var/lib/jenkins` - Number of executors: `2` - Labels: `ci-node` - Launch method: "Launch agents via SSH" == 4. Configure Node SSH Credentials == 1. In Jenkins, go to **Manage Jenkins → Credentials → (Global)**. 2. Add new credentials: - Kind: SSH Username with private key - Username: jenkins - Private key: Enter directly → paste contents of: /var/lib/jenkins/.ssh/id_rsa (from Jenkins master) 3. Save credentials. == 5. Link Node with Credentials == In the node configuration page: 1. Set the host to the node's IP address. 2. Select the SSH credentials saved earlier. 3. Save the node configuration. == 6. Update /etc/hosts (If Required) == If the node or deployment server requires name resolution, update the `/etc/hosts` file on both servers to map hostnames to IPs. Example: 192.168.1.100 ci-node == 7. Permissions on Node == Ensure that the Jenkins user on the node has: - Access to `/var/lib/jenkins` - Proper ownership and permissions for SSH files - Ability to run Java 11 == 8. Verify Connection == After saving the configuration, Jenkins will attempt to connect to the node: - Logs will display Java startup commands - If successful, status will show "Agent connected" == Final Result == Once connected, the node will be available for Jenkins builds and deployments. You can now assign jobs to run on this node by using the label: ci-node
Summary:
Please note that all contributions to PheonixSolutions may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
PheonixSolutions:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
British English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Tools
What links here
Related changes
Page information