Updated on 2024-11-29 GMT+08:00

Creating a Tenant

Scenario

You can create a tenant on MRS Manager to specify the resource usage.

Prerequisites

  • 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 tenant requires storage resources, a storage directory has been planned based on service requirements, and the planned directory does not exist under the HDFS directory.
  • 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%.
  • You have synchronized IAM users. (On the Dashboard page, click Synchronize on the right side of IAM User Sync to synchronize IAM users.)

Procedure

  1. On the MRS cluster details page, click Tenants.
  2. Click Create Tenant. On the page that is displayed, configure tenant properties. The following table takes MRS 3.x versions as an example.

    Table 1 Tenant parameters

    Parameter

    Description

    Name

    Name of the current tenant. The value consists of 3 to 50 characters, and can contain letters, digits, and underscores (_).

    Tenant Type

    Leaf or Non-leaf tenant. If Leaf is selected, the current tenant is a leaf tenant and no sub-tenant can be added. If Non-leaf is selected, sub-tenants can be added to the current tenant.

    Compute Resource

    Compute resources can be used by the tenant. The system automatically creates a task queue named after the tenant name in Yarn. If Yarn is not selected, the system does not automatically create a task 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.

    Default Resource Pool Capacity (%)

    Specifies the percentage of the computing resources used by the current tenant in the default resource pool. This parameter is required when Configuration Mode is Basic.

    Storage Resource

    Specifies storage resources for the current tenant. 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 storage resources are not HDFS, 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.

    Storage Space Quota

    Specifies the quota for HDFS storage space used by the current tenant. The value ranges from 1 to 8796093022208. 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

    Specifies the tenant's HDFS storage directory. 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 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

    Specifies other service resources associated with the current tenant. HBase is supported. To configure this parameter, click Associate Services. In the dialog box that is displayed, set Service to HBase. 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. The role and its permissions are controlled by the system automatically and cannot be controlled manually under Manage Role.
    • If you want to use the tenant, create a system user and assign the Manager_tenant role and the role corresponding to the tenant to the user. For details, see Creating a User.

Related Tasks

View an added tenant.

  1. On the MRS details page, click Tenants.
  2. In the tenant list on the left, click the name of the added tenant.

    The Summary tab is displayed on the right by default.

  3. View Basic Information, Resource Quota, and Charts of the tenant.

    If HDFS is in the Stopped state, Available and Used of Space in Resource Quota are unknown.