Command Runners (Agents)
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:
cmd -
Download and extract the prerequisites package:
cmdYou should see the following files and directories:
Install Agent Binary
-
Download and extract the agent binary package:
cmdYou should see:
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:
The file should contain the following content with your specific values:
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:falseExample: default:custom-cmd:50,prod:high-priority:100Format: 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.
:::note
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
falsefor Windows agents (required parameter)
Examples
Single Custom Worker:
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:
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):
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
Verification
Check Agent Logs
The agent creates logs in the working directory. Look for the following log entry to confirm successful startup:
You should see a log entry similar to:
Check Process Status
Operating the Unmeshed Agent
Service Management Commands
Manual Process Management
If you need to run the agent manually (for debugging purposes):
Upgrading the Unmeshed Agent
Follow these steps to upgrade:
-
Stop the agent:
cmd -
Download and extract the new agent binary:
cmd -
Start the agent:
cmd -
Verify the upgrade:
cmd
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
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:
Concurrency Settings
Adjust based on your system's CPU cores and workload:
Batch Processing
Optimize network communication:
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.batconfiguration 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:
cmd -
Additional NSSM Settings (Optional but Recommended):
cmd