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

Using the HetuEngine Client

Scenario

If a compute instance is not created or started, you can log in to the HetuEngine client to create or start the compute instance. This section describes how to manage a compute instance on the client in the O&M or service scenario.

HetuEngine provides service-level default resource queue configuration items. If no tenant information is specified, the default Yarn tenant is used. Multiple users may use the same queue by default.

If you need to isolate resources and properly allocate SQL statements to specified queues, you can enable strict tenant verification by setting tenant.strict.mode.enabled to true and use the --tenant parameter to specify the queues when you use the client.

  • Method to enable strict tenant verification for MRS 3.3.0 and later versions:

    Log in to Manager, choose Cluster > Services > HetuEngine, click Configuration and then All Configurations, search for tenant.strict.mode.enabled, set it to true, and save the settings. Click Instance, select all instances whose configurations expired, click More, select Restart Instance, and restart the instances as prompted for the configurations to take effect.

  • If strict tenant verification is enabled and cross-domain functions of HetuEngine are used, you need to set the hsfabric.local.tenant parameter of the HetuEngine data source. For details, see Configuring a HetuEngine Data Source.

Prerequisites

  • The cluster client has been installed in a directory, for example, /opt/client.
  • You have created a common HetuEngine user, for example, hetu_test who has the permissions of the Hive (with Ranger disabled), hetuuser, and default queues.

    For details about how to create a user, see Creating a HetuEngine User.

Procedure

  1. Log in to the node where the HetuEngine client resides as the user who installs the client, and switch to the client installation directory.

    cd /opt/client

  2. Run the following command to configure environment variables:

    source bigdata_env

  3. Log in to the HetuEngine client based on the cluster authentication mode.

    • In security mode, run the following command to complete user authentication and log in to the HetuEngine client:

      kinit hetu_test

      hetu-cli --catalog hive --tenant default --schema default

    • In normal mode, run the following command to log in to the HetuEngine client:

      hetu-cli --catalog hive --tenant default --schema default --user hetu_test

      hetu_test is a service user who has at least the tenant role specified by --tenant and cannot be an OS user.

    Parameter description:

    • --catalog: (Optional) Specifies the name of the specified data source.
    • --tenant: (Optional) Specifies the tenant resource queue started by the cluster. Do not specify it as the default queue of a tenant. When this parameter is used, the service user must have the role permission of the tenant. Whether MRS 3.3.0 and later versions are available is determined as follows:
      • This parameter is optional if strict verification is disabled.
      • This parameter is mandatory if strict verification is enabled.
    • --schema: (Optional) Specifies the name of the schema of the data source to be accessed.
    • --user: (Mandatory in normal mode) Specifies the name of the user who logs in to the client to execute services. The user must have at least the role of the queue specified by --tenant.
    • It takes about 120 seconds for your first login to the client because the HetuEngine cluster needs to be started in the background.
    • The client supports SQL syntax and is compatible with the SQL syntax of the open-source openLooKeng 1.2.0.
    • You can run the hetu-cli --help command to view other parameters.