Advanced
Тема интерфейса

Commands for Tenant Management

This section describes the basic syntax and usage of SQL statements for tenant management.

  1. Add a tenant.
    create workload group if not exists test_group properties (
    "cpu_share"="10",
    "memory_limit"="30%",
    "enable_memory_overcommit"="true",
    "max_concurrency" = "10",
    "max_queue_size" = "20",
    "queue_timeout" = "3000"
    );
  2. Modify a tenant.
    alter workload group test_group properties ('cpu_share'='20','memory_limit'='4%','enable_memory_overcommit'='true','max_concurrency'='15','max_queue_size'='25','queue_timeout'='4000');
  3. Bind a user to a tenant: Bind a user to a workload group by setting user property. The default value is normal.
    set property for doris_user 'default_workload_group' = 'test_group';
  4. Query the tenant to which the user belongs.
    show property for user_name like 'default_workload_group';
  5. Grant permissions to the user bound to the tenant.
    GRANT USAGE_PRIV ON WORKLOAD GROUP 'test_group' TO 'jack';
  6. Revoke the permissions of the old tenant.
    revoke USAGE_PRIV ON WORKLOAD GROUP 'test_group' from 'jack';
  7. View tenants.
    select * from information_schema.workload_groups;
  8. Delete a tenant.
    mysql> DROP WORKLOAD GROUP if exists 'test_group';
    Query OK, 0 rows affected (0.01 sec)