Updated on 2026-10-21 GMT+08:00

Switching the MRS Tenant Resource Scheduler

In MRS cluster O&M, different service scenarios require different YARN resource scheduling. The Superior scheduler is best for multi-tenant scenarios requiring complex resource isolation, while the Capacity scheduler is ideal for hierarchical queue-based resource management. When service requirements change, the cluster administrator must switch the YARN scheduler type to match the new resource management policy. Switching the scheduler clears the existing tenant and resource pool configurations and rebuilds the resource management model using the target scheduler's parameters. This section describes how to switch between the Superior and Capacity schedulers in an MRS cluster.

  • Superior scheduler: The default YARN resource scheduler in MRS clusters. It supports multi-tenant resource isolation, dynamic resource pools, and resource preemption. It is ideal for scenarios where multiple departments share a cluster and strict resource isolation is required.
  • Capacity scheduler: A hierarchical queue scheduler provided by the open-source Hadoop community. It allocates resources based on a queue's configured capacity and maximum capacity. It is ideal for hierarchical resource management and queue-based resource allocation. Note that a queue can be bound to at most two resource pools (the default pool plus one custom pool), and a resource pool can be bound to only one queue.
  • Observation period: The verification phase following a scheduler switch, typically lasting one week. During this period, do not add or delete resource pools, YARN node labels, or tenants. Doing so prevents you from rolling back the scheduler.

Prerequisites

  • The network connectivity of the cluster is proper and secure, and the YARN service status is normal.
  • During scheduler switching, tenants cannot be added, deleted, or modified. In addition, services cannot be started or stopped.

Switching Between the Capacity Scheduler and Superior Scheduler (Available for Clusters of MRS 3.3.0 or Later)

This function is only available for clusters of MRS 3.3.0 or later.

Constraints
  • This operation is available exclusively for newly provisioned clusters when the scheduler needs to be changed.
  • During the scheduler switchover, do not perform any operation on the cluster. Otherwise, the operation may fail due to database modification.
  • Before switching the scheduler, do not add resource pools, YARN node labels, or tenants. Otherwise, the scheduler switch may fail.
  • Capacity scheduler: A queue can be bound to at most two resource pools (the default pool and one custom pool), and a resource pool can be bound to only one queue.
Impact on the system
  • Because the ResourceManager is restarted during scheduler switching, submitting jobs to Yarn will fail at that time.
  • After the scheduler is switched, the parameters of the scheduler that takes over the workload are used.
  • After switching the scheduler, do not add or delete resource pools, YARN node labels, or tenants during the observation period. Otherwise, the scheduler cannot be rolled back.

    The recommended observation period for scheduler switching is one week. If resource pools, YARN node labels, or tenants are added or deleted during this period, the observation period ends immediately.

Procedure

  1. Log in to FusionInsight Manager of the MRS cluster.

    For details about how to log in to FusionInsight Manager, see Accessing MRS Manager.

  2. Choose Cluster > Services > Yarn and check whether the Yarn service status is normal. If the service is abnormal, restore the service.
  3. Log in to the active management node as user omm.
  4. Switch the scheduler as required.

    • Run the following command to switch from the Capacity scheduler to the Superior scheduler:
      sh ${BIGDATA_HOME}/om-server/om/sbin/cleanSwitchScheduler.sh 1

      If information similar to the following is displayed, the operation is successful:

      Will change scheduler type to SUPERIOR
      Start to delete all tenant resource.  
      End to delete all tenant resource.  
      Start to delete all resource pool.  
      End to delete all resource pool.  
      ...  
      End to switch scheduler by reset.
    • Run the following command to switch from the Capacity scheduler to the Superior scheduler:
      sh ${BIGDATA_HOME}/om-server/om/sbin/cleanSwitchScheduler.sh 0

      If information similar to the following is displayed, the operation is successful:

      Will change scheduler type to CAPACITY  
      Start to delete all tenant resource.  
      End to delete all tenant resource.  
      Start to delete all resource pool.  
      End to delete all resource pool.  
      ...  
      End to switch scheduler by reset.  

    You can query the scheduler switching logs on the active management node.

    • ${BIGDATA_LOG_HOME}/controller/aos/clean_switch_scheduler.log
    • ${BIGDATA_LOG_HOME}/controller/aos/aos.log
    • ${BIGDATA_LOG_HOME}/controller/aos/plugin.log

  5. After the command is executed, wait 5 to 10 minutes, then perform the following operations to verify whether the scheduler has been switched.

    1. Log in to MRS Manager, choose Cluster > Services, and check whether the YARN service is running properly.
    2. Choose Tenant Resources > Dynamic Resource Plan > Queue Configurations and check whether the queue is displayed properly.

