Microservices Engine (MSE) lets you write and modify scripts and SQL directly in the console, then schedule and run them on remote machines. To execute these tasks, you deploy a lightweight agent (executor) on an Elastic Compute Service (ECS) instance or container, which connects to your MSE-XXLJOB instance and receives task assignments.
This guide walks you through deploying the agent using an installation package, Docker, or Kubernetes.

How it works
Three components work together to schedule and run tasks:
| Component | Role | Key identifier |
|---|---|---|
| Application | A logical group registered in the MSE console. Tasks and executors are organized under applications. | AppName, AccessToken |
| Agent (executor) | A process deployed on your machine that polls the admin server for tasks and runs them. | Configured with AppName and AccessToken |
| Admin server | The MSE-XXLJOB control plane that dispatches tasks to connected agents. | Service registration address |
When the agent starts, it registers with the admin server using the configured AppName and AccessToken. Once connected, it receives and runs tasks assigned to its application, including Shell scripts, Python, Node.js, Go, SQL, and big data jobs.
Configuration reference
All three deployment methods use the same parameters. The following table maps each parameter across configuration methods.
| Parameter | YAML key (application.yml) | Environment variable | Description | Where to find it |
|---|---|---|---|---|
| Service registration address | xxl.job.admin-addresses | SCHEDULERX3_ADMIN_ADDRESSES | Admin server URL that the agent connects to | Instance details page in the MSE console |
| Application AppName | xxl.job.executor.appname | SCHEDULERX3_EXECUTOR_APPNAME | Identifier for the application | Application Management page |
| Application AccessToken | xxl.job.access-token | SCHEDULERX3_ACCESS_TOKEN | Authentication token for executor registration | Application Management page |
| JVM options | N/A (set via JAVA_OPTS) | JAVA_OPTS | JVM memory and GC settings | N/A |
Create a regular application
Before deploying the agent, create an application in the MSE console to register your executor against.
Log on to the XXL-JOB console and select a region in the top menu bar.
Click the target instance to open the instance details page.
In the left-side navigation pane, choose Application Management, and then click Create Application.
Set Application Type to Regular Application, configure other parameters as needed, and click OK.
After the application is created, note the AppName, AccessToken, and the service registration address from the instance details page. You need these values to configure the agent.
Deploy the agent
Choose one of the following deployment methods based on your environment.
Deploy with an installation package
This method installs the agent directly on a Linux, Mac, or Windows machine.
Prerequisites
JDK 17 or later
Step 1: Download and extract the package
wget https://schedulerx3.oss-cn-hangzhou.aliyuncs.com/xxljob/schedulerx3-agent-1.0.0-bin.tar.gz
tar -zxvf schedulerx3-agent-1.0.0-bin.tar.gz
cd schedulerx3-agent-1.0.0-binDirectory structure after extraction:
schedulerx3-worker-2.4.2-jdk17-bin/
├── bin/ # Startup and management scripts
├── conf/ # Configuration files
│ ├── application.yml # Application configuration
│ └── logback-spring.xml # Log configuration
├── lib/ # Dependency JARs
└── logs/ # Log output (created at runtime)Step 2: Configure the agent
Edit conf/application.yml with your MSE-XXLJOB instance details:
xxl:
job:
admin-addresses: <service-registration-address>
access-token: <application-access-token>
executor:
appname: <application-app-name>Replace the placeholders with values from the MSE console:
| Placeholder | Description | Example |
|---|---|---|
<service-registration-address> | Admin server URL from the instance details page | http://192.168.x.x:8080/xxl-job-admin |
<application-access-token> | AccessToken from the Application Management page | xXxXxXx |
<application-app-name> | AppName from the Application Management page | my-executor |
Step 3: Start the agent
Linux/Mac
# Start in the background
./bin/start.sh
# Start in the foreground (for debugging)
./bin/start.sh -f
# Stop
./bin/stop.sh
# Restart
./bin/restart.sh
# Check status
./bin/status.sh
# View logs
tail -f logs/worker.logWindows
REM Start in the background
.\bin\start.cmd
REM Start in the foreground (for debugging)
.\bin\start.cmd -f
REM Stop
.\bin\stop.cmd
REM Restart
.\bin\restart.cmd
REM Check status
.\bin\status.cmd
REM View logs
type logs\worker.logStep 4: Verify the connection
After starting the agent, confirm that it connected successfully:
Check
logs/worker.logfor a registration success message.In the MSE console, go to Application Management and verify that the executor appears under your application.
If the executor does not appear, check the following:
The service registration address, AppName, and AccessToken are correct.
The machine can reach the admin server URL over the network.
Port 9999 is open for inbound connections from the admin server.
(Optional) Configure logging
Log files are stored in the logs/ directory. Task execution logs default to ${user.home}/applogs/xxl-job/jobhandler.
| Log file | Description | Rolling policy |
|---|---|---|
stdout.log | Standard output (startup log) | Script redirection |
stderr.log | Standard error (exception stacks) | Script redirection |
worker.log | Application log (INFO and above) | 100 MB per file, retained for 30 days |
error.log | Error log (ERROR level) | 50 MB per file, retained for 60 days |
gc.log | Garbage collection log | JVM parameter settings |
heap_dump.hprof | Heap dump (generated on OOM) | -- |
archive/ | Archived logs (auto-compressed to .gz) | -- |
To adjust log levels, edit conf/logback-spring.xml:
<!-- Change the root log level -->
<root level="INFO">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</root>
<!-- Set a package-specific log level -->
<logger name="com.aliyun.schedulerx" level="DEBUG" />
<logger name="com.xxl.job" level="DEBUG" />(Optional) Tune JVM parameters
Adjust JVM memory based on your workload.
Linux/Mac
# Set temporarily for a single run
JAVA_OPTS="-Xms2g -Xmx4g" ./bin/start.sh
# Set permanently
vim bin/start.sh # Edit the JAVA_OPTS variableWindows
REM Set temporarily for a single run
set JAVA_OPTS=-Xms2g -Xmx4g
.\bin\start.cmd
REM Set permanently
notepad bin\start.cmd REM Edit the JAVA_OPTS variableDeploy with Docker
Method 1: Use the public image
The public image includes pre-installed Python, Node.js, and Go runtimes for script tasks:
# Pull the image
docker pull schedulerx-registry.cn-hangzhou.cr.aliyuncs.com/schedulerx3/schedulerx3-agent:1.0.0
# Run the agent
docker run -d \
--name schedulerx3-agent \
-p 9999:9999 \
-e JAVA_OPTS="-Xms1g -Xmx2g" \
-e SCHEDULERX3_ADMIN_ADDRESSES="<service-registration-address>" \
-e SCHEDULERX3_EXECUTOR_APPNAME="<application-app-name>" \
-e SCHEDULERX3_ACCESS_TOKEN="<application-access-token>" \
-v $(pwd)/logs:/opt/schedulerx3-agent/logs \
--restart unless-stopped \
schedulerx-registry.cn-hangzhou.cr.aliyuncs.com/schedulerx3/schedulerx3-agent:1.0.0Keep the AccessToken secure. Do not hardcode it in scripts shared with others. For production deployments, use a secrets manager or environment variable injection.
After the container starts, verify the connection in the MSE console under Application Management.
Method 2: Build a custom image from the tar package
If your tasks require additional dependencies or a custom base image, build your own Docker image:
# Download the installation package
wget https://schedulerx3.oss-cn-hangzhou.aliyuncs.com/xxljob/schedulerx3-agent-1.0.0-bin.tar.gz
# Build the image
docker build -t schedulerx3-agent:1.0.0 -f Dockerfile .Sample Dockerfile:
################################################################################
### Customize this Dockerfile to install components your tasks require.
################################################################################
# Use your preferred base image with JDK 17+
FROM hub.docker.xxx.com/library/openjdk:17.0.1-jdk-bullseye
LABEL maintainer="SchedulerX Team"
LABEL description="SchedulerX3 Agent - XXL-Job Executor"
LABEL version="2.4.2"
# Configure Alibaba Cloud mirror sources
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list && \
sed -i 's|security.debian.org/debian-security|mirrors.aliyun.com/debian-security|g' /etc/apt/sources.list
# Install Python 3, Node.js, and Go
RUN apt-get update && \
apt-get install -y python3 python3-distutils curl wget ca-certificates nodejs npm golang-go && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install pip
RUN curl https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py && \
python3 /tmp/get-pip.py && \
rm -f /tmp/get-pip.py && \
ln -sf /usr/bin/python3 /usr/bin/python
# Set Go environment variables
ENV GOPATH=/root/go
ENV PATH=$GOPATH/bin:$PATH
ENV GO111MODULE=on
# Extract the agent package
COPY schedulerx3-agent-*-bin.tar.gz /tmp/schedulerx3-agent.tar.gz
RUN mkdir -p /opt/schedulerx3-agent && \
tar -xzf /tmp/schedulerx3-agent.tar.gz --strip-components=1 -C /opt/schedulerx3-worker && \
chmod +x /opt/schedulerx3-agent/bin/*.sh && \
mkdir -p /opt/schedulerx3-agent/logs && \
rm -f /tmp/schedulerx3-agent.tar.gz
WORKDIR /opt/schedulerx3-agent
EXPOSE 9999
CMD ["bin/start.sh", "-f"]Deploy on Kubernetes
Create a
schedulerx3-agent.yamldeployment manifest:NoteFor production deployments, store the AccessToken in a Kubernetes Secret rather than in the deployment manifest directly.
apiVersion: apps/v1 kind: Deployment metadata: name: schedulerx3-agent labels: app: schedulerx3-agent spec: replicas: 1 selector: matchLabels: app: schedulerx3-agent template: metadata: labels: app: schedulerx3-agent spec: containers: - name: schedulerx3-agent image: schedulerx-registry.cn-hangzhou.cr.aliyuncs.com/schedulerx3/schedulerx3-agent:1.0.0 imagePullPolicy: Always ports: - containerPort: 9999 env: - name: "SCHEDULERX3_ADMIN_ADDRESSES" value: "<service-registration-address>" - name: "SCHEDULERX3_EXECUTOR_APPNAME" value: "<application-app-name>" - name: "SCHEDULERX3_ACCESS_TOKEN" value: "<application-access-token>" livenessProbe: tcpSocket: port: 9999 timeoutSeconds: 30 initialDelaySeconds: 30Apply the deployment:
kubectl apply -f schedulerx3-agent.yamlVerify the pod is running: After the pod reaches
Runningstatus, confirm the agent appears in the MSE console under Application Management.kubectl get pods -l app=schedulerx3-agent
Create and run a task
After the agent connects, create a task to verify the setup.
On the instance details page, in the left-side navigation pane, choose Task > Task Management.
Click Create Task and configure the following settings. This example uses a Shell script task:
Set Associated Application to the regular application you created.
Set Task Type to Shell.
NoteIf the agent runs on a Unix/Linux system, set File Format to Unix.
On the Task Management page, click Run Once in the Actions column to run a test execution.
In the left-side navigation pane, choose Task Instances to view execution records. Click Log to view the detailed output.