Updated on 2024-09-23 GMT+08:00

Creating an MRS Sub-Tenant

You can create sub-tenants on MRS and allocate resources of the current tenant to the sub-tenants based on the resource consumption and isolation planning and requirements of services.

If the tenant is a non-leaf tenant, you can add sub-tenants. Sub-tenants cannot be created for a leaf tenant.

Prerequisites

  • A non-leaf tenant has been added by referring to Creating an MRS Tenant.
  • A tenant name has been planned. The name must not be the same as that of a role or Yarn queue that exists in the current cluster.
  • If a sub-tenant requires storage resources, a storage directory has been planned based on service requirements, and the planned directory does not exist under the storage directory of the parent tenant.
  • The resources that can be allocated to the current tenant have been planned and the sum of the resource percentages of direct sub-tenants under the parent tenant at every level does not exceed 100%.
  • The IAM users have been synchronized in advance. You can do this by clicking Synchronize next to IAM User Sync on the Dashboard page of the cluster details.
  • You have logged in to MRS Manager. For how to log in, see Accessing MRS Manager.

Adding an MRS Sub-Tenant on the MRS Console

  1. Log in to the MRS console.
  2. On the Active Clusters page, select a running cluster and click its name to switch to the cluster details page.
  3. On the MRS details page, click Tenant.
  4. In the tenant list on the left, move the cursor to the tenant node to which a sub-tenant is to be added. Click Create sub-tenant. On the displayed page, configure the sub-tenant attributes according to the following table:

    Table 1 Tenant property parameters (MRS 3.x)

    Parameter

    Description

    Name

    • Name of the current tenant, which can contain digits, letters, and underscores (_).
    • Plan a tenant name based on service requirements. The name cannot be the same as that of a role, HDFS directory, or YARN queue that exists in the current cluster.

    Tenant Type

    Whether a tenant is a leaf tenant.

    In some versions, this parameter is named Tenant Resource Type.

    • When Leaf Tenant is selected, the current tenant is a leaf tenant and no sub-tenant can be added.
    • When Non-leaf Tenant is selected, the current tenant is not a leaf tenant and sub-tenants can be added to the current tenant.
    NOTE:

    MRS 3.2.0 or later: If you select ClickHouse for Service, this parameter can only be set to Leaf Tenant.

    Compute Resource

    Compute resources can be used by the tenant.

    • When Yarn is selected, the system automatically creates a queue in Yarn and the queue is named the same as the tenant name.
      • A leaf tenant can directly submit jobs to the queue.
      • A non-leaf tenant cannot directly submit jobs to the queue. However, YARN adds an extra queue (hidden) named default for the non-leaf tenant to record the remaining resource capacity of the tenant. Actual jobs do not run in this queue.
    • If Yarn is not selected, the system does not automatically create a queue.

    Configuration Mode

    If Yarn is selected for Compute Resource, this parameter can be set to Basic or Advanced.

    • Basic: Configure the percentage of compute resources used by the tenant in the default resource pool by specifying Default Resource Pool Capacity (%).
    • Advanced: Configure the following parameters for advanced settings:
      • Weight: Tenant resource weight. The value ranges from 0 to 100. Tenant resource weight = Tenant weight/Total weight of tenants at the same level
      • Minimum Resources: resources preempted by the tenant. The value is a percentage or absolute value of the parent tenant's resources. When a tenant's workload is light, their resources are automatically lent to other tenants. When available resources are fewer than Minimum Resources, the tenant can preempt the resources that were lent out.
      • Maximum Resources: maximum resources that can be used by a tenant. The value is a percentage or absolute value of the parent tenant's resources.
      • Reserved Resources: resources reserved for the tenant. The reserved resources cannot be used by other tenants even if no job is using resources of the tenant. The value is a percentage or absolute value of the parent tenant's resources.

    Storage Resource

    Storage resources selected for the current tenant.

    • If HDFS is selected, the system automatically creates a file folder named after the tenant name in the /tenant directory. When a tenant is created for the first time, the system automatically creates the /tenant directory in the HDFS root directory.
    • If HDFS is not selected, the system does not create a storage directory under the root directory of HDFS.

    Maximum Number of Files/Directories

    Maximum number of files or directories that can be created in HDFS. Set this parameter when Storage Resource is HDFS.

    Storage Space Quota

    Specifies the quota for HDFS storage space used by the current tenant. Set this parameter when Storage Resource is HDFS.

    • The minimum value is 1, and the unit is MB or GB.
    • This parameter indicates the maximum HDFS storage space that can be used by a tenant, but does not indicate the actual space used.
    • If the value is greater than the size of the HDFS physical disk, the maximum space available is the full space of the HDFS physical disk.
    NOTE:

    To ensure data reliability, one backup is automatically generated for each file saved in HDFS, that is, two copies are generated in total. The HDFS storage space indicates the total disk space occupied by all these copies. For example, if the value is set to 500 MB, the actual space for storing files is about 250 MB (500/2 = 250).

    Storage Path

    HDFS directory for tenant resource data.

    • The system automatically creates a file folder named after the tenant name in the /tenant directory by default. For example, the default HDFS storage directory for tenant ta1 is /tenant/ta1.
    • When a tenant is created for the first time, the system automatically creates the /tenant directory in the HDFS root directory. The storage path is customizable.

    Service

    Other service resources associated with the tenant. (This parameter is grayed out if the cluster has no components that support service association.)

    Click Associate Service and select a service name from the Service drop-down list box. If Association Mode is set to Exclusive, service resources are occupied exclusively. If share is selected, service resources are shared.

    Description

    Specifies the description of the current tenant.

    Table 2 Tenant parameters (MRS 2.x and earlier versions)

    Parameter

    Description

    Name

    • Name of the current tenant, which can contain digits, letters, and underscores (_).
    • Plan a tenant name based on service requirements. The name cannot be the same as that of a role, HDFS directory, or YARN queue that exists in the current cluster.

    Tenant Type

    Whether the tenant is a leaf tenant.

    • When Leaf Tenant is selected, the current tenant is a leaf tenant and no sub-tenant can be added.
    • When Non-leaf Tenant is selected, the current tenant is not a leaf tenant and sub-tenants can be added to the current tenant.

    Compute Resource

    Compute resources can be used by the tenant. (In some versions, the parameter is named Dynamic Resource.)

    • When Yarn is selected, the system automatically creates a queue in Yarn and the queue is named the same as the tenant name.
      • A leaf tenant can directly submit jobs to the queue.
      • A non-leaf tenant cannot directly submit jobs to the queue. However, YARN adds an extra queue (hidden) named default for the non-leaf tenant to record the remaining resource capacity of the tenant. Actual jobs do not run in this queue.
    • If Yarn is not selected, the system does not automatically create a queue.

    Default Resource Pool Capacity (%)

    Percentage of the compute resources used by the current tenant in the default resource pool. This parameter is configured when YARN is the Compute Resource.

    Default Resource Pool Max. Capacity (%)

    Maximum percentage of the compute resources used by the current tenant in the default resource pool. This parameter is configured when YARN is the Compute Resource.

    Storage Resource

    Storage resources selected for the current tenant.

    • If HDFS is selected, the system automatically creates a file folder named after the tenant name in the /tenant directory. When a tenant is created for the first time, the system automatically creates the /tenant directory in the HDFS root directory.
    • If HDFS is not selected, the system does not create a storage directory under the root directory of HDFS.

    Storage Space Quota (MB)

    Specifies the quota for HDFS storage space used by the current tenant. Set this parameter when Storage Resource is HDFS.

    • The minimum value is 1, and the unit is MB or GB.
    • This parameter indicates the maximum HDFS storage space that can be used by a tenant, but does not indicate the actual space used.
    • If the value is greater than the size of the HDFS physical disk, the maximum space available is the full space of the HDFS physical disk.
    NOTE:

    To ensure data reliability, one backup is automatically generated for each file saved in HDFS, that is, two copies are generated in total. The HDFS storage space indicates the total disk space occupied by all these copies. For example, if the value is set to 500 MB, the actual space for storing files is about 250 MB (500/2 = 250).

    Storage Path

    HDFS storage directory for the tenant.

    • The system automatically creates a file folder named after the tenant name in the /tenant directory by default. For example, the default HDFS storage directory for tenant ta1 is /tenant/ta1.
    • When a tenant is created for the first time, the system automatically creates the /tenant directory in the HDFS root directory. The storage path is customizable.

    Service

    Other service resources associated with the tenant. (This parameter is grayed out if the cluster has no components that support service association.)

    Click Associate Service and select a service name from the Service drop-down list box. If Association Mode is set to Exclusive, service resources are occupied exclusively. If share is selected, service resources are shared.

    Description

    Specifies the description of the current tenant.

  5. Click OK to save the settings.

    It takes a few minutes to save the settings. If the Tenant created successfully is displayed in the upper-right corner, the tenant is added successfully. The tenant is created successfully.

    • Roles, computing resources, and storage resources are automatically created when tenants are created.
    • The new role has permissions on the computing and storage resources. This role and its permissions are automatically controlled by the system and cannot be manually managed by choosing System > Permission > Role. The role name is in the format of Tenant name_Cluster ID. The ID of the first cluster is not displayed by default.
    • When using this tenant, create a system user and assign the tenant role to the user. For details, see Binding Tenant to an MRS Cluster User.
    • The sub-tenant can further allocate the resources of its parent tenant. The sum of the resource percentages of direct sub-tenants under a parent tenant at each level cannot exceed 100%. The sum of the computing resource percentages of all level-1 tenants cannot exceed 100%.

