Облачная платформаAdvanced

Connecting to a Hive Data Source

Эта статья полезна?
Язык статьи: Английский
Перевести

DataArts Insight allows you to connect to a Hive data source. This section describes how to connect DataArts Insight to a Hive data source.

Preparations

Do the following to check if a VPCEP security group is added:

  1. Log in to the management console.
  2. In the service list, choose > MapReduce Service to access the MRS console.
  3. Select a region in the upper left corner.
  4. In the navigation pane on the left, choose Clusters.
  5. Click the name of the cluster you want to connect to. The cluster overview page is displayed.
  6. Locate the Network Information area. Click Add Security Group Rule next to EIP. In the Add Security Group Rule dialog box, click Manage Security Group Rule. Click the Inbound Rules tab and check whether a VPC endpoint security group is added.
    • If yes, return to the DataArts Insight data source editing page to connect to the data source.
    • If no, perform the following steps to add a security group:
      1. Click Add Rule. In the displayed Add Inbound Rule dialog box, set the protocol, port, and source IP address. To add multiple rules, click Fast-Add Rule.
      2. Confirm the parameter settings and click OK to return to the DataArts Insight page and connect to the data source.
      Note

      If no EIP is bound, locate the Network Information area and click Bind next to EIP. Click Manage Security Group Rule and then the Inbound Rules tab to check or add a security group.

      If the data source connection test fails after the security group is added, the possible cause is that SASL_SSL is not enabled for that data source.

Accessing a Hive Data Source Through a Public Network

  1. In the navigation pane on the left, choose Data Management > Data Sources. On the displayed page, click Create Data Source. In the slide-out panel, set Source Database Type to Hive and Access Network Type to Public network.
  2. Set other parameters based on Table 1.

    Figure 1 Parameters for connecting to a Hive data source


    Table 1 Parameters

    Parameter

    Mandatory

    Description

    Source Database Type

    Yes

    Type of the accessed data source. In this example, Hive is selected.

    Access Network Type

    Yes

    In this example, Public network is selected.

    Name

    Yes

    Name of the data source displayed in the list.

    Domain Name

    Yes

    IP address of the data source.

    Username

    Yes

    Username for logging in to the database.

    Password

    Yes

    Password for logging in to the database.

    Port

    Yes

    Port number for logging in to the database.

    Database

    Yes

    Name of the database to be logged in to.

    SASL_SSL

    -

    It is used for trusted identity authentication and secure data transmission when DataArts Insight retrieves data from the data source. This function is enabled by default.

    NOTE:

    To connect to an MRS security cluster, enable SASL_SSL. For an MRS non-security cluster, disable SASL_SSL.

    Username

    Yes

    Username for logging in to the database.

    Authentication Mode

    Yes

    The options are Password authentication and Certificate authentication.

    Password

    No

    Mandatory when Authentication Mode is set to password verification

    Password for logging in to the database.

    Security Certificate

    No

    Mandatory when Authentication Mode is set to certificate verification

    To download and upload a security certificate, perform the following steps:

    • Log in to FusionInsight Manager of the MRS cluster. Specifically, click an MRS cluster. On the displayed Dashboard tab, locate the O&M Management area, and click Access Manager next to MRS Manager.
    • Click System on the top menu bar.
    • Choose Permission > User. On the displayed page, locate a user, click More in the Operation column, and select Download Authentication Credential from the drop-down list.
    • Once the certificate is downloaded, return to the page for creating a data source and click Upload Certificate to upload the certificate.
      NOTE:

      The certificate size for upload should not exceed 5 MB and must be in a file format ending with .tar.

    principal

    No

    Mandatory when Authentication Mode is set to certificate verification

    How to obtain:

    • Log in to FusionInsight Manager of the MRS cluster. Specifically, click an MRS cluster. On the displayed Dashboard tab, locate the O&M Management area, and click Access Manager next to MRS Manager.
    • Click Homepage in the upper part of the page.
    • Click More and select Download Client. The Download Cluster Client page is displayed.
    • Set Select Client Type to Configuration Files Only and Select Platform Type to x86_64, and click OK. The client configuration file is successfully downloaded.
    • Decompress the client configuration file, open the Hive > config > hive-site.xml file, search for principal, and obtain the principal value.

      Figure 2 Obtaining the principal value


    • Return to the page for creating a data source and enter the obtained principal value in the principal field box.
  3. Click Test Connection to test the data source connectivity.
  4. Once the test is successful, click OK.

Accessing a Hive Data Source Through a VPC Network

  1. Click in the upper left corner of the management console to select a region and select an enterprise project from Enterprise Project in the upper right corner of the Workspace page.
  2. On the top of the console, click Projects and click the name of a desired project.
  3. In the navigation pane on the left, choose Data Management > Data Sources. On the displayed page, click Create Data Source. In the slide-out panel, set Source Database Type to Hive and Access Network Type to MRS Hive.
  4. Set other parameters based on Table 2.
    Note

    The selection of MRS instances only determines the VPC and subnet to be connected, and does not have any corresponding relationship with the server list.

    Figure 3 Parameters for connecting to a Hive cloud data source


    Table 2 Parameters

    Parameter

    Mandatory

    Description

    Source Database Type

    Yes

    Type of the accessed data source. In this example, Hive is selected.

    Access Network Type

    Yes

    In this example, MRS Hive is selected.

    Region

    Yes

    Region where the Hive service host is located.

    Name

    Yes

    Name of the data source displayed in the list, which is user-defined.

    Description

    No

    Description of the data source.

    Instance

    Yes

    Role instance corresponding to the Hive service.

    Servers

    Yes

    Hive server list.

    Database

    Yes

    Name of the database to be logged in to.

    SASL_SSL

    -

    It is used for trusted identity authentication and secure data transmission when DataArts Insight retrieves data from the data source. This function is enabled by default.

    NOTE:

    To connect to an MRS security cluster, enable SASL_SSL. For an MRS non-security cluster, disable SASL_SSL.

    Username

    Yes

    Username for logging in to the database.

    Authentication Mode

    Yes

    The options are Password authentication and Certificate authentication.

    Password

    Yes

    Password for logging in to the database.

  5. Click Test Connection to test the data source connectivity.
  6. Once the test is successful, click OK.