Set up Aiven for ClickHouse® data source integrations
Connect your Aiven for ClickHouse® service with another Aiven-managed service or external data source to make your data available in the Aiven for ClickHouse service.
Prerequisites
- You are familiar with the limitations listed in About Aiven for ClickHouse® data service integration.
- You have an organization, a project, and an Aiven for ClickHouse service in Aiven.
- You have access to the Aiven Console.
Create Apache Kafka integrations
Learn about managed databases integrations.
Make Apache Kafka data available in Aiven for ClickHouse using the Kafka engine:
-
Log in to the Aiven Console, and go to an organization and a project.
-
From Services, select an Aiven for ClickHouse service to integrate with a data source.
-
On the service's Overview page, click Integrations in the sidebar.
-
On the Integrations page, go to the Data sources section and click Apache Kafka.
The Apache Kafka data source integration wizard opens and displays a list of external data sources or Aiven-managed data services available for integration. If there are no data sources to integrate with, the wizard allows you to create them either by clicking Create service (for Aiven-managed sources) or Add external endpoint (for external sources).
-
In the Apache Kafka data source integration wizard:
-
Select a data source to integrate with, and click Continue.
noteIf a data source to integrate with is not available on the list, click one of the following:
- Create service: to create an Aiven-managed data service to integrate with
- Create external endpoint: to make your external data source available for integration
-
Create tables where your Apache Kafka data will be available in Aiven for ClickHouse. Enter Table name, Consumer group name, Topics, Data format, and Table columns. Click Save table details.
tipYou can query the created tables using the following statement:
SELECT *
FROM APACHE_KAFKA_RESOURCE_NAME.APACHE_KAFKA_TABLE_NAME -
Click Enable integration > Close.
-
Create PostgreSQL integrations
Learn about managed databases integrations.
Make PostgreSQL data available in Aiven for ClickHouse using the PostgreSQL engine:
-
Log in to the Aiven Console, and go to an organization and a project.
-
From Services, select an Aiven for ClickHouse service to integrate with a data source.
-
On the service's Overview page, click Integrations in the sidebar.
-
On the Integrations page, go to the Data sources section and click PostgreSQL.
The PostgreSQL data source integration wizard opens and displays a list of external data sources or Aiven-managed data services available for integration. If there are no data sources to integrate with, the wizard allows you to create them either by clicking Create service (for Aiven-managed sources) or Add external endpoint (for external sources).
-
In the PostgreSQL data source integration wizard:
-
Select a data source to integrate with, and click Continue.
noteIf a data source to integrate with is not available on the list, click one of the following:
- Create service: to create an Aiven-managed data service to integrate with
- Create external endpoint: to make your external data source available for integration
-
Optionally, create databases where your PostgreSQL data will be available in Aiven for ClickHouse. Enter Database name and Database schema.
tipYou can query the created databases using the following statement:
SELECT *
FROM POSTGRESQL_RESOURCE_NAME.POSTGRESQL_TABLE_NAMEnoteYou can create such integration databases any time later, for example, by finding your integration on the Integrations page and clicking Actions > Edit database.
-
Click Enable integration > Close.
-
Use managed-credentials integrations
Learn about managed credentials integrations.
Set up a managed-credentials integration and create tables for the data to be made available through the integration. Access your stored credentials.
Create managed-credentials integrations
-
Log in to the Aiven Console, and go to an organization and a project.
-
From Services, select an Aiven for ClickHouse service to integrate with a data source.
-
On the service's Overview page, click Integrations in the sidebar.
-
On the Integrations page, go to the Data sources section and click ClickHouse Credentials.
The ClickHouse credentials integration wizard opens and displays a list of external data sources or Aiven-managed data services available for integration. If there are no data sources to integrate with, the wizard allows you to create them either by clicking Create service (for Aiven-managed sources) or Add external endpoint (for external sources).
-
In the ClickHouse credentials integration wizard:
-
Select a data source to integrate with.
noteIf a data source to integrate with is not available on the list, click one of the following:
- Create service: to create an Aiven-managed data service to integrate with
- Create external endpoint: to make your external data source available for integration
-
Click Enable integration.
-
Optionally, click Test connection > Open in query editor > Execute.
AlternativeYou can test the connection any time later by going to your Aiven for ClickHouse service's Integrations page, finding the credentials integration, and clicking Actions > Test connection.
-
Click Close.
-
Create tables
Create tables using table engines, for example the PostgreSQL engine:
CREATE TABLE default.POSTGRESQL_TABLE_NAME
(
`float_nullable` Nullable(Float32),
`str` String,
`int_id` Int32
)
ENGINE = PostgreSQL(postgres_credentials);
For details on how to use different table engines for integrations with external systems, see the upstream ClickHouse documentation.
Access credentials storage
Depending on the type of data source you are integrated with, you can access your credentials storage by passing your data source name in the following query:
SELECT *
FROM postgresql(
`service_POSTGRESQL_SOURCE_NAME`,
database='defaultdb',
table='tables',
schema='information_schema'
)
SELECT *
FROM mysql(
`service_MYSQL_SOURCE_NAME`,
database='mysql',
table='slow_log'
)
SELECT * FROM s3(
`endpoint_S3_SOURCE_NAME`,
filename='*.csv',
format='CSVWithNames')
When you try to run a managed credentials query with a typo, the query fails with an error message related to grants.
View data source integrations
-
Log in to the Aiven Console, and go to an organization and a project.
-
From Services, select an Aiven for ClickHouse service to display integrations for.
-
On the service's page, go to one of the following:
- Overview in the sidebar > Integrations
- Integrations in the sidebar
Stop data source integrations
By terminating a data source integration, you disconnect from the data source, which erases all databases and configuration information from Aiven for ClickHouse.
-
Log in to the Aiven Console, and go to an organization and a project.
-
From Services, select an Aiven for ClickHouse service you want to stop integrations for.
-
On the service's page, take one of the following courses of action:
- Click Overview > Integrations, find an integration to be stopped, and click Actions > Disconnect.
- Click Integrations, find an integration to be stopped, and click Actions > Disconnect.
Your integration is terminated and all the corresponding databases and configuration information are deleted.
Related pages