Adding a Sub-Tenant on Manager (for MRS 3.x and Later)

  1. Log in to FusionInsight Manager and choose Tenant Resources.
  2. In the tenant list on the left, select a parent tenant and click . On the displayed page, set the parameters.

    • To use a Superior scheduler cluster, configure sub-tenant properties by referring to Table 3.
    • To use the Capacity scheduler cluster, configure sub-tenant properties by referring to Table 4.
    • YARN in a new cluster uses the Superior scheduler by default. You can also switch the scheduler by referring to Switching the MRS Tenant Resource Scheduler.
    • To query the scheduler type, log in to Manager and search for the yarn.resourcemanager.scheduler.class parameter on the All Configurations page of the YARN service.
    Table 3 Sub-tenant parameters (Superior scheduler)

    Parameter

    Description

    Cluster

    Cluster to which the parent tenant belongs.

    Parent Tenant Resource

    Name of the parent tenant. (In some versions, the parameter is named Parent Tenant.)

    Name

    • Name of the current tenant, which can contain digits, letters, and underscores (_).
    • Plan a tenant name based on service requirements. The name cannot be the same as that of a role, HDFS directory, or YARN queue that exists in the current cluster.

    Tenant Resource Type

    Whether a tenant is a leaf tenant. (In some versions, the parameter is named Tenant Type.)

    • When Leaf Tenant Resource is selected, the current tenant is a leaf tenant and no sub-tenant can be added. (In some versions, the parameter is named Leaf Tenant.)
    • When Non-leaf Tenant Resource is selected, the current tenant is not a leaf tenant and sub-tenants can be added to the current tenant. However, the tenant depth cannot exceed 5 levels. (In some versions, the parameter is named Non-Leaf Tenant.)

    Compute Resource

    Dynamic compute resources for the current tenant.

    • When Yarn is selected, the system automatically creates a queue in Yarn and the queue is named the same as the tenant name.
      • A leaf tenant can directly submit jobs to the queue.
      • A non-leaf tenant cannot directly submit jobs to the queue. However, YARN adds an extra queue (hidden) named default for the non-leaf tenant to record the remaining resource capacity of the tenant. Actual jobs do not run in this queue.
    • If Yarn is not selected, the system does not automatically create a queue.

    Configuration Mode

    Configuration mode of compute resource parameters If Yarn is selected for Compute Resource, this parameter can be set to Basic or Advanced.

    • Basic: Configure the percentage of compute resources used by the tenant in the default resource pool by specifying Default Resource Pool Capacity (%).
    • Advanced: Configure the following parameters for advanced settings:
      • Weight: Tenant resource weight. The value ranges from 0 to 100. Tenant resource weight = Tenant weight/Total weight of tenants at the same level
      • Minimum Resources: resources preempted by the tenant. The value is a percentage or absolute value of the parent tenant's resources. When a tenant's workload is light, their resources are automatically lent to other tenants. When available resources are fewer than Minimum Resources, the tenant can preempt the resources that were lent out.
      • Maximum Resources: maximum resources that can be used by a tenant. The value is a percentage or absolute value of the parent tenant's resources.
      • Reserved Resources: resources reserved for the tenant. The reserved resources cannot be used by other tenants even if no job is using resources of the tenant. The value is a percentage or absolute value of the parent tenant's resources.

    Storage Resource

    Storage resources selected for the current tenant.

    • When HDFS is selected, the system automatically creates a folder named after the sub-tenant in the HDFS parent tenant directory.
    • If HDFS is not selected, the system does not create a storage directory under the root directory of HDFS. If the parent tenant does not have storage resources, the sub-tenant cannot use storage resources.

    Quota

    Quota for files and directories. Set this parameter when Storage Resource is HDFS.

    Storage Space Quota

    Quota for HDFS storage space used by the current tenant. Set this parameter when Storage Resource is HDFS.

    • The minimum value is 1, and the maximum value is the total storage quota of the parent tenant. The unit is MB or GB.
    • This parameter indicates the maximum HDFS storage space that can be used by a tenant, but does not indicate the actual space used.
    • If the value is greater than the size of the HDFS physical disk, the maximum space available is the full space of the HDFS physical disk.
    • If this quota is greater than the quota of the parent tenant, the actual storage space does not exceed the quota of the parent tenant.
    NOTE:

    To ensure data reliability, one backup is automatically generated for each file saved in HDFS, that is, two copies are generated in total. The HDFS storage space indicates the total disk space occupied by all these copies. For example, if the value is set to 500 MB, the actual space for storing files is about 250 MB (500/2 = 250).

    Storage Path

    Specifies the tenant's HDFS storage directory.

    • The system automatically creates a file folder named after the sub-tenant name in the directory of the parent tenant by default. For example, if the sub-tenant is ta1s and the parent directory is tenant/ta1, the system sets this parameter for the sub-tenant to tenant/ta1/ta1s.
    • The storage path is customizable in the parent directory. The parent directory for the storage path must be the storage directory of the parent tenant.

    Service

    Whether to associate resources of other services. For details, see 4.

    Description

    Description of the tenant.

    Table 4 Sub-tenant parameters (Capacity scheduler)

    Parameter

    Description

    Cluster

    Cluster to which the parent tenant belongs.

    Parent Tenant Resource

    Name of the parent tenant. (In some versions, the parameter is named Parent Tenant.)

    Name

    • Name of the current tenant, which can contain digits, letters, and underscores (_).
    • Plan a tenant name based on service requirements. The name cannot be the same as that of a role, HDFS directory, or YARN queue that exists in the current cluster.

    Tenant Type

    Whether a tenant is a leaf tenant.

    • When Leaf Tenant is selected, the current tenant is a leaf tenant and no sub-tenant can be added.
    • When Non-leaf Tenant is selected, the current tenant is not a leaf tenant and sub-tenants can be added to the current tenant.

    Compute Resource

    Dynamic compute resources for the current tenant.

    • When Yarn is selected, the system automatically creates a queue in Yarn and the queue is named the same as the tenant name.
      • A leaf tenant can directly submit jobs to the queue.
      • A non-leaf tenant cannot directly submit jobs to the queue. However, YARN adds an extra queue (hidden) named default for the non-leaf tenant to record the remaining resource capacity of the tenant. Actual jobs do not run in this queue.
    • If Yarn is not selected, the system does not automatically create a queue.

    Default Resource Pool Capacity (%)

    Percentage of computing resources used by the current tenant. The base value is the total resources of the parent tenant.

    Default Resource Pool Max Capacity (%)

    Specifies the maximum percentage of the computing resources used by the current tenant. The base value is the total resources of the parent tenant.

    Storage Resource

    Storage resources selected for the current tenant.

    • When HDFS is selected, the system automatically creates a folder named after the sub-tenant in the HDFS parent tenant directory.
    • If HDFS is not selected, the system does not create a storage directory under the root directory of HDFS. If the parent tenant does not have storage resources, the sub-tenant cannot use storage resources.

    Quota

    Quota for files and directories. Set this parameter when Storage Resource is HDFS.

    Storage Space Quota

    Quota for HDFS storage space used by the current tenant. Set this parameter when Storage Resource is HDFS.

    • The minimum value is 1, and the maximum value is the total storage quota of the parent tenant. The unit is MB or GB.
    • This parameter indicates the maximum HDFS storage space that can be used by a tenant, but does not indicate the actual space used.
    • If the value is greater than the size of the HDFS physical disk, the maximum space available is the full space of the HDFS physical disk.
    • If this quota is greater than the quota of the parent tenant, the actual storage space does not exceed the quota of the parent tenant.
    NOTE:

    To ensure data reliability, one backup is automatically generated for each file saved in HDFS, that is, two copies are generated in total. The HDFS storage space indicates the total disk space occupied by all these copies. For example, if the value is set to 500 MB, the actual space for storing files is about 250 MB (500/2 = 250).

    Storage Path

    Specifies the tenant's HDFS storage directory.

    • The system automatically creates a file folder named after the sub-tenant name in the directory of the parent tenant by default. For example, if the sub-tenant is ta1s and the parent directory is tenant/ta1, the system sets this parameter for the sub-tenant to tenant/ta1/ta1s.
    • The storage path is customizable in the parent directory. The parent directory for the storage path must be the storage directory of the parent tenant.

    Description

    Description of the current tenant.

    • Roles, computing resources, and storage resources are automatically created when tenants are created.
    • The new role has permissions on the computing and storage resources. This role and its permissions are automatically controlled by the system and cannot be manually managed by choosing System > Permission > Role. The role name is in the format of Tenant name_Cluster ID. The ID of the first cluster is not displayed by default.
    • When using this tenant, create a system user and assign the tenant role to the user. For details, see Binding Tenant to an MRS Cluster User.
    • The sub-tenant can further allocate the resources of its parent tenant. The sum of the resource percentages of direct sub-tenants under a parent tenant at each level cannot exceed 100%. The sum of the computing resource percentages of all level-1 tenants cannot exceed 100%.

  3. Check whether the current tenant needs to be associated with resources of other services.

    • If yes, go to 4.
    • If no, go to 5.

  4. Click Associate Service to configure other service resources used by the current tenant.

    1. Set Services to HBase.
    2. Set Association Type as follows:
      • Exclusive indicates that the service resources are used by the tenant exclusively and cannot be associated with other tenants.
      • Shared indicates that the service resources can be shared with other tenants.
    • Only HBase can be associated with a new tenant. However, HDFS, HBase, and YARN can be associated with existing tenants.
    • To associate an existing tenant with service resources, click the target tenant in the tenant list, switch to the Service Associations page, and click Associate Service to configure resources to be associated with the tenant.
    • To disassociate an existing tenant from service resources, click the target tenant in the tenant list, switch to the Service Associations page, and click Delete in the Operation column. In the displayed dialog box, select I have read the information and understand the impact and click OK.
    1. Click OK.

  5. Click OK. Wait until the system displays a message indicating that the tenant is successfully created.

