In Jenkins 2.x, the terminology has been modernized - what was previously called a "Dumb Slave" is now referred to as a "Permanent Agent". This change reflects Jenkins' move toward more inclusive language and better describes the actual functionality.
Here's how to create what you previously knew as a dumb slave:
- Navigate to Manage Jenkins > Manage Nodes and Clouds
- Click New Node
- Enter a node name and select Permanent Agent
- Configure the agent properties:
// Example of node configuration in Jenkinsfile
pipeline {
agent {
label 'your-agent-label'
}
stages {
stage('Example') {
steps {
echo 'Running on the designated agent'
}
}
}
}
When setting up your permanent agent, pay special attention to:
- Remote root directory: Workspace path on the agent machine
- Launch method: Choose between SSH, Java Web Start, or others
- Availability: Set to "Keep this agent online as much as possible"
If your agent fails to connect, verify:
# On Linux agents, check Java version
java -version
# Verify network connectivity from agent to master
ping jenkins-master.example.com
telnet jenkins-master.example.com 8080
For automation purposes, you can create nodes via Jenkins CLI:
java -jar jenkins-cli.jar -s http://your-jenkins/ create-node your-agent-name << EOF
<slave>
<name>your-agent-name</name>
<description>Agent description</description>
<remoteFS>/path/to/workspace</remoteFS>
<numExecutors>2</numExecutors>
<mode>NORMAL</mode>
<launcher class="hudson.slaves.JNLPLauncher" />
</slave>
EOF
- Use labels effectively to organize agents by capability
- Monitor agent load through the Jenkins metrics plugin
- Implement agent provisioning automation for dynamic scaling
If you're coming from older Jenkins versions (pre-2.0), you'll notice the term "Dumb Slave" has been replaced with "Permanent Agent" in the Jenkins UI. This isn't just cosmetic - it reflects architectural changes in how Jenkins handles distributed builds.
The process is essentially the same, just with updated terminology. Here's how to set up what was previously called a "Dumb Slave":
- Navigate to Manage Jenkins > Manage Nodes and Clouds
- Click New Node
- Select Permanent Agent (this is the replacement for "Dumb Slave")
Here's a typical configuration for a Linux agent:
<slave>
<name>linux-build-agent-01</name>
<description>Ubuntu 20.04 build agent</description>
<remoteFS>/var/jenkins</remoteFS>
<numExecutors>2</numExecutors>
<mode>NORMAL</mode>
<retentionStrategy class="hudson.slaves.RetentionStrategy$Always"/>
<launcher class="hudson.slaves.JNLPLauncher"/>
<label>linux ubuntu amd64</label>
<nodeProperties/>
</slave>
Modern Jenkins offers several connection options for agents:
Method | Use Case | Configuration Example |
---|---|---|
Launch agent via Java Web Start | Most common for physical/virtual machines | JNLPLauncher with manual connection |
Launch agent via SSH | For Unix/Linux machines | SSHLauncher with credentials |
Launch via Windows service | For Windows agents | WindowsServiceLauncher |
If you're having trouble connecting your agent:
- Firewall issues: Ensure TCP port 50000 is open between master and agent
- Java version mismatch: Verify consistent Java versions
- Authentication problems: Check credentials and agent JNLP secret
For advanced configuration, you might need to modify the agent's jenkins-agent.xml
:
<service>
<id>jenkins-agent</id>
<name>Jenkins Agent</name>
<description>This service runs a Jenkins agent.</description>
<executable>%BASE%\jre\bin\java.exe</executable>
<arguments>-Xrs -jar "%BASE%\agent.jar" -jnlpUrl http://jenkins-server:8080/computer/agent-name/slave-agent.jnlp -secret your-secret-key</arguments>
</service>