Windows Agent Installation Guide
This document shows how to install and manage the Windows agent for Unmeshed Job Scheduling Platform. The agent is a Java-based application which runs natively on Windows machines and executes the scheduled jobs as configured on the Unmeshed Platform. The integration between agent and Unmeshed platform is protected by an access key and secret and happens over an HTTPS connection.
Prerequisites
Java Runtime Environment (JRE)
The Windows agent requires Java 22 or higher. The agent package includes a bundled JRE in the jdk
folder, which is the recommended approach for consistent operation.
System Requirements
- Windows 10/11 or Windows Server 2016/2019/2022 or newer versions
- Minimum 2GB RAM (4GB recommended)
- At least 4GB free disk space (for logs and temporary files)
- Network access to the Unmeshed platform
- Administrator privileges for service installation
Installation Files
Prerequisites Package: unmeshed-prerequisites.zip
This zip file contains the foundational components required for the agent to operate:
- jdk/ - Java Development Kit folder containing the bundled JRE
- worker-logback.xml - Logging configuration for the worker processes
- start_agent.bat - Batch script to start the agent
Agent Binary Package: unmeshed-agent.zip
This zip file contains the main agent execution files:
- workers.jar - Main worker execution engine (will be created/updated)
Download Links
Contact your Unmeshed support team to request download links for the following agent packages:
unmeshed-prerequisites.zip
- Prerequisites packageunmeshed-agent.zip
- Agent binary package
Installation
The installation process involves two main steps: installing prerequisites and then the agent binary. We'll use C:\unmeshed\agent\
as the installation directory.
Step 1: Install Prerequisites
-
Create the installation directory:
mkdir C:\unmeshed\agent
cd C:\unmeshed\agent -
Download and extract the prerequisites package:
# Download the prerequisites zip file
# Extract the contents using Windows Explorer or command line
# Right-click the zip file and select "Extract All" or use:
powershell Expand-Archive -Path unmeshed-prerequisites.zip -DestinationPath C:\unmeshed\agent
# Verify the extraction
dirYou should see the following files and directories:
Directory of C:\unmeshed\agent
jdk/ <DIR>
worker-logback.xml
start_agent.bat
Install Agent Binary
-
Download and extract the agent binary package:
# Download the agent binary zip file
# Extract the contents (this will create/update workers.jar)
powershell Expand-Archive -Path unmeshed-agent.zip -DestinationPath C:\unmeshed\agent
# Verify the extraction
dir *.jarYou should see:
workers.jar
Configuration
Configure the Agent
In Windows, you configure the agent by editing the start_agent.bat
file. This file contains all the necessary environment variables and Java settings.
Edit the start_agent.bat
file:
notepad start_agent.bat
The file should contain the following content with your specific values:
@echo off
setlocal enabledelayedexpansion
echo Running as user: %USERNAME%
echo Current directory: %CD%
echo PATH: %PATH%
rem Set current directory
set CURRENT_DIR=C:\unmeshed\agent
rem Set Java home to use bundled JDK
set JAVA_HOME=%CURRENT_DIR%\jdk
set PATH=%JAVA_HOME%\bin;%PATH%
rem Set Java options
set JAVA_OPTS=-Xms1024m -Xmx1500m
rem Set required environment variables
set UNMESHED_AUTH_ID=<< your auth id >>
set UNMESHED_AUTH_TOKEN=<< your auth token >>
set UNMESHED_ENABLE_FILE_WATCHER=false
set UNMESHED_ENGINE_URL=<< your engine url >>
set UNMESHED_FILE_WATCHER_MAX_CONCURRENT_WORKERS=10
set UNMESHED_CMD_CUSTOM_WORKERS=
set UNMESHED_CMD_MAX_CONCURRENT_WORKERS=1000
rem Check if Java is accessible
where java >nul 2>&1
if errorlevel 1 (
echo Error: Java not found in PATH
exit /b 1
)
rem Start the application
echo Starting workers.jar...
java %JAVA_OPTS% -jar "%CURRENT_DIR%\workers.jar" > "%CURRENT_DIR%\workers.log" 2>&1
Configuration Parameters
Field | Description |
---|---|
JAVA_HOME | Points to the bundled JDK in C:\unmeshed\agent\jdk |
PATH | Updated to include the bundled JDK bin directory |
JAVA_OPTS | JVM memory settings (-Xms1024m for minimum, -Xmx1500m for maximum heap) |
UNMESHED_AUTH_ID | Your authentication ID from the Unmeshed Platform |
UNMESHED_AUTH_TOKEN | Your authentication token from the Unmeshed Platform |
UNMESHED_ENGINE_URL | HTTPS URL for your Unmeshed server |
UNMESHED_CMD_CUSTOM_WORKERS | Advanced Configuration: Comma-separated list of custom worker specifications in the format namespace:name:maxConcurrentWorkers:false Example: default:custom-cmd:50,prod:high-priority:100 Format: Each specification contains 4 parts separated by colons: - namespace : The namespace for this worker (e.g., "default", "prod")- name : The worker name identifier- maxConcurrentWorkers : Maximum number of concurrent jobs this worker can handle- ioThread : Must be set to false for Windows agents (required parameter)Default Behavior: If left empty, the agent registers a default cmd worker under the "default" namespace with the name "cmd" |
UNMESHED_CMD_MAX_CONCURRENT_WORKERS | Maximum number of concurrent cmd commands that can be executed simultaneously |
UNMESHED_ENABLE_FILE_WATCHER | Enable/disable file watching capabilities |
UNMESHED_FILE_WATCHER_MAX_CONCURRENT_WORKERS | Maximum concurrent file watcher workers |
UNMESHED_CMD_CUSTOM_WORKERS Configuration
The UNMESHED_CMD_CUSTOM_WORKERS
parameter allows you to create multiple custom cmd workers with different configurations. This is useful when you need different concurrency limits or want to separate workloads by namespace.
For Windows agents, the ioThread
parameter must always be set to false
.
Format
Each worker specification follows the format: namespace:name:maxConcurrentWorkers:false
- namespace: The namespace for this worker (e.g., "default", "prod", "dev")
- name: The worker name identifier that will be used in job definitions
- maxConcurrentWorkers: Maximum number of concurrent jobs this worker can handle
- ioThread: Must be set to
false
for Windows agents (required parameter)
Examples
Single Custom Worker:
set UNMESHED_CMD_CUSTOM_WORKERS=prod:high-priority-cmd:100:false
This configuration will query for jobs in the prod
namespace with the name high-priority-cmd
and can run up to 100 concurrent tasks.
Multiple Custom Workers:
set UNMESHED_CMD_CUSTOM_WORKERS=default:standard-cmd:50:false,prod:high-priority-cmd:100:false,dev:testing-cmd:25:false
This configuration creates three workers:
default:standard-cmd:50:false
- Namespacedefault
, jobs namedstandard-cmd
, concurrency of 50prod:high-priority-cmd:100:false
- Namespaceprod
, jobs namedhigh-priority-cmd
, concurrency of 100dev:testing-cmd:25:false
- Namespacedev
, jobs namedtesting-cmd
, concurrency of 25
No Custom Workers (Default):
set UNMESHED_CMD_CUSTOM_WORKERS=
# This registers a default cmd worker under "default" namespace with name "cmd"
Naming Recommendations
Use descriptive names that represent your host machine's purpose:
- Environment-based:
prod-web-server-cmd
,staging-db-cmd
,dev-testing-cmd
- Function-based:
batch-processing-cmd
,real-time-cmd
,backup-server-cmd
- Location-based:
us-east-1-cmd
,eu-west-1-cmd
,on-premise-cmd
Why unique names matter:
Using unique, descriptive names ensures that specific jobs will always run on the intended machine. For example, if you have a backup server with set UNMESHED_CMD_CUSTOM_WORKERS=default:backup-server-cmd:10:false
, only jobs defined with the name backup-server-cmd
in the default
namespace will be executed on that machine.
Windows Service Setup
Using Windows Task Scheduler (Recommended)
Windows Task Scheduler is the native Windows solution and is recommended for most users. It's easier to set up and manage than third-party tools.
-
Open Task Scheduler:
- Press
Win + R
, typetaskschd.msc
, and press Enter - Or search for "Task Scheduler" in the Start menu
- Press
-
Create Basic Task:
- Right-click on "Task Scheduler Library" → "Create Basic Task"
- Name: "Unmeshed Agent"
- Description: "Starts the Unmeshed agent on system startup"
- Click "Next"
-
Set Trigger:
- Select "When the computer starts up"
- Click "Next"
-
Set Action:
- Select "Start a program"
- Click "Next"
-
Configure Program:
- Program/script:
C:\unmeshed\agent\start_agent.bat
- Start in:
C:\unmeshed\agent
- Click "Next"
- Program/script:
-
Finish Setup:
- Review your settings
- Check "Open the Properties dialog for this task when I click Finish"
- Click "Finish"
-
Configure Advanced Properties:
- In the Properties dialog, go to the "General" tab
- Check "Run with highest privileges"
- Go to the "Settings" tab
- Check "Allow task to be run on demand"
- Check "Run task as soon as possible after a scheduled start is missed"
- Click "OK"
Verify Task Scheduler Setup
# Check if the task is created
schtasks /query /tn "Unmeshed Agent"
# Check if Java process is running
tasklist /fi "imagename eq java.exe"
# Check agent logs
type C:\unmeshed\agent\workers.log
Verification
Check Agent Logs
The agent creates logs in the working directory. Look for the following log entry to confirm successful startup:
type C:\unmeshed\agent\workers.log
You should see a log entry similar to:
[date - time] [pool-3-thread-1] INFO io.unmeshed.client.UnmeshedClient - Currently running
Check Process Status
# Check if Java process is running
tasklist /fi "imagename eq java.exe"
# Check Windows Event Viewer for any service errors
eventvwr.msc
Operating the Unmeshed Agent
Service Management Commands
# Start the agent (if using Task Scheduler)
schtasks /run /tn "Unmeshed Agent"
# Stop the agent (if using Task Scheduler)
taskkill /f /im java.exe
# Check task status
schtasks /query /tn "Unmeshed Agent"
Manual Process Management
If you need to run the agent manually (for debugging purposes):
cd C:\unmeshed\agent
start_agent.bat
Upgrading the Unmeshed Agent
Follow these steps to upgrade:
-
Stop the agent:
taskkill /f /im java.exe
-
Download and extract the new agent binary:
cd C:\unmeshed\agent
# Download and extract unmeshed-agent.zip -
Start the agent:
schtasks /run /tn "Unmeshed Agent"
-
Verify the upgrade:
schtasks /query /tn "Unmeshed Agent"
type C:\unmeshed\agent\workers.log
Troubleshooting
Common Issues
-
Service fails to start:
- Check file permissions:
dir C:\unmeshed\agent
- Verify Java installation:
java -version
- Check Windows Event Viewer for errors
- Check file permissions:
-
Agent cannot connect to Unmeshed platform:
- Verify network connectivity:
ping <your-unmeshed-server>
- Check authentication credentials in
start_agent.bat
- Verify firewall settings
- Verify network connectivity:
-
Permission denied errors:
- Ensure the service user has access to
C:\unmeshed\agent
- Check file permissions:
C:\unmeshed\agent
- Ensure the service user has access to
-
Java memory issues:
- Adjust JVM memory settings in
start_agent.bat
:-Xms1024m
(minimum heap size)-Xmx1500m
(maximum heap size)
- Adjust JVM memory settings in
Log Analysis
The agent creates several log files:
- workers.log - Main worker process logs
- Windows Event Viewer - Service management logs
# View worker logs
type C:\unmeshed\agent\workers.log
# Search for specific errors
findstr /i "error" C:\unmeshed\agent\workers.log
Security Considerations
- File Permissions: Ensure only authorized users can access the agent configuration files
- Network Security: Use HTTPS connections to the Unmeshed platform
- Authentication: Keep your auth ID and token secure and rotate them regularly
- Service User: Run the service with minimal required privileges
- Firewall: Configure firewall rules to allow only necessary outbound connections
Performance Tuning
Memory Configuration
Adjust JVM memory settings based on your system resources:
set JAVA_OPTS=-Xms2048m -Xmx4096m
Concurrency Settings
Adjust based on your system's CPU cores and workload:
UNMESHED_CMD_MAX_CONCURRENT_WORKERS: 2000
Batch Processing
Optimize network communication:
UNMESHED_WORK_RESPONSE_BATCH_SIZE: 200
FAQs & Notes
- Service Auto-restart: Configure the Windows service to automatically restart if the process crashes
- Log Rotation: Consider implementing log rotation for long-running deployments
- Monitoring: Set up monitoring for the service status and resource usage
- Backup: Regularly backup your
start_agent.bat
configuration file - Updates: Keep your Windows system updated for security patches
- Resource Monitoring: Monitor CPU, memory, and disk usage during operation
Alternative: Using NSSM (Advanced Users)
For users who prefer a service style manager, you can use NSSM (Non-Sucking Service Manager).
NSSM Installation
-
Download NSSM from https://nssm.cc/download
-
Install the service:
# Run as Administrator
nssm install UnmeshedAgent "C:\unmeshed\agent\start_agent.bat"
nssm set UnmeshedAgent AppDirectory "C:\unmeshed\agent"
nssm set UnmeshedAgent Description "Unmeshed Agent Service"
nssm set UnmeshedAgent Start SERVICE_AUTO_START
nssm set UnmeshedAgent AppStopMethodSkip 0
nssm set UnmeshedAgent AppStopMethodConsole 1500
nssm set UnmeshedAgent AppStopMethodWindow 1500
nssm set UnmeshedAgent AppStopMethodThreads 1500 -
Additional NSSM Settings (Optional but Recommended):
# Set service to restart on failure
nssm set UnmeshedAgent AppRestartDelay 10000
# Set service account (optional - uses Local System by default)
# nssm set UnmeshedAgent ObjectName ".\username" "password"
# View all current settings
nssm dump UnmeshedAgent
Verify NSSM Service
# Check if service is running
sc query UnmeshedAgent
# Check if process is running
tasklist /fi "imagename eq java.exe"
# Check agent logs
type C:\unmeshed\agent\workers.log
NSSM Service Management
# Start the service
net start UnmeshedAgent
# Stop the service
net stop UnmeshedAgent
# Check service status
sc query UnmeshedAgent