Adding a Sub-Tenant on Manager (for MRS 2.x and Later)

  1. On MRS Manager, click Tenant.
  2. In the tenant list on the left, move the cursor to the tenant node to which a sub-tenant is to be added. Click Create sub-tenant. On the displayed page, configure the sub-tenant attributes according to the following table:

    Table 5 Sub-tenant parameters

    Parameter

    Description

    Parent tenant

    Specifies the name of the parent tenant.

    Name

    • Name of the current tenant, which can contain digits, letters, and underscores (_).
    • Plan a tenant name based on service requirements. The name cannot be the same as that of a role, HDFS directory, or YARN queue that exists in the current cluster.

    Tenant Type

    Whether the tenant is a leaf tenant.

    • When Leaf Tenant is selected, the current tenant is a leaf tenant and no sub-tenant can be added.
    • When Non-leaf Tenant is selected, the current tenant is not a leaf tenant and sub-tenants can be added to the current tenant.

    Dynamic Resource

    Dynamic compute resources for the current tenant.

    • When Yarn is selected, the system automatically creates a queue in Yarn and the queue is named the same as the tenant name.
      • A leaf tenant can directly submit jobs to the queue.
      • A non-leaf tenant cannot directly submit jobs to the queue. However, YARN adds an extra queue (hidden) named default for the non-leaf tenant to record the remaining resource capacity of the tenant. Actual jobs do not run in this queue.
    • If Yarn is not selected, the system does not automatically create a queue.

    Default Resource Pool Capacity (%)

    Specifies the percentage of the resources used by the current tenant. The base value is the total resources of the parent tenant.

    Default Resource Pool Max. Capacity (%)

    Specifies the maximum percentage of the computing resources used by the current tenant. The base value is the total resources of the parent tenant.

    Storage Resource

    Storage resources selected for the current tenant.

    • When HDFS is selected, the system automatically creates a folder named after the sub-tenant in the HDFS parent tenant directory.
    • If HDFS is not selected, the system does not create a storage directory under the root directory of HDFS. If the parent tenant does not have storage resources, the sub-tenant cannot use storage resources.

    Storage Space Quota (MB)

    Quota for HDFS storage space used by the current tenant.

    • The minimum value is 1, and the maximum value is the total storage quota of the parent tenant. The unit is MB or GB.
    • This parameter indicates the maximum HDFS storage space that can be used by a tenant, but does not indicate the actual space used.
    • If the value is greater than the size of the HDFS physical disk, the maximum space available is the full space of the HDFS physical disk.
    • If this quota is greater than the quota of the parent tenant, the actual storage space does not exceed the quota of the parent tenant.
    NOTE:

    To ensure data reliability, one backup is automatically generated for each file saved in HDFS, that is, two copies are generated in total. The HDFS storage space indicates the total disk space occupied by all these copies. For example, if the value is set to 500 MB, the actual space for storing files is about 250 MB (500/2 = 250).

    Storage Path

    Specifies the tenant's HDFS storage directory.

    • The system automatically creates a file folder named after the sub-tenant name in the directory of the parent tenant by default. For example, if the sub-tenant is ta1s and the parent directory is tenant/ta1, the system sets this parameter for the sub-tenant to tenant/ta1/ta1s.
    • The storage path is customizable in the parent directory. The parent directory for the storage path must be the storage directory of the parent tenant.

    Service

    Click Associate Service and select a service name from the Service drop-down list box. If Association Mode is set to Exclusive, service resources are occupied exclusively. If share is selected, service resources are shared.

    Description

    Specifies the description of the current tenant.

  3. Click OK to save the settings.

    It takes a few minutes to save the settings. If the Tenant created successfully is displayed in the upper-right corner, the tenant is added successfully. The tenant is created successfully.

    • Roles, computing resources, and storage resources are automatically created when tenants are created.
    • The new role has permissions on the computing and storage resources. This role and its permissions are automatically controlled by the system and cannot be manually managed by choosing System > Permission > Role. The role name is in the format of Tenant name_Cluster ID. The ID of the first cluster is not displayed by default.
    • When using this tenant, create a system user and assign the tenant role to the user. For details, see Binding Tenant to an MRS Cluster User.
    • The sub-tenant can further allocate the resources of its parent tenant. The sum of the resource percentages of direct sub-tenants under a parent tenant at each level cannot exceed 100%. The sum of the computing resource percentages of all level-1 tenants cannot exceed 100%.