How to Set Up Jenkins Master and Slave Nodes on Windows Servers
This guide walks through preparing two servers, installing Jenkins on a master node, configuring security and communication, adding a slave node with detailed parameters, deploying the slave agent as a Windows service, creating a slave-bound project, and troubleshooting common issues such as permission errors and network mismatches.
1. Environment Preparation
Prepare two servers: the first will be the Jenkins master server, and the second will be the Jenkins slave server.
2. Deploy Master Server
Install the Jenkins program on the master server (standard installation, details omitted).
2.1 Set Communication Method Between Master and Slave
Log in to Jenkins, go to Manage Jenkins → Configure Global Security, enable security, and set the TCP port for JNLP agents to Random .
2.2 Add Slave Configuration
In Jenkins, navigate to Manage Jenkins → Manage Nodes and click "New Node" to create a permanent agent.
Enter the node name, select Permanent Agent , and click OK.
Fill in the following parameters:
Name : the node's name.
Description : purpose of the node.
# of executors : number of concurrent tasks (usually equal to CPU threads).
Remote root directory : Jenkins root directory on the slave.
Labels : custom label used later in job configuration.
Usage : node usage strategy.
Launch method : for Windows, choose "Launch agent via Java Web Start".
Availability : policy controlling whether the slave is online.
3. Deploy Slave Server
Install JDK on the slave machine.
Open the Jenkins URL of the master in a browser, locate the previously created slave node, and click the Launch button.
The launcher will install a small program; when it shows "Connected", the master and slave are linked.
Install this program as a Windows Service (File → "Install as a service"); the service will start automatically on boot.
Refresh the slave page in Jenkins; it should display as connected.
At this point, a Jenkins system consisting of one master and one slave is set up.
Note: When the slave runs as a Windows Service, the browser window does not appear during automated builds; the build runs in the background.
4. Create Slave Project
Check "Restrict where this project can be run" and enter the label defined in the slave configuration.
5. Common Issues
5.1 "vmi denied" error when installing Windows Service
The error indicates insufficient permissions for the current Windows account. Verify by running net start winmgmt ; error 5 confirms the issue.
Solution:
Open the registry.
Navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA .
Set the value of EnableLUA to 0 .
Reboot the slave machine.
5.2 Master and slave not on the same subnet
Set Jenkins Location (Manage Jenkins → System) to the external IP and port.
After mapping the port to the external network, restart the slave agent; it should connect successfully.
FunTester original recommendation series: 900 Original Collection 2021 Original Collection 2022 Original Collection API Testing Topics Performance Testing Topics Groovy Topics Unit Testing & White-box FunTester Community Highlights -- By FunTester
FunTester
10k followers, 1k articles | completely useless
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.