更新时间:2025-12-24 GMT+08:00
分享

Superior Scheduler REST API接口介绍

Superior Scheduler接口简介

REST/HTTP是Superior Scheduler在YARN资源管理器主机和YARN资源管理网络服务端口的一部分,通常以“Resource Manager实例IP地址:端口”的形式连接YARN。

在开启了Kerberos认证的安全模式MRS集群中,使用HTTPS作为URL的一部分,并且只有HTTPS将得到支持。

查询Application

  • 查询Scheduler Engine中的所有应用程序。
    • URL

      GET https://<SS_REST_SERVER>/ws/v1/sscheduler/applications/list

      “SS_REST_SERVER”格式:ResourceManager IP地址:端口

      • ResourceManager IP地址可登录FusionInsight Manager界面,选择“集群 > 服务 > Yarn > 实例”查看任一ResourceManager实例的IP地址获取。
      • ResourceManager的HTTPS连接端口,可登录FusionInsight Manager界面,选择“集群 > 服务 > Yarn > 配置 > 全部配置”搜索并查看“yarn.resourcemanager.webapp.https.port”参数值获取。
    • 输入

    • 输出
      {
        "applicationlist": [
          {
            "id": "application_1766471968100_0009",
            "queue": "root.default",
            "user": "abc",
            "queueUser": "abc",
            "resource_request": {
              "memory": 36864,
              "vcores": 9
            },
            "number_running_container": 12,
            "resource_inuse": {
              "memory": 46952,
              "vcores": 12
            },
            "resource_reserved": {
              "memory": 2560,
              "vcores": 3
            },
            "number_pending_request": 9,
            "number_reserved_container": 3
          }
        ]
      }
    表1 查询应用程序参数

    参数属性

    参数类型

    参数描述

    id

    String

    应用程序ID信息。

    queue

    String

    应用程序队列名称。

    user

    String

    提交应用程序的用户名称。

    resource_request

    object

    当前所需要的资源,包括vcores、内存等。

    resource_inuse

    object

    当前所使用的资源,包括vcores、内存等。

    resource_reserved

    object

    当前所预留的资源,包括vcores、内存等。

    number_running_container

    int

    正在运行的container的总数,这反映了Superior引擎的判定数量。

    number_pending_request

    int

    挂起申请的总数,这是所有分配请求总和。

    number_reserved_container

    int

    预留container的总数,这反映了superior引擎的判定数量。

  • 查询Scheduler Engine中的单个应用程序。
    • URL

      GET https://<SS_REST_SERVER>/ws/v1/sscheduler/applications/{application_id}

    • 输入

    • 输出
      {
        "application": {
          "id": "application_1766471968100_0009",
          "queue": "root.default",
          "user": "abc",
          "resource_request": {
            "memory": 36864,
            "vcores": 9
          },
          "resource_inuse": {
            "memory": 46952,
            "vcores": 12
          },
          "resource_reserved": {
            "memory": 2560,
            "vcores": 3
          },
          "number_pending_request": 9,
          "number_reserved_container": 3,
          "number_running_container": 12,
          "master_container": {
            "id": "container_1766471968100_0009_01_000001",
            "container_resource": "node-group-1NRcB.mrs-fbm3.com"
          },
          "demand": {
            "priority": 20,
            "is_master": false,
            "capability": {
              "memory": 4096,
              "vcores": 1
            },
            "count": 9,
            "relax_locality": true,
            "locality": [
              {
                "count": 9,
                "strict": true,
                "target": "node-group-1NRcB.mrs-fbm3.com"
              },
              {
                "count": 9,
                "strict": true,
                "target": "node-group-1LUyF.mrs-fbm3.com"
              },
              {
                "count": 9,
                "strict": true,
                "target": "/default/rack0"
              },
              {
                "count": 9,
                "strict": true,
                "target": "node-group-1QBEY.mrs-fbm3.com"
              }
            ],
            "resource_select": "",
            "pending_reason": "Not enough resource quota to access"
          },
          "reservations": [
            {
              "id": "container_1766471968100_0009_01_000013",
              "reserve_amount": {
                "memory": 2560,
                "vcores": 1
              },
              "resource": "node-group-1NRcB.mrs-fbm3.com"
            },
            {
              "id": "container_1766471968100_0009_01_000015",
              "reserve_amount": {
                "memory": 0,
                "vcores": 1
              },
              "resource": "node-group-1QBEY.mrs-fbm3.com"
            },
            {
              "id": "container_1766471968100_0009_01_000014",
              "reserve_amount": {
                "memory": 0,
                "vcores": 1
              },
              "resource": "node-group-1LUyF.mrs-fbm3.com"
            }
          ],
          "containers": [
            {
              "capability": {
                "memory": 4096,
                "vcores": 1
              },
              "id": "container_1766471968100_0009_01_000010",
              "resource": "node-group-1NRcB.mrs-fbm3.com"
            },
            {
              "capability": {
                "memory": 4096,
                "vcores": 1
              },
              "id": "container_1766471968100_0009_01_000011",
              "resource": "node-group-1LUyF.mrs-fbm3.com"
            },
            {
              "capability": {
                "memory": 4096,
                "vcores": 1
              },
              "id": "container_1766471968100_0009_01_000012",
              "resource": "node-group-1QBEY.mrs-fbm3.com"
            },
            {
              "capability": {
                "memory": 4096,
                "vcores": 1
              },
              "id": "container_1766471968100_0009_01_000002",
              "resource": "node-group-1QBEY.mrs-fbm3.com"
            },
            {
              "capability": {
                "memory": 4096,
                "vcores": 1
              },
              "id": "container_1766471968100_0009_01_000003",
              "resource": "node-group-1LUyF.mrs-fbm3.com"
            },
            {
              "capability": {
                "memory": 4096,
                "vcores": 1
              },
              "id": "container_1766471968100_0009_01_000004",
              "resource": "node-group-1QBEY.mrs-fbm3.com"
            },
            {
              "capability": {
                "memory": 4096,
                "vcores": 1
              },
              "id": "container_1766471968100_0009_01_000005",
              "resource": "node-group-1LUyF.mrs-fbm3.com"
            },
            {
              "capability": {
                "memory": 4096,
                "vcores": 1
              },
              "id": "container_1766471968100_0009_01_000006",
              "resource": "node-group-1NRcB.mrs-fbm3.com"
            },
            {
              "capability": {
                "memory": 4096,
                "vcores": 1
              },
              "id": "container_1766471968100_0009_01_000007",
              "resource": "node-group-1LUyF.mrs-fbm3.com"
            },
            {
              "capability": {
                "memory": 4096,
                "vcores": 1
              },
              "id": "container_1766471968100_0009_01_000008",
              "resource": "node-group-1QBEY.mrs-fbm3.com"
            },
            {
              "capability": {
                "memory": 4096,
                "vcores": 1
              },
              "id": "container_1766471968100_0009_01_000009",
              "resource": "node-group-1NRcB.mrs-fbm3.com"
            },
            {
              "capability": {
                "memory": 15360,
                "vcores": 1
              },
              "id": "container_1766471968100_0009_01_000001",
              "resource": "node-group-1NRcB.mrs-fbm3.com"
            }
          ]
        }
      }
    • 异常

      未找到应用程序。

    表2 查询指定应用程序参数

    参数属性

    参数类型

    参数描述

    application

    object

    应用程序对象。

    id

    String

    应用程序ID信息。

    queue

    String

    应用程序队列名称。

    user

    String

    应用程序的用户名称。

    resource_request

    object

    当前所申请的资源,包括vcores、内存等。

    resource_inuse

    object

    当前所使用的资源,包括vcores、内存等。

    resource_reserved

    object

    当前所预留的资源,包括vcores、内存等。

    number_running_container

    int

    正在运行的container的总数。这反映了superior引擎的判定数量。

    number_pending_request

    int

    挂起申请的总数。这反映了superior引擎的判定数量。

    number_reserved_container

    int

    预留container的总数。这反映了superior引擎的判定数量。

    master_container_id

    String

    总containerID。

    master_container_resource

    String

    运行的主container的主机名。

    demand

    array

    demand对象数组。

    priority

    int

    请求的优先级。

    ismaster

    boolean

    判断是否为application master需求。

    capability

    object

    Capability对象。

    vcores, memory

    int

    数值可消耗资源属性,给该命令定义分配“单元”。

    count

    int

    单元所需的数量。

    relaxlocality

    boolean

    本地化需求优先,如果不能满足则不强制满足。

    locality

    object

    本地化对象。

    target

    string

    本地化目标的名称(即:节点1,框架1)。

    count

    int

    资源“单元”数量与所需的本地需求。

    strict

    boolean

    是否强制本地性。

    resource_select

    String

    应用程序资源选择。

    pending_reason

    String

    该application pending的理由。

    resource_reserved

    object

    当前需求的预留资源,包括vcores、内存等。

    reservations

    array

    预留container对象的数组。

    reservations:id

    String

    预留container的ID。

    reservations:resource

    String

    container的分配地址。

    reservations:reserve_amount

    object

    预留项的总数。

    containers

    array

    分配container对象的数组。

    containers:id

    String

    containerID。

    containers:resource

    String

    container分配的位置。

    containers:capability

    object

    Capability对象。

