Help Center/ MapReduce Service/ FAQs/ Component Configurations/ How Do I Configure Other Data Sources on Presto?
Updated on 2024-08-16 GMT+08:00

How Do I Configure Other Data Sources on Presto?

This topic uses the MySQL data source as an example.

  • For MRS 1.x and 3.x clusters, do the following:
    1. Log in to the MRS management console.
    2. Click the name of the cluster to go to its details page.
    3. Click the Components tab and then Presto in the component list. On the page that is displayed, click the Configurations tab then the All Configurations sub-tab.
    4. On the Presto configuration page that is displayed, find connector-customize.
    5. Set Name and Value as follows:

      Name: mysql.connector.name

      Value: mysql

    6. Click the plus sign (+) to add three more fields and set Name and Value according to the table below. Then click Save.

      Table 1 Parameter description

      Name

      Value

      Description

      mysql.connection-url

      jdbc:mysql://xxx.xxx.xxx.xxx:3306

      Database connection pool

      mysql.connection-user

      xxxx

      Database username

      mysql.connection-password

      xxxx

      Database password

    7. Restart the Presto service.
    8. Run the following command to connect to the Presto Server of the cluster:

      presto_cli.sh --krb5-config-path {krb5.conf path} --krb5-principal {User principal} --krb5-keytab-path {user.keytab path} --user {presto username}

    9. Log in to Presto and run the show catalogs command to check whether the data source list of Presto can be queried.

      Run the show schemas from mysql command to query the MySQL database.

  • For MRS 2.x clusters, do the following:
    1. Create the mysql.properties configuration file containing the following content:
      connector.name=mysql
      connection-url=jdbc:mysql://IP address of MySQL:3306
      connection-user=Username
      connection-password=Password
      • The IP Address of MySQL is that of the MySQL instance, which must be able to communicate with the MRS cluster.
      • The username and password are those used to log in to the MySQL database.
      • Configuration files containing authentication passwords pose security risks. Delete such files after configuration or store them securely.
    2. Upload the configuration file to the /opt/Bigdata/MRS_Current/1_14_Coordinator/etc/catalog/ directory on the Master node (where the Coordinator instance resides) and the /opt/Bigdata/MRS_Current/1_14_Worker/etc/catalog/ directory on the Core node (depending on the actual directory in the cluster), and change the file owner group to omm:wheel.
    3. Restart the Presto service.