Switching from the Capacity Scheduler to the Superior Scheduler

Impact on the system

  • Because the ResourceManager is restarted during scheduler switching, submitting jobs to YARN will fail at that time.
  • During scheduler switching, tasks in a job being executed on YARN will continue, but new tasks cannot be started.
  • After scheduler switching is complete, jobs executed on YARN may fail, causing service interruptions.
  • After scheduler switching is complete, parameters of the Superior scheduler are used for tenant management.
  • After scheduler switching is complete, tenant queues whose capacity is 0 in the Capacity scheduler cannot be allocated resources in the Superior scheduler. As a result, jobs submitted to these tenant queues fail to be executed. Therefore, you are advised not to set the capacity of a tenant queue to 0 in the Capacity scheduler.
  • After scheduler switching is complete, you cannot add or delete resource pools, YARN node labels, or tenants during the observation period. If such an operation is performed, the scheduler cannot be rolled back to the Capacity scheduler.

    The recommended observation period for scheduler switching is one week. If resource pools, YARN node labels, or tenants are added or deleted during this period, the observation period ends immediately.

  • Rollback may cause the loss of partial or all Yarn job information.

Procedure

  1. Modify YARN service parameters and ensure that the YARN service status is normal.

    1. Log in to FusionInsight Manager of the MRS cluster.

      For details about how to log in to FusionInsight Manager, see Accessing MRS Manager.

    2. Choose Cluster > Services > Yarn. Click Configurations and then All Configurations, search for yarn.resourcemanager.webapp.pagination.enable, and check whether its value is true.
      • If yes, go to 1.c.
      • If no, set the parameter to true and click Save to save the configuration. On the Dashboard tab page of YARN, choose More > Restart Service, verify the identity, and click OK. After the service restarts, go to 1.c.
    3. Choose Cluster > Name of the desired cluster > Services, and check whether the YARN service status is normal.

  2. Log in to the active management node as user omm.
  3. Switch the scheduler.

    The following switching modes are available:

    0: converts the Capacity scheduler configurations into the Superior scheduler configurations and then switches the Capacity scheduler to the Superior scheduler.

    1: converts the Capacity scheduler configurations into the Superior scheduler configurations only.

    2: switches the Capacity scheduler to the Superior scheduler only.

    • Mode 0 is recommended if the cluster environment is simple and the number of tenants is less than 20.

      Run the following command:

      sh ${BIGDATA_HOME}/om-server/om/sbin/switchScheduler.sh -c Cluster ID -m 0

      On FusionInsight Manager, choose Cluster, click the cluster name, and then choose Cluster Properties to view the cluster ID.

      Start to convert Capacity scheduler to Superior Scheduler, clusterId=1
      Start to convert Capacity scheduler configurations to Superior. Please wait...
      Convert configurations successfully.
      Start to switch the Yarn scheduler to Superior. Please wait...
      Switch the Yarn scheduler to Superior successfully.
    • If the cluster environment or tenant information is complex and you need to retain the queue configurations of the Capacity scheduler on the Superior scheduler, it is recommended that you use mode 1 first to convert the Capacity scheduler configurations, check the converted configurations, and then use mode 2 to switch the Capacity scheduler to the Superior scheduler.
      1. Run the following command to convert the Capacity scheduler configurations into the Superior scheduler configurations:
        sh ${BIGDATA_HOME}/om-server/om/sbin/switchScheduler.sh -c Cluster ID -m 1

        If information similar to the following is displayed, the operation is successful:

        Start to convert Capacity scheduler to Superior Scheduler, clusterId=1
        Start to convert Capacity scheduler configurations to Superior. Please wait...
        Convert configurations successfully.
      2. Run the following command to switch the Capacity scheduler to the Superior scheduler:
        sh ${BIGDATA_HOME}/om-server/om/sbin/switchScheduler.sh -c Cluster ID -m 2

        If information similar to the following is displayed, the operation is successful:

        Start to convert Capacity scheduler to Superior Scheduler, clusterId=1
        Start to switch the Yarn scheduler to Superior. Please wait...
        Switch the Yarn scheduler to Superior successfully.
    • If you do not need to retain the queue configurations of the Capacity scheduler, use mode 2.
      1. Log in to MRS Manager and delete all tenants except the default tenant, and delete all resource pools except the default resource pool.
      2. Run the following command to switch the Capacity scheduler to the Superior scheduler:
        sh ${BIGDATA_HOME}/om-server/om/sbin/switchScheduler.sh -c Cluster ID -m 2

        If information similar to the following is displayed, the operation is successful:

        Start to convert Capacity scheduler to Superior Scheduler, clusterId=1
        Start to switch the Yarn scheduler to Superior. Please wait...
        Switch the Yarn scheduler to Superior successfully.

    You can query the scheduler switching logs on the active management node.

    • ${BIGDATA_LOG_HOME}/controller/aos/switch_scheduler.log
    • ${BIGDATA_LOG_HOME}/controller/aos/aos.log