查询队列

  • 查询Scheduler Engine中的所有队列信息,包括叶子节点和所有中间队列。
    • URL

      GET https://<SS_REST_SERVER>/ws/v1/sscheduler/queues/list

    • 输入

    • 输出
      {
        "queuelist": [
          {
            "name": "root",
            "open_state": "OPEN",
            "active_state": "ACTIVE",
            "number_pending_application": 0,
            "number_running_application": 1,
            "number_pending_request": 9,
            "number_running_container": 12,
            "number_reserved_container": 3,
            "resource_inuse": {
              "memory": 46952,
              "vcores": 12
            },
            "resource_request": {
              "memory": 36864,
              "vcores": 9
            },
            "resource_reserved": {
              "memory": 2560,
              "vcores": 3
            },
            "resource_maximum": {
              "memory": 49152,
              "vcores": 48
            }
          },
          {
            "name": "root.default",
            "open_state": "OPEN",
            "active_state": "ACTIVE",
            "number_pending_application": 0,
            "number_running_application": 1,
            "number_pending_request": 9,
            "number_running_container": 12,
            "number_reserved_container": 3,
            "resource_inuse": {
              "memory": 46952,
              "vcores": 12
            },
            "resource_request": {
              "memory": 36864,
              "vcores": 9
            },
            "resource_reserved": {
              "memory": 2560,
              "vcores": 3
            },
            "resource_maximum": {
              "memory": 49152,
              "vcores": 48
            },
            "am_resource_maximum": {
              "memory": 49152,
              "vcores": 48
            },
            "am_resource_used": {
              "memory": 15360,
              "vcores": 1
            }
          },
          {
            "name": "root.lost",
            "open_state": "CLOSED",
            "active_state": "INACTIVE",
            "number_pending_application": 0,
            "number_running_application": 0,
            "number_pending_request": 0,
            "number_running_container": 0,
            "number_reserved_container": 0,
            "resource_inuse": {
              "memory": 0,
              "vcores": 0
            },
            "resource_request": {
              "memory": 0,
              "vcores": 0
            },
            "resource_reserved": {
              "memory": 0,
              "vcores": 0
            },
            "resource_maximum": {
              "memory": 0,
              "vcores": 0
            },
            "am_resource_maximum": {
              "memory": 0,
              "vcores": 8
            },
            "am_resource_used": {
              "memory": 0,
              "vcores": 0
            }
          },
          {
            "name": "root.launcher-job",
            "open_state": "OPEN",
            "active_state": "ACTIVE",
            "number_pending_application": 0,
            "number_running_application": 0,
            "number_pending_request": 0,
            "number_running_container": 0,
            "number_reserved_container": 0,
            "resource_inuse": {
              "memory": 0,
              "vcores": 0
            },
            "resource_request": {
              "memory": 0,
              "vcores": 0
            },
            "resource_reserved": {
              "memory": 0,
              "vcores": 0
            },
            "resource_maximum": {
              "memory": 0,
              "vcores": 14
            },
            "am_resource_maximum": {
              "memory": 0,
              "vcores": 14
            },
            "am_resource_used": {
              "memory": 0,
              "vcores": 0
            }
          }
        ]
      }
      表3 查询队列参数

      参数属性

      参数类型

      参数描述

      queuelist

      array

      队列名称列表。

      name

      String

      队列名称。

      open_state

      String

      队列的内在状态(自身状态)。

      表示队列的有效状态为OPEN或CLOSED。CLOSED状态的队列不接受任何新的应用请求。

      eopen_state

      String

      队列的外在状态(父队列状态)。

      有效状态为队列自身状态及其父队列状态的组合。CLOSED状态的队列不接受任何新的应用请求。

      active_state

      String

      队列的内在状态(自身状态)。

      表示队列的有效状态为ACTIVE或INACTIVE。INACTIVE状态的队列不能调度任何应用程序。

      eactive_state

      String

      队列的外在状态(父队列状态)。

      有效状态为队列自身状态及其父队列状态的组合。INACTIVE状态的队列不能调度任何应用程序。

      number_pending_application

      int

      挂起应用的总和。

      number_running_application

      int

      正在运行应用的总和。

      number_pending_request

      int

      挂起请求的总和。

      number_running_container

      int

      正在运行container的总和。

      number_reserved_container

      int

      预留container的总和。

      resource_request

      object

      以vcores和内存等形式在队列中挂起的资源请求。

      resource_inuse

      object

      以vcores和内存等形式在队列中使用的资源。

      resource_reserved

      object

      以vcores和内存等形式在队列中预留的资源。

      active_state

      String

      描述表示队列ACTIVE或INACTIVE状态。一个INACTIVE队列不能调度任何分配请求。

  • 查询Scheduler Engine中的单个队列,包括叶子节点和所有中间队列。
    • URL

      GET https://<SS_REST_SERVER>/ws/v1/sscheduler/queues/{queuename}

    • 输入

    • 输出
      {
        "queue": {
          "name": "root",
          "open_state": "OPEN",
          "active_state": "ACTIVE",
          "number_pending_application": 1,
          "number_running_application": 1,
          "number_pending_request": 9,
          "number_running_container": 12,
          "number_reserved_container": 3,
          "resource_inuse": {
            "memory": 46952,
            "vcores": 12
          },
          "resource_request": {
            "memory": 36864,
            "vcores": 9
          },
          "resource_reserved": {
            "memory": 2560,
            "vcores": 3
          },
          "leaf_queue": "false",
          "cross_node_label_enabled": "false",
          "am_cross_node_label_enabled": "false",
          "max_running_application": "8",
          "max_pending_application": "8",
          "max_master_share": "0.8",
          "user_acl": [
            {"user": "mapred"},
            {"group": "supergroup"},
            {"group": "hadoop"},
            {"group": "System_administrator_186"}
          ],
          "admin_acl": [
            {"user": "mapred"},
            {"group": "supergroup"},
            {"group": "System_administrator_186"}
          ]
        }
      }
    • 异常

      未找到队列。

    表4 查询指定队列参数

    参数属性

    参数类型

    参数描述

    queue

    object

    队列对象。

    name

    String

    队列名称。

    description

    String

    队列描述。

    open_state

    String

    队列的内在状态(自身状态)。

    表示队列的有效状态为OPEN或CLOSED。CLOSED状态的队列不接受任何新的allocation请求。

    eopen_state

    String

    队列的外在状态(父队列状态)。

    有效状态为队列自身状态及其父队列状态的组合。CLOSED状态的队列不接受任何新的allocation请求。

    active_state

    String

    队列的内在状态(自身状态)。

    表示队列的有效状态为ACTIVE或INACTIVE。INACTIVE状态的队列不能调度任何应用程序。

    eactive_state

    String

    队列的外在状态(父队列状态)。

    有效状态为队列自身状态及其父队列状态的组合。INACTIVE状态的队列不能调度任何应用程序。

    leaf_queue

    boolean

    表示队列是否在树节点或中间队列。表示叶子节点队列。

    number_pending_application

    int

    当前的挂起请求数量。如果是中间队列/父队列,这是所有子队列的集合。

    number_running_application

    int

    当前正在运行应用的数量。如果是中间队列/父队列,这是所有子队列的集合。

    number_pending_request

    int

    挂起命令的数量;每个未完成命令的总计数。如果是中间队列/父队列,这是所有子队列的集合。

    number_running_container

    int

    正在运行container的数量。如果是中间队列/父队列,这是所有子队列的集合。

    number_reserved_container

    int

    预留container的数量。如果是中间队列/父队列,这是所有子队列的集合。

    resource_request

    object

    以vcores和内存等形式在队列中挂起的资源请求。

    resource_inuse

    object

    以vcores和内存等形式在队列中使用的资源。

    resource_reserved

    object

    以vcores和内存等形式预留在队列中的资源。

    configuration

    object

    队列配置目标。

    max_pending_application

    int

    最大挂起应用数。如果是中间队列/父队列,这是所有子队列的集合。

    max_running_application

    int

    最大运行应用数。如果是中间队列/父队列,这是所有子队列的集合。

    allocation_order_policy

    String

    分配策略,可以使用FIFO原则,PRIORITY原则或者FAIR原则。

    max_running_application_per_user

    int

    每个使用者运行应用的最大数量。

    max_master_share

    string

    该队列共享的百分比。

    max_allocation_unit

    object

    单个container允许的最大资源,该资源以vcores和内存等形式存在。

    default_resource_select

    String

    缺省资源选择表达式。它被使用在当应用没有被指定一个提交区间值时。

    user_acl

    array

    队列中被给予user权限的使用者。

    admin_acl

    array

    该队列中被给予admin权限的使用者。

    group

    String

    用户组名称。

    user

    String

    用户名称。

