Help Center/ MapReduce Service/ Component Operation Guide (ME-Abu Dhabi Region)/ Using Presto/ Presto FAQ/ How Do I Configure Multiple Hive Connections for Presto?
Updated on 2024-07-19 GMT+08:00

How Do I Configure Multiple Hive Connections for Presto?

Question

How do I configure multiple Hive connections for Presto?

Procedure

  1. Copy and distribute the core-site.xml and hdfs-site.xml files of the target Hive cluster to the Presto cluster and place them in a path (for example, /home/omm) on which user omm has the read permission. Change the file owner to omm:wheel and file permission to 750.
  2. Go to the Presto configuration page.

    • For versions later than MRS 1.8.10 and version MRS 2.x: Click the cluster name on the MRS console, choose Components > Presto > Service Configuration, and select All from the Basic drop-down list.

      If the Components tab is unavailable, complete IAM user synchronization first. (On the Dashboard page, click Synchronize on the right side of IAM User Sync to synchronize IAM users.)

    • For MRS 3.x or later: Log in to FusionInsight Manager and choose Cluster > Name of the desired cluster > Services > Presto. Click Configurations then All Configurations.

  3. Search for connector-customize in the search box.
  4. Add a connector named myhive.

    Add the following configuration to connector-customize:

    myhive.connector.name=hive-hadoop2

    myhive.hive.metastore.uri=thrift://{Metastore server IP address of the target Hive cluster}:{Metastore server port of the target Hive cluster} (Use commas (,) to separate multiple Metastore server addresses, for example, thrift://192.0.2.1:9083,thrift://192.0.2.2:9083.)

    myhive.hive.config.resources=/etc/hadoop/conf/core-site.xml,/etc/hadoop/conf/hdfs-site.xml (absolute path of the configuration files in 1)

    For details about other configurations, see https://trino.io/docs/333/connector/hive.html#hive-configuration-properties.

    When you add a configuration, add the connector name as the prefix to the configuration name. In this example, the connector name is myhive.

  5. Save the configuration and restart the Presto service.

    Use the Presto client, JDBC, or UI tool to connect to the Presto service. Run the show schemas from myhive; command. If the database in the target cluster is displayed, the configuration is successful.