After you connect an agent, you can use the SchedulerX console to create scheduled tasks, rerun tasks, view execution history, and check operational logs. This topic describes how to connect non-Java applications to SchedulerX using an agent (provided as a tar package or an image).
Prerequisites
-
(Optional) You have created a namespace. For more information, see Create a namespace.
-
You have created a resource. For more information, see Create a resource.
The agent supports scheduling and execution of DataWorks tasks. For more information, see DataWorks tasks.
Scenarios
Common scenarios for using an agent to connect to SchedulerX include the following:
-
Using a Shell script to periodically clean up logs on all machines or start a service.
-
Using a Python script to periodically clean up historical data in a database.
-
Using an HTTP API to periodically scan orders.
Requirements
The runtime environment requires JRE 1.8 or later.
Manually deploy the agent
-
Download and decompress the agent.
If your machine has a public IP address, run the following command to download the agent:
NoteX.X.X is a placeholder for the version number. Replace it with the version number you need, such as 1.12.5.
wget https://schedulerx2.oss-cn-hangzhou.aliyuncs.com/agent/schedulerxAgent-X.X.X.tarVersion
Download URL
Release notes
Agent 1.13.2
https://schedulerx2.oss-cn-hangzhou.aliyuncs.com/agent/schedulerxAgent-1.13.2.tar.gz
-
New features
-
Supports CPU metric collection under CGroup V2.
-
Supports custom thread pool size for task execution (Parameter key: share.pool.size).
-
Agent 1.12.5
https://schedulerx2.oss-cn-hangzhou.aliyuncs.com/agent/schedulerxAgent-1.12.5.tar
New features:
-
Supports obtaining task system variables using placeholders.
-
Supports custom thread pool size for HTTP tasks.
-
Allows script tasks to return the last line of standard output as the execution result.
Agent 1.11.5
https://schedulerx2.oss-cn-hangzhou.aliyuncs.com/agent/schedulerxAgent-1.11.5.tar
Bug fixes:
-
Fixed security vulnerabilities in Netty and Logback.
-
Fixed the "too old resource version" issue for Kubernetes tasks.
Agent 1.10.13
https://schedulerx2.oss-cn-hangzhou.aliyuncs.com/agent/schedulerxAgent-1.10.13.tar
New features:
-
Supports deploying multiple agents on a single machine.
-
Supports responses larger than 1000 bytes for HTTP agent tasks.
-
Optimized logging to reduce historical log storage.
Agent 1.10.5
https://schedulerx2.oss-cn-hangzhou.aliyuncs.com/agent/schedulerxAgent-1.10.5.tar
New features:
-
Supports graceful shutdown.
-
Simple Log Service supports isolation by application group.
Agent 1.9.8
https://schedulerx2.oss-cn-hangzhou.aliyuncs.com/agent/schedulerxAgent-1.9.8.tar
New features:
-
Supports HTTP tasks in agent mode.
-
Supports returning the last line of the log if a script task fails.
-
Supports Kubernetes tasks.
Agent 1.7.10
https://schedulerx2.oss-cn-hangzhou.aliyuncs.com/agent/schedulerxAgent-1.7.10.tar.gz
Bug fixes:
-
Fixed an issue where second-level tasks run slowly.
-
Fixed an issue where Simple Log Service could cause an out-of-memory (OOM) error.
Agent 1.4.2
https://schedulerx2.oss-cn-hangzhou.aliyuncs.com/agent/schedulerxAgent-1.4.2.tar.gz
New feature: Supports Simple Log Service.
ImportantIf the connection times out when you use the wget command to download the agent, enable a public IP address, or see Upload or download files (Linux).
-
-
Go to the schedulerxAgent/conf directory and configure the agent.properties file.
Configure the following parameters:
endpoint=addr-hz-internal.edas.aliyun.com namespace=fd2965c4-****-****-af52-bb62aa4***** groupId=hxm.test appKey=1234*****-
Endpoint is the endpoint address. For more information, see Endpoint list.
-
namespace is the namespace ID. You can obtain it from the Namespace page.
-
groupId is the application ID, and appKey is the application key. You can obtain them from the Application Management page.
-
-
Go to the schedulerxAgent/bin directory and run the start.sh command to start the agent.
NoteTo set the startup memory for the agent, run
start-200m.sh,start-500m.sh, orstart-1g.sh.During startup, you can perform the following operations:
-
To stop the agent: Go to the schedulerxAgent/bin directory and run stop.sh.
-
To view logs, the log path is ${user.home}/logs/schedulerx/worker.log.
To find the user.home path, run the
ps aux | grep javacommand. For example, if the admin user starts the process, the log path is /home/admin/logs/schedulerx/worker.log. If the root user starts the process, the log path is /root/logs/schedulerx/worker.log.
If the response message contains
Schedulerx Worker started, the agent is deployed successfully.NoteThe runtime environment requires JDK 1.8 to 14. If you use a JDK version later than 14, remove the
-XX:+UseConcMarkSweepGCoption from theschedulerxAgent/bin/start.shfile in the agent installation directory.
-
Deploy the agent using a Docker image
-
Select an image based on your network environment and CPU architecture.
Network
x86_64
arm64
(Public network) China (Hangzhou)
schedulerx-registry.cn-hangzhou.cr.aliyuncs.com/schedulerx2/agent:latest-amd64
schedulerx-registry.cn-hangzhou.cr.aliyuncs.com/schedulerx2/agent:latest-arm64
(Public network) Singapore
schedulerx-registry.ap-southeast-1.cr.aliyuncs.com/schedulerx2/agent:latest-amd64
schedulerx-registry.ap-southeast-1.cr.aliyuncs.com/schedulerx2/agent:latest-arm64
-
Deploy the agent.
Parameter descriptions:
docker run --env SCHEDULERX_ENDPOINT="addr-hz-internal.edas.aliyun.com" \ --env SCHEDULERX_NAMESPACE="fd2965c4-****-****-af52-bb62aa4*****" \ --env SCHEDULERX_GROUPID="hxm.test" \ --env SCHEDULERX_APPKEY="1234*****" \ -d {image id}-
SCHEDULERX_ENDPOINT is the Endpoint.
-
SCHEDULERX_NAMESPACEis the namespace ID. You can obtain it from the Namespace page in the console. -
SCHEDULERX_GROUPIDis the application ID, andSCHEDULERX_APPKEYis the application key. You can obtain them from the Application Management page in the console.
After starting the deployment task, view the logs by running the
docker logscommand. -
Deploy a Deployment using a K8s image
If you have a Kubernetes environment, the easiest way to deploy the agent is to use the schedulerx-agent.yaml file.
|
Variable |
Description |
|
${SCHEDULERX_ENDPOINT} |
The region where your application is deployed and the corresponding Endpoint. For more information, see Endpoint list. Example: |
|
${SCHEDULERX_NAMESPACE} |
The namespace ID. In the console, go to the Namespace page in the navigation pane on the left to obtain the ID.
|
|
${SCHEDULERX_GROUPID} |
The application ID. In the console, go to the Application Management page in the navigation pane on the left to obtain the ID.
|
|
${SCHEDULERX_APPKEY} |
The application key. In the console, go to the Application Management page in the navigation pane on the left to obtain the key.
|


