Problem Statement
What is the master-agent (master-slave) architecture in Jenkins?
Explanation
Jenkins follows a master-agent architecture (formerly called master-slave) where the Jenkins master is the central control unit that manages configuration, schedules build jobs, monitors agents, and serves the Jenkins UI. The master handles job scheduling, dispatching builds to agents, monitoring agent status, recording and presenting build results, and can also execute builds directly.
Agents (also called nodes or slaves) are worker machines that execute builds dispatched by the master. Agents connect to the master and execute tasks as directed. You can have multiple agents with different configurations, operating systems, or tools installed, allowing builds to run on the most appropriate environment. This distributed architecture enables parallel execution of builds and scales Jenkins to handle large workloads.
Benefits include load distribution across multiple machines, ability to build on different platforms (Windows, Linux, macOS) from single master, isolation of build environments, and scalability by adding more agents. The master should not execute heavy builds directly in production to keep it responsive for managing the system. Understanding this architecture is crucial for scaling Jenkins deployments.
