Apache Druid
  • 24 Feb 2023
  • 2 Minutes to read
  • Dark
    Light

Apache Druid

  • Dark
    Light

Article summary

Overview

In this article we will explain how to connect an Apache Druid (Imply) database to Preset. So let's get started!


Allowlist Preset IPs

Preset Cloud runs on four regions. For Preset to access your data, first thing you need to do is to add region based Preset IP addresses to your Inbound and Outbound firewall rules.

us-west-2 (us1a)us-east-1 (us2a)eu-north-1 (eu5a)ap-northeast-1 (ap1a)
35.161.45.1144.193.153.19613.48.95.335.74.159.67
54.244.23.8552.70.123.5213.51.212.16535.75.171.157
52.32.136.3454.83.88.9316.170.49.2452.193.196.211

If you are not sure where your Preset workspace is located, you can refer to the URL on your browser when accessing Preset. It should look like this: https://xxxxxxxx.us2a.app.preset.io/superset..., where us2a means it is in us-east-1.


Step 1: Retrieve Data from Imply

In order to connect Apache Druid (Imply) to Preset, we first need to retrieve some key data from the Imply environment:

  • Required to Construct SQLAlchemy URI
    • Initial Druid API User
    • Initial Druid API Pass
    • Public Load Balancer Endpoint
  • Required Security for Preset
    • Root Certificate

To start, let's navigate to your Imply cluster and then select Manage.

Retrieve_Cluster_Data_1

...then select API.

You will notice that this screen contains all of the required information for the subsequent connection steps below.

Retrieve_Cluster_Data_2


Step 2: Connect Database to Preset

Add Database

Let's start by selecting + Database — have a look at Connecting your Data if you need help wth this step.

...then, in the Connect a database window, select Apache Druid in the Supported Databases field.

Apache_Druid_Select_Database

In the Display Name field, enter a meaningful name for the new connection to the Apache Druid database. In this example, we simply used the default Apache Druid.

In the SQLAlchemy URI field, customize your URI connection string using the following syntax:

druid+https://<User>:<password>@<Host>:<Port-default-8082>/druid/v2/sql
Alternative URI

In the event that you do not have authorization set up, you can replace druid+https with druid+http and skip the username and password credentials.

Required elements retrieved earlier that will be used here include:

  • Initial Druid API User
  • Initial Druid API Pass
  • Public Load Balancer Endpoint

When done, select the Advanced tab.

Apache_Druid_Completed_Basic_Tab

Configure Advanced Tab

In the Imply API menu screen referenced in Step 1 above, navigate to the URL in the Root Certificate field and then copy the certificate.

In Preset with the Advanced tab selected, expand the Security section.

In the Root Certificate field, paste the certificate from your system's clipboard.

Apache_Druid_Root_Certificate

Next, expand the Other section.

Aurora_PostgreSQL_Open_Advanced_Other_Section

In the Engine Parameters section, enter the following parameters:

{"context":
    {
        "useGroupingSetForExactDistinct": "true",
        "useUseApproximateCountDistinct": "false"
    }
}

Apache_Druid_Engine_Params

When done, return to the previous screen by selecting the Basic tab.

Aurora_PostgreSQL_Select_Basic_Tab

Test and Connect

To test your connection, select Test Connection. If successful, a notification message appears:

Aurora_PostgreSQL_Connection_Looks_Good

After a successful test, go ahead and select Connect to finalize the connection.

Apache_Druid_Connect

Congratulations, your Apache Druid database is now connected to Preset!


Was this article helpful?