Rollback Operations

You can manually switch the Superior scheduler back to the Capacity scheduler. However, this operation is only a workaround and is not allowed in most cases.

If the customer has special requirements for switching back to the Capacity scheduler, the following conditions must be met:

  • The observation period has not expired.
  • No resource pool, YARN node label, or tenant is added or deleted during the observation period.

    After the Superior scheduler is switched back to the Capacity scheduler, some resource pools or queues may be missing if resource pools, YARN node labels, or tenants were added or deleted. This prevents the Capacity scheduler from running properly.

The procedure is as follows:

  1. Change the scheduler to the Capacity scheduler and start YARN.

    1. Log in to FusionInsight Manager of the MRS cluster.

      For details about how to log in to FusionInsight Manager, see Accessing MRS Manager.

    2. Open the Configurations page of YARN and modify the parameters listed in Table 1.
      Table 1 Modifying YARN configuration items

      Parameter

      Description

      yarn.resourcemanager.scheduler.class

      org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler

      yarn.http.rmwebapp.external.classes

      Left empty

      hadoop.http.rmwebapp.scheduler.page.classes

      Left empty

      yarn.resourcemanager.webapp.pagination.enable

      false

    3. Click Save and then click OK in the displayed dialog box.
    4. Roll restart the YARN service, enter the password, and click OK.

  2. Log in to the active management node and restart the AOS service.

    1. Log in to the active OMS server as user omm.
    2. Run the following command to disable logout upon timeout:
      TMOUT=0

      After completing these operations, run the TMOUT=Timeout interval command to promptly restore the timeout setting. For example, TMOUT=600 indicates that a user is logged out if the user does not perform any operation within 600 seconds.

    3. Run the following command to restart the AOS service:
      ${BIGDATA_HOME}/om-server/om/sbin/aos_cmd.sh restart

Verification:

After the rollback completes, log in to MRS Manager and check whether the YARN service is running normally. Choose Tenant Resources > Dynamic Resource Plan > Queue Configurations and verify that the queue configurations display correctly. If the YARN service runs normally and the queues display correctly, the rollback was successful.

FAQs

  • Scheduler switch failure

    Common causes of a switch failure include an abnormal YARN service, added resource pools or tenants prior to the switch, or database conflicts that interrupt the switch process.

    Ensure that the YARN service is running normally and that no resource pools, YARN node labels, or tenants were added before the switch. Log in to the active management node and check clean_switch_scheduler.log or switch_scheduler.log in the ${BIGDATA_LOG_HOME}/controller/aos/ directory to locate and fix the error.

  • YARN task submission failure after the switch

    During the scheduler switch, ResourceManager restarts, causing any tasks submitted to YARN during this time to fail. Additionally, if a tenant queue in the Capacity scheduler has a resource capacity of 0, it will not receive resources after you switch to the Superior scheduler.

    Submit tasks only after ResourceManager finishes restarting.

Helpful Links