查询资源池

  • 查询Scheduler Engine中所有的资源池。
    • URL

      GET https://<SS_REST_SERVER>/ws/v1/sscheduler/resourcepools/list

    • 输入

    • 输出
      {
        "resourcepool_list": [
          {
            "name": "default",
            "description": "System generated resource pool",
            "number_member": 3,
            "resourceZones": [
              {
                "availableResource": {
                  "memory": 2560,
                  "vcores": 36
                },
                "resourceZone": "default"
              }
            ],
            "available_resource": {
              "memory": 2560,
              "vcores": 36
            },
            "total_resource": {
              "memory": 49152,
              "vcores": 48
            },
            "configuration": {
              "resources": [
                {
                  "resource": "*"
                }
              ],
              "resource_select": "",
              "primaryResourceZone": ""
            }
          }
        ]
      }
    表5 查询资源池接口参数

    参数属性

    参数类型

    参数描述

    resourcepool_list

    array

    资源池对象数组。

    name

    String

    资源池名称。

    number_member

    int

    资源池成员数量。

    description

    String

    资源池描述信息。

    members

    array

    当前资源池成员的资源名称数组。

    resource

    String

    资源名称。

    available_resource

    object

    该资源池中当前可使用的资源。

    vcores, memory

    int

    可消耗数值型资源属性,当前资源池中资源的属性,该属性的值以数字表示。

    total_resource

    object

    该资源池所有资源信息。

    configuration

    object

    配置目标信息。

    resources

    array

    所配置的资源名称pattern数组。

    resource

    String

    资源名称模式。

    resource_select

    String

    资源选择表达式。

  • 查询Scheduler Engine中单个资源池
    • URL

      GET https://<SS_REST_SERVER>/ws/v1/sscheduler/resourcepools/{resourcepoolname}

    • 输入

    • 输出
      {
        "resourcepool": {
          "name": "default",
          "description": "System generated resource pool",
          "number_member": 3,
          "resourceZones": [
            {
              "availableResource": {
                "memory": 2560,
                "vcores": 36
              },
              "resourceZone": "default"
            }
          ],
          "available_resource": {
            "memory": 2560,
            "vcores": 36
          },
          "total_resource": {
            "memory": 49152,
            "vcores": 48
          },
          "configuration": {
            "resources": [
              {
                "resource": "*"
              }
            ],
            "resource_select": "",
            "primaryResourceZone": ""
          }
        }
      }
    • 异常

      未找到资源池。

    表6 查询指定资源池参数

    参数属性

    参数类型

    参数描述

    resourcepool

    object

    资源池对象。

    name

    String

    资源池名称。

    description

    String

    资源池描述信息。

    number_member

    int

    资源池成员数量。

    members

    array

    该资源池现任成员的资源名称数组。

    resource

    String

    资源名称。

    available_resource

    object

    该资源池当前可用资源。

    vcores, memory, ..

    int

    可消耗数值型资源属性,当前资源池中资源的属性,该属性的值以数字表示。

    total_resource

    object

    该资源池中所有资源。

    configuration

    object

    配置目标。

    resources

    array

    所配置的资源名称pattern数组。

    resource

    String

    资源名称模式。

    resource_select

    String

    资源选择表达式。

查询policiesxmlconf

  • URL

    GET https://<SS_REST_SERVER>/ws/v1/sscheduler/policiesxmlconf/list

  • 输入

  • 输出
    {
      "policylist": {
        "queues": [
          {
            "name": "launcher-job",
            "fullname": "root.launcher-job",
            "share": "20.0",
            "reserve": "memory 0,vcores 0 : 0.0",
            "minimum": "memory 0,vcores 0 : 10.0",
            "maximum": "memory 0,vcores 0 : 30.0",
            "defaultuser": {
              "maximum": "100.0"
            },
            "weight": "1.0"
          },
          {
            "name": "default",
            "fullname": "root.default",
            "share": "20.0",
            "reserve": "memory 0,vcores 0 : 0.0",
            "minimum": "memory 0,vcores 0 : 20.0",
            "maximum": "memory 0,vcores 0 : 100.0",
            "defaultuser": {
              "maximum": "100.0"
            },
            "weight": "1.0"
          }
        ],
        "resourcepool": "default"
      }
    }

相关文档