Understanding Jenkins Distributed (Master‑Slave) Architecture and Common Issues
This article explains Jenkins’ distributed master‑slave architecture, the requirement for identical slave environments, outlines the roles of master and slaves, and provides step‑by‑step solutions for common node errors such as SSH connection failures and JDK version mismatches.
1. Jenkins Distributed Concept
In Jenkins distributed architecture, multiple slave nodes are used; when many projects need building, slaves take on the master’s workload and create projects on the slaves.
2. Slave environment must match the master
Any software installed on the master must also be prepared on the slave, preferably with identical paths; the only difference is that Jenkins itself does not need to be installed on the slave.
Jenkins Master‑Slave Architecture Overview:
a. The Master‑Slave distributed architecture solves the problem of a single Jenkins instance handling many build tasks, high load, and insufficient performance.
b. Master/Slave corresponds to the server and agent concepts.
c. The Master provides a web interface for users to manage jobs and slaves.
d. Jobs can run on the master machine or be assigned to a slave for execution.
e. One master (the machine hosting Jenkins) can be linked to multiple slaves to serve different jobs or the same job with different configurations.
3. Node Errors
3.1 SSH connection failure handling:
[root@jenkins-master jenkins]# pwd
/var/lib/jenkins
[root@jenkins-master jenkins]# cp -r /root/.ssh .
[root@jenkins-slave .ssh]# pwd
/var/lib/jenkins/.ssh
3.2 Cause of JDK version mismatch
[SSH] Starting agent process: cd "/var/lib/jenkins" && java -jar remoting.jar -workDir /var/lib/jenkins -jar-cache /var/lib/jenkins/remoting/jarCache
Mar 15, 2023 5:18:35 AM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
INFO: Using /var/lib/jenkins/remoting as a remoting work directory
Mar 15, 2023 5:18:35 AM org.jenkinsci.remoting.engine.WorkDirManager setupLogging
INFO: Both error and output logs will be printed to /var/lib/jenkins/remoting
Solution:
[root@jenkins-slave jdk11]# which java
/bin/java
[root@jenkins-slave jdk11]# ln -sf /usr/local/jdk11/bin/java /usr/bin/java
[root@jenkins-slave jdk11]# ll /usr/bin/java
lrwxrwxrwx 1 root root 25 Mar 15 05:30 /usr/bin/java -> /usr/local/jdk11/bin/java
If this article helped you, please like, watch, and share; your support encourages further high‑quality content creation.
Practical DevOps Architecture
Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.