Domain Integration

ClickHouse clusters on our platform by default have security restrictions preventing egress traffic but can be integrated with public domains to enable access.

Once a domain is integrated, the cluster will be able to access specific domains from the cluster, or use the ClickHouse table engine functions where access path is domain-based (e.g., URL, AzureBlobStorage, AzureQueue, S3, S3Queue, etc) to read and write data to that domain. Examples for both scenarios are provided later on the page. 

Clusters on the Netapp Instaclustr managed platform are secured through egress firewall rules to protect against data exfiltration. Integrating with Domains adds a whitelist rule to the firewall enabling access. Consider the security risk before enabling a Domain integration.

How To Enable

You can set up ClickHouse Domain integrations using the Instaclustr Console, API, or Terraform provider. Steps for using each method is provided below.

Using the Console

The following steps explain how to integrate a ClickHouse cluster with a Domain.

  1. First select the “Integrations” option in console. The page will show supported integration types of the cluster 

  2. Click “Configure” for Domain integration to configure or view domain integrations for the cluster.

  3. Specify the domain to integrate with and click “Add” to add the domain into the list below. Repeat the process to add all the domains you wish to integrate with.
  4. Finally press “Apply” to apply the integration change
  5. You will see the status of it becoming “APPLIED” on the integrations page. It might take 10 to 15 minutes for the rules to be enforced.
  6. The integrations will now show on the same “Configure” page, and you can choose to remove the domains by clicking “Remove” and then “Apply” the change again.

Once domain integration is enabled, you would be able to use certain domain-based ClickHouse table engines. Below are a few examples.  

Using the API

You can create, view, and remove your Domain integrations using the Instaclustr API. An example for the POST endpoint is provided below.  

  • Endpoint: https://api.instaclustr.com/cluster-management/v2/resources/applications/clickhouse/integrations/domain/v2
  • Payload
  • Example response:

For details on all API endpoints, please refer to the Instaclustr API documentation. 

Using the Terraform Provider

You can manage your AWS Private S3 Bucket integrations using Terraform. The steps are as follows:  

  1. Follow this support document to set up your Instaclustr Terraform Provider V2. 
  2. Populate the resource template below with information about the integration.

  3. Follow the Terraform init, plan, and apply cycle to provision the integration

For details of the Terraform resources, please refer to the Instaclustr Terraform documentation 

How To Use ClickHouse URL Table Engine

ClickHouse’s URL table engine provide robust mechanisms for working with large datasets stored on the web. By leveraging these engines, you can efficiently manage and query your data directly from ClickHouse.  Brief examples regarding usage are included below.

For detailed information, refer to the official documentation:

URL Table Engine

The URL table engine allows you to create tables that read from and write to online data, in a range of formats.

Creating an S3 Table

To create a table using the S3 engine, you need to specify the URL and the format of the data. Here is an example:

 Loading Data

Load data into the table by inserting data directly:

Querying Data

Query data from the URL table as you would with any other table:

AzureBlobStorage Table Engine 

The AzureBlobStorage table engine provides an integration with Azure Blob Storage ecosystem, allowing you to create tables that read from and write to Azure Blob storage account data, in a range of formats. 

Creating an AzureBlobStorage Table 

To create a table using the AzureBlobStorage engine, you need to specify the storage account endpoint, the Shared Access Signatures (SAS), and the format of the data. Here is an example from the ClickHouse GitHub documentation: 

Loading Data 

Load data into the table by inserting data directly: 

Querying Data 

Query data from the AzureBlobStorage table as you would with any other table: 

AzureQueue Table Engine 

The AzureQueue table engine provides an integration with the Azure Blob Storage ecosystem, allowing streaming data import. 

Creating an AzureQueue Table 

Similar to creating an AzureBlobStorage table, an AzureQueue table could be created as follows (examples taken from the ClickHouse GitHub documentation):  

As an alternative to using account key for access, you could format a connection string as follows using the SAS token generated from the storage account level with desired permissions: 

Unlike AzureBlobStorage table engine though, the AzureQueue table engine is used for streaming data, therefore SELECT queries are not particularly useful as all files will only be read once. It is more practical to create real-time threads using materiralized views as follows: