What is the role of the Jenkins master in the master-agent architecture?
The Jenkins master controls the system, manages jobs, schedules builds, and distributes tasks to agents. It also provides the user interface and stores build results.
Click to reveal answer
beginner
What is a Jenkins agent and why is it used?
A Jenkins agent is a machine that runs build jobs delegated by the master. It helps distribute workload and allows builds to run on different environments or platforms.
Click to reveal answer
intermediate
How do Jenkins master and agents communicate?
They communicate over a network using protocols like JNLP or SSH. The master sends build tasks to agents, and agents report back the results.
Click to reveal answer
beginner
Why is using agents beneficial in Jenkins?
Agents allow parallel execution of builds, reduce load on the master, and enable running jobs on different operating systems or hardware setups.
Click to reveal answer
intermediate
What happens if the Jenkins master goes down in a master-agent setup?
If the master goes down, agents cannot receive new tasks or report results. The whole system becomes inactive until the master is restored.
Click to reveal answer
What component schedules and manages build jobs in Jenkins master-agent architecture?
AJenkins master
BJenkins agent
CBuild executor
DSource code repository
✗ Incorrect
The Jenkins master is responsible for scheduling and managing build jobs.
Which protocol is commonly used for communication between Jenkins master and agents?
AJNLP
BFTP
CHTTP
DSMTP
✗ Incorrect
JNLP (Java Network Launch Protocol) is commonly used for Jenkins master-agent communication.
What is a key advantage of using Jenkins agents?
AThey replace the master
BThey allow parallel builds
CThey store build results
DThey manage user access
✗ Incorrect
Agents allow parallel execution of builds, improving efficiency.
If the Jenkins master is down, what happens to the agents?
AThey become new masters
BThey continue running builds independently
CThey cannot receive new tasks
DThey shut down automatically
✗ Incorrect
Agents depend on the master to receive tasks and report results.
Which of these is NOT a function of the Jenkins master?
AScheduling builds
BProviding the user interface
CDistributing tasks to agents
DRunning build jobs directly
✗ Incorrect
While the master can run builds, it mainly delegates build jobs to agents.
Explain the roles of Jenkins master and agents in the master-agent architecture.
Think about who controls and who executes.
You got /4 concepts.
Describe the benefits of using agents in Jenkins.
Why not run all builds on the master?
You got /4 concepts.
Practice
(1/5)
1. What is the main role of the Jenkins master in the master-agent architecture?
easy
A. To run jobs on different machines
B. To control and schedule jobs
C. To store job logs only
D. To act as a backup server
Solution
Step 1: Understand the master role
The Jenkins master is responsible for controlling and scheduling jobs, meaning it decides when and where jobs run.
Step 2: Differentiate from agent role
Agents actually run the jobs on separate machines, not the master.
Final Answer:
To control and schedule jobs -> Option B
Quick Check:
Master controls jobs = B [OK]
Hint: Master schedules jobs; agents run them [OK]
Common Mistakes:
Confusing master with agent role
Thinking master runs jobs directly
Assuming master only stores logs
2. Which of the following is the correct way to define an agent in a Jenkins pipeline script?
easy
A. run agent
B. master agent
C. agent any
D. node master
Solution
Step 1: Recall Jenkins pipeline syntax
In Jenkins declarative pipeline, agent any means the job can run on any available agent.
Step 2: Check other options
Options like master agent, run agent, and node master are not valid syntax for defining agents.
Final Answer:
agent any -> Option C
Quick Check:
Correct agent syntax = A [OK]
Hint: Use 'agent any' to run on any available agent [OK]
Common Mistakes:
Using invalid keywords like 'master agent'
Confusing 'node' with 'agent'
Writing 'run agent' which is not valid
3. Given this Jenkins pipeline snippet, what will happen?