Adding a ClickHouse data source enables you to connect an ApsaraDB for ClickHouse database to Quick BI. After establishing the connection, you can analyze and visualize data in Quick BI. Quick BI supports connecting to ApsaraDB for ClickHouse through the Internet or Alibaba Cloud VPC. This topic describes how to add an ApsaraDB for ClickHouse data source.
Prerequisites
You have created an ApsaraDB for ClickHouse cluster. For more information, see Create a cluster.
Background information
If you use an ApsaraDB for ClickHouse database, you can add a ClickHouse data source when connecting to Quick BI for data analysis.
When a ClickHouse data source is connected to Quick BI, the network type for data connection and access can be either the Internet or Alibaba Cloud VPC.
Limits
Only workspace administrators and developers can add data sources.
Only the Professional Edition and Premium Edition support creating ClickHouse data sources.
Versions 20.3, 22.8, and 23.8 are supported.
Procedure
Create a whitelist for the ClickHouse database.
Before connecting to ApsaraDB for ClickHouse, you need to add the IP addresses of Quick BI IP addresses of Quick BI to the whitelist of ApsaraDB for ClickHouse. For information about how to add an IP address to the whitelist of ApsaraDB for ClickHouse, see Configure a whitelist.
Add an ApsaraDB for ClickHouse data source and verify that the data source can be connected.
Log on to the Quick BI console.
Perform the steps that are shown in the following figure to add a data source.
Go to the Create Data Source page from the entry for creating a data source.
On the Alibaba Cloud Database tab, select ClickHouse data source.
In the Configure Connection dialog box, you can complete the configurations based on your business scenario.
Name
Description
Display Name
The name of the data source. The name is displayed in the data source list.
The name cannot contain special characters or start or end with spaces.
Database Address and Port
The public endpoint of the ClickHouse database. If you use a VPC data source, enter the internal endpoint and internal port of the database.
Log on to the ApsaraDB for ClickHouse console and obtain the database address from the Network Information section. Example: cc-xxxxxxxxxxxxxxxxxx.ads.rds.aliyuncs.com.
Database
The name of the ClickHouse database that is customized when you deploy the database.
Username and Password
The username and password that are used to access the ClickHouse database.
Time zone
The time zone where the ClickHouse database is deployed.
Database version
Select the version of the ClickHouse database.
If the database version is 23.8 or later, select 23.8. If the database version is earlier than 23.8, select 22.8.
SSL
If the destination data source has SSL configured, you can select the SSL security protocol to protect data security.
VPC Data Source
If the database uses Alibaba Cloud VPC, select VPC data source and configure the following parameters:
Buyer's AccessId: The AccessKey ID of the account that purchased this instance. For more information, see Obtain an AccessKey pair.
NoteMake sure that the AccessKey ID has the Read permission on the destination instance. If it also has the Write permission, the system automatically adds the IP address to the whitelist. Otherwise, you need to manually add the IP address. For more information, see Create a custom access policy.
Buyer's AccessKey: The AccessKey Secret of the account that purchased this instance. For more information, see Obtain an AccessKey pair.
Instance ID: The ID of the ClickHouse database instance. Log on to the ApsaraDB for ClickHouse console and obtain the instance ID from the cluster list. For more information, see Add a ClickHouse Data Source.
Region: The region where the ClickHouse database instance is located.
Instance Version: Select the version of the instance. You can select Enterprise Edition or Community Edition.
NoteIf you select VPC data source, you need to enter the internal endpoint and internal port for the database address and port.
Init SQL
After this feature is enabled, you can configure SQL statements that are executed for initialization after the data source is connected.
The SQL statements that are executed for initialization each time the data source is connected. Only SET statements are allowed, and statements are separated by semicolons.
Enable file upload
After this feature is enabled, file uploads are supported.
Click Test Connection to test the connectivity of the data source.
After the test is successful, click OK.
What to do next
After you add a data source, you can create a dataset and analyze data.
To add data tables from the ClickHouse database or custom SQL statements to Quick BI, see Create and manage datasets.
To add visualization charts and analyze data, see Create a dashboard and Overview of visualization charts.
To drill down and perform in-depth data analysis, see Configure and display drill-down analysis.