All Products
Search
Document Center

SchedulerX:Connect using an agent (for script or HTTP tasks)

Last Updated:Mar 01, 2026

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

Note

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

  1. Download and decompress the agent.

    If your machine has a public IP address, run the following command to download the agent:

    Note

    X.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.tar

    Version

    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:

    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.

    Important

    If 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).

  2. 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.

  3. Go to the schedulerxAgent/bin directory and run the start.sh command to start the agent.

    Note

    To set the startup memory for the agent, run start-200m.sh, start-500m.sh, or start-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 java command. 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.

    Note

    The runtime environment requires JDK 1.8 to 14. If you use a JDK version later than 14, remove the -XX:+UseConcMarkSweepGC option from the schedulerxAgent/bin/start.sh file in the agent installation directory.

    image

Deploy the agent using a Docker image

  1. 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

  2. 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_NAMESPACE is the namespace ID. You can obtain it from the Namespace page in the console.

    • SCHEDULERX_GROUPID is the application ID, and SCHEDULERX_APPKEY is 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 logs command.

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.

Sample code for schedulerx-agent.yaml:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: schedulerx-agent
  labels:
    app: schedulerx-agent
spec:
  replicas: 1
  selector:
    matchLabels:
      app: schedulerx-agent
  template:
    metadata:
      labels:
        app: schedulerx-agent
    spec:
      containers:
      - name: schedulerx-agent
        image: schedulerx-registry.cn-hangzhou.cr.aliyuncs.com/schedulerx2/agent:latest-amd64
        imagePullPolicy: Always
        resources:
          requests:
            cpu: 500m
        env:
          - name: "SCHEDULERX_ENDPOINT"
            value: "${SCHEDULERX_ENDPOINT}"
          - name: "SCHEDULERX_NAMESPACE"
            value: "${SCHEDULERX_NAMESPACE}"
          - name: "SCHEDULERX_GROUPID"
            value: "${SCHEDULERX_GROUPID}"
          - name: "SCHEDULERX_APPKEY"
            value: "${SCHEDULERX_APPKEY}"
          - name: "SCHEDULERX_STARTER_MODE"
            value: "pod"
        livenessProbe: 
          exec: 
            command: ["/bin/bash","/root/health.sh"]
          timeoutSeconds: 30
          initialDelaySeconds: 30

Variable

Description

${SCHEDULERX_ENDPOINT}

The region where your application is deployed and the corresponding Endpoint. For more information, see Endpoint list. Example: addr-sh-internal.edas.aliyun.com.

${SCHEDULERX_NAMESPACE}

The namespace ID. In the console, go to the Namespace page in the navigation pane on the left to obtain the ID.

image

${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.

image.png

${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.

image