|
| 1 | +--- |
| 2 | +sidebar_label: 'BladePipe' |
| 3 | +sidebar_position: 20 |
| 4 | +keywords: ['clickhouse', 'BladePipe', 'connect', 'integrate', 'cdc', 'etl', 'data integration'] |
| 5 | +slug: /integrations/bladepipe |
| 6 | +description: 'Stream data into ClickHouse using BladePipe data pipelines' |
| 7 | +title: 'Connect BladePipe to ClickHouse' |
| 8 | +--- |
| 9 | + |
| 10 | +import Image from '@theme/IdealImage'; |
| 11 | +import bp_ck_1 from '@site/static/images/integrations/data-ingestion/etl-tools/bp_ck_1.png'; |
| 12 | +import bp_ck_2 from '@site/static/images/integrations/data-ingestion/etl-tools/bp_ck_2.png'; |
| 13 | +import bp_ck_3 from '@site/static/images/integrations/data-ingestion/etl-tools/bp_ck_3.png'; |
| 14 | +import bp_ck_4 from '@site/static/images/integrations/data-ingestion/etl-tools/bp_ck_4.png'; |
| 15 | +import bp_ck_5 from '@site/static/images/integrations/data-ingestion/etl-tools/bp_ck_5.png'; |
| 16 | +import bp_ck_6 from '@site/static/images/integrations/data-ingestion/etl-tools/bp_ck_6.png'; |
| 17 | +import bp_ck_7 from '@site/static/images/integrations/data-ingestion/etl-tools/bp_ck_7.png'; |
| 18 | +import bp_ck_8 from '@site/static/images/integrations/data-ingestion/etl-tools/bp_ck_8.png'; |
| 19 | +import bp_ck_9 from '@site/static/images/integrations/data-ingestion/etl-tools/bp_ck_9.png'; |
| 20 | +import CommunityMaintainedBadge from '@theme/badges/CommunityMaintained'; |
| 21 | + |
| 22 | +# Connect BladePipe to ClickHouse |
| 23 | + |
| 24 | +<CommunityMaintainedBadge/> |
| 25 | + |
| 26 | + |
| 27 | +<a href="https://www.bladepipe.com/" target="_blank">BladePipe</a> is a real-time end-to-end data integration tool with sub-second latency, boosting seamless data flow across platforms. |
| 28 | + |
| 29 | +ClickHouse is one of BladePipe's pre-built connectors, allowing users to integrate data from various sources into ClickHouse automatically. This page will show how to load data into ClickHouse in real time step by step. |
| 30 | + |
| 31 | +## Supported sources {#supported-sources} |
| 32 | +Currently BladePipe supports for data integration to ClickHouse from the following sources: |
| 33 | +- MySQL/MariaDB/AuroraMySQL |
| 34 | +- Oracle |
| 35 | +- PostgreSQL/AuroraPostgreSQL |
| 36 | +- MongoDB |
| 37 | +- Kafka |
| 38 | +- PolarDB-MySQL |
| 39 | +- OceanBase |
| 40 | +- TiDB |
| 41 | + |
| 42 | +More sources are to be supported. |
| 43 | + |
| 44 | + |
| 45 | +<VerticalStepper headerLevel="h2"> |
| 46 | +## Download and run BladePipe {#1-run-bladepipe} |
| 47 | +1. Log in to <a href="https://www.bladepipe.com/" target="_blank">BladePipe Cloud</a>. |
| 48 | + |
| 49 | +2. Follow the instructions in <a href="https://doc.bladepipe.com/productOP/byoc/installation/install_worker_docker" target="_blank">Install Worker (Docker)</a> or <a href="https://doc.bladepipe.com/productOP/byoc/installation/install_worker_binary" target="_blank">Install Worker (Binary)</a> to download and install a BladePipe Worker. |
| 50 | + |
| 51 | + :::note |
| 52 | + Alternatively, you can download and deploy <a href="https://doc.bladepipe.com/productOP/onPremise/installation/install_all_in_one_binary" target="_blank">BladePipe Enterprise</a>. |
| 53 | + ::: |
| 54 | + |
| 55 | +## Add ClickHouse as a target {#2-add-clickhouse-as-a-target} |
| 56 | + |
| 57 | + :::note |
| 58 | + 1. BladePipe supports ClickHouse version `20.12.3.3` or above. |
| 59 | + 2. To use ClickHouse as a target, make sure that the user has SELECT, INSERT and common DDL permissions. |
| 60 | + ::: |
| 61 | + |
| 62 | +1. In BladePipe, click "DataSource" > "Add DataSource". |
| 63 | + |
| 64 | +2. Select `ClickHouse`, and fill out the settings by providing your ClickHouse host and port, username and password, and click "Test Connection". |
| 65 | + |
| 66 | + <Image img={bp_ck_1} size="lg" border alt="Add ClickHouse as a target" /> |
| 67 | + |
| 68 | +3. Click "Add DataSource" at the bottom, and a ClickHouse instance is added. |
| 69 | + |
| 70 | +## Add MySQL as a source {#3-add-mysql-as-a-source} |
| 71 | +In this tutorial, we use a MySQL instance as the source, and explain the process of loading MySQL data to ClickHouse. |
| 72 | + |
| 73 | +:::note |
| 74 | +To use MySQL as a source, make sure that the user has the <a href="https://doc.bladepipe.com/dataMigrationAndSync/datasource_func/MySQL/privs_for_mysql" target="_blank">required permissions</a>. |
| 75 | +::: |
| 76 | + |
| 77 | +1. In BladePipe, click "DataSource" > "Add DataSource". |
| 78 | + |
| 79 | +2. Select `MySQL`, and fill out the settings by providing your MySQL host and port, username and password, and click "Test Connection". |
| 80 | + |
| 81 | + <Image img={bp_ck_2} size="lg" border alt="Add MySQL as a source" /> |
| 82 | + |
| 83 | +3. Click "Add DataSource" at the bottom, and a MySQL instance is added. |
| 84 | + |
| 85 | + |
| 86 | +## Create a pipeline {#4-create-a-pipeline} |
| 87 | + |
| 88 | +1. In BladePipe, click "DataJob" > "Create DataJob". |
| 89 | + |
| 90 | +2. Select the added MySQL and ClickHouse instances and click "Test Connection" to ensure BladePipe is connected to the instances. Then, select the databases to be moved. |
| 91 | + <Image img={bp_ck_3} size="lg" border alt="Select source and target" /> |
| 92 | + |
| 93 | +3. Select "Incremental" for DataJob Type, together with the "Full Data" option. |
| 94 | + <Image img={bp_ck_4} size="lg" border alt="Select sync type" /> |
| 95 | + |
| 96 | + |
| 97 | +4. Select the tables to be replicated. |
| 98 | + <Image img={bp_ck_5} size="lg" border alt="Select tables" /> |
| 99 | + |
| 100 | +5. Select the columns to be replicated. |
| 101 | + <Image img={bp_ck_6} size="lg" border alt="Select columns" /> |
| 102 | + |
| 103 | + |
| 104 | +6. Confirm the DataJob creation, and the DataJob runs automatically. |
| 105 | + <Image img={bp_ck_8} size="lg" border alt="DataJob is running" /> |
| 106 | + |
| 107 | + |
| 108 | +## Verify the data {#5-verify-the-data} |
| 109 | +1. Stop data write in MySQL instance and wait for ClickHouse to merge data. |
| 110 | +:::note |
| 111 | +Due to the unpredictable timing of ClickHouse's automatic merging, you can manually trigger a merging by running the `OPTIMIZE TABLE xxx FINAL;` command. Note that there is a chance that this manual merging may not always succeed. |
| 112 | + |
| 113 | +Alternatively, you can run the `CREATE VIEW xxx_v AS SELECT * FROM xxx FINAL;` command to create a view and perform queries on the view to ensure the data is fully merged. |
| 114 | +::: |
| 115 | + |
| 116 | +2. Create a <a href="https://doc.bladepipe.com/operation/job_manage/create_job/create_period_verification_correction_job" target="_blank">Verification DataJob</a>. Once the Verification DataJob is completed, review the results to confirm that the data in ClickHouse is the same as the data in MySQL. |
| 117 | + <Image img={bp_ck_9} size="lg" border alt="Verify data" /> |
| 118 | + |
| 119 | +</VerticalStepper> |
| 120 | + |
0 commit comments