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

Using the MOTService Client

Scenario

Use the MOTService client in an O&M or service scenario.

Prerequisites

  • The client has been installed. For example, the installation directory is /opt/hadoopclient. The client directory in the following operations is only an example. Replace it with the actual one.
  • Service component users have been created by the MRS cluster administrator. In security mode, machine-machine users have downloaded the keytab file. A human-machine user must change their password upon the first login.
  • A database to be connected has been created by referring to Using MOTService from Scratch.

Using the MOTService Client

  1. Log in to the node where the client is installed as the client installation user.
  2. Run the following command to switch to the client installation directory:

    cd /opt/hadoopclient

  3. Run the following command to configure environment variables:

    source bigdata_env

  4. If multiple MOTService instances are installed, run the following command to load the environment variables of a specific MOTService instance when using the client to connect to the instance. Otherwise, skip this step. For example, to load the environment variables of the MOTService2 instance, run the following command:

    source MOTService2/component_env

  5. Log in to the user-defined database.

    gsql -d Database name -p Database connection port -U Username -W User password -r

    Example:

    gsql -d db_mot -p 20105 -U motuser -W password -r

    If the following information is displayed, the login is successful:

    gsql ((openGauss x.x.x) compiled at xxxx-xx-xx 18:03:55 commit 0 last mr 169 )
    Non-SSL connection (SSL connection is recommended when requiring high-security)
    Type "help" for help.
    
    db_mot=>

    If the service generation node and the MOTService node are not the same one, you can add the -h parameter. By default, the SSL connection is used. For example:

    gsql -d db_mot -p 20105 -U motuser -W password -h 'IP address for logging in to the MOTService database' -r

    If the following information is displayed, the login is successful:

    gsql ((openGauss x.x.x) compiled at xxxx-xx-xx 18:03:55 commit 0 last mr 169 )
    SSL connection (cipher: ECDHE-RSA-AES128-GCM-SHA256, bits: 128)
    Type "help" for help.
    
    db_mot=>

    Perform the following operations to determine whether to use only SSL connections:

    Log in to FusionInsight Manager, choose Cluster > Services > MOTService, and click Configurations then All Configurations. Search for REQUIRE_SSL and configure it.

    • true: The server supports only SSL connections.
    • false: The server can use or not use SSL connections. If SSL connections are not used, there are security risks.