You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set the StarRocks connection options to addresses of the FE:
2
+
3
+
-`jdbc-url`: `jdbc:mysql://<fe_host>:<fe_query_port>`. The query port defaults to `9030`.
4
+
-`load-url`: `<fe_host>:<fe_http_port>`. The HTTP port defaults to `8030`.
5
+
6
+
For `<fe_host>`, use an address that stays the same when an FE restarts or is replaced, such as a DNS name or a load balancer in front of the FEs, not the IP address of an FE. If the address stops leading to an FE, the Flink job can no longer load data.
7
+
8
+
The Flink TaskManagers must be able to reach these FE ports, and also the HTTP port (default `8040`) of every BE or CN, because the FE redirects each load request to a BE or CN.
Copy file name to clipboardExpand all lines: docs/en/integrations/loading_tools/SMT.md
+26-4Lines changed: 26 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ description: "StarRocks Migration Tool (SMT) is a data migration tool provided b
6
6
7
7
# StarRocks Migration Tool (SMT)
8
8
9
-
StarRocks Migration Tool (SMT) is a data migration tool provided by StarRocks to load data from source databases through Flink into StarRocks. SMT mainly can:
9
+
StarRocks Migration Tool (SMT) is a command-line tool that generates the SQL you need to load data from a source database into StarRocks through Flink. SMT mainly can:
10
10
- Generate statements to create tables in StarRocks based on information of the source database and the target StarRocks cluster.
11
11
- Generate SQL statements that can be executed in Flink's SQL client to submit Flink jobs for synchronizing data, which simplifies full or incremental data synchronization in the pipeline. Currently, SMT supports the following source databases:
12
12
@@ -22,6 +22,22 @@ StarRocks Migration Tool (SMT) is a data migration tool provided by StarRocks to
SMT generates SQL files and then exits. It reads the table definitions in your source database and writes two kinds of files to the `result` directory:
28
+
29
+
-`starrocks-create.*.sql`: CREATE TABLE statements, which you run in StarRocks.
30
+
-`flink-create.*.sql`: Flink SQL that defines a source table and a sink table and submits an `INSERT INTO ... SELECT` job, which you run in the Flink SQL client.
31
+
32
+
SMT does not start, run, or connect to Flink, and it does not move any data. You still install and run a Flink cluster with the Flink CDC connector for your source database and the [Flink connector for StarRocks](../../loading/Flink-connector-starrocks.md), and you run the generated files yourself.
33
+
34
+
### Synchronize data without SMT
35
+
36
+
SMT is optional. Instead, you can:
37
+
38
+
- Use a [Flink CDC pipeline](https://nightlies.apache.org/flink/flink-cdc-docs-stable/docs/core-concept/data-pipeline/). A pipeline is defined in a single YAML file, creates the StarRocks tables itself, and runs the synchronization. See [Realtime synchronization from PostgreSQL](../../loading/Flink_cdc_postgres.md), or for MySQL, [Streaming ELT from MySQL to StarRocks](https://nightlies.apache.org/flink/flink-cdc-docs-release-3.6/docs/get-started/quickstart-for-1.20/mysql-to-starrocks/) in the Flink CDC documentation.
39
+
- Create the StarRocks tables yourself, and write the Flink SQL with the [Flink connector for StarRocks](../../loading/Flink-connector-starrocks.md) as the sink. This works for any source that Flink can read.
40
+
25
41
## Steps to use SMT
26
42
27
43
The generally involved steps are as follows:
@@ -225,6 +241,12 @@ As shown in the image, SMT can automatically generate CREATE TABLE statements of
225
241
226
242
## Synchronize PostgreSQL to StarRocks
227
243
244
+
:::tip
245
+
246
+
With Flink CDC 3.5 or later, a Flink CDC pipeline can synchronize PostgreSQL to StarRocks without SMT, and creates the StarRocks tables itself. For a step-by-step guide, see [Realtime synchronization from PostgreSQL](../../loading/Flink_cdc_postgres.md).
247
+
248
+
:::
249
+
228
250
### Introduction
229
251
230
252
Flink CDC connector and SMT can synchronize data from PostgreSQL within subsecond.
@@ -334,9 +356,9 @@ Flink CDC connector reads the WAL of PostgreSQL and Flink-connector-starrocks wr
334
356
- How to enable PostgreSQL WAL?
335
357
336
358
```Bash
337
-
# Open connection permissions
338
-
echo "host all all 0.0.0.0/32 trust" >> pg_hba.conf
339
-
echo "host replication all 0.0.0.0/32 trust" >> pg_hba.conf
359
+
# Allow the Flink hosts to connect. Replace 10.0.0.0/24 with their address range.
360
+
echo "host all all 10.0.0.0/24 scram-sha-256" >> pg_hba.conf
361
+
echo "host replication all 10.0.0.0/24 scram-sha-256" >> pg_hba.conf
Copy file name to clipboardExpand all lines: docs/en/loading/Flink-connector-starrocks.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,8 @@ description: "How to use the StarRocks Flink connector to continuously load data
6
6
7
7
# Continuously load data from Apache Flink®
8
8
9
+
import FlinkStarRocksConnection from '../_assets/commonMarkdown/Edition_Specific_Flink_StarRocks_Connection.mdx'
10
+
9
11
StarRocks provides a self-developed connector named StarRocks Connector for Apache Flink® (Flink connector for short) to help you load data into a StarRocks table by using Flink. The basic principle is to accumulate the data and then load it all at a time into StarRocks through [STREAM LOAD](../sql-reference/sql-statements/loading_unloading/STREAM_LOAD.md).
10
12
11
13
The Flink connector supports DataStream API, Table API & SQL, and Python API. It has a higher and more stable performance than [flink-connector-jdbc](https://nightlies.apache.org/flink/flink-docs-master/docs/connectors/table/jdbc/) provided by Apache Flink®.
@@ -90,6 +92,10 @@ In your Maven project's `pom.xml` file, add the Flink connector as a dependency
90
92
>
91
93
> The name of Flink connector which is not formally released contains the `SNAPSHOT` suffix.
Copy file name to clipboardExpand all lines: docs/en/loading/Flink_cdc_load.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ description: "How to use Flink CDC to capture MySQL change data in real time and
12
12
# Realtime synchronization from MySQL
13
13
14
14
import InsertPrivNote from '../_assets/commonMarkdown/insertPrivNote.mdx'
15
+
import FlinkStarRocksConnection from '../_assets/commonMarkdown/Edition_Specific_Flink_StarRocks_Connection.mdx'
15
16
16
17
StarRocks supports multiple methods to synchronize data from MySQL to StarRocks in real time, delivering low latency real-time analytics of massive data.
17
18
@@ -191,6 +192,12 @@ To synchronize data from MySQL in real time, the system needs to read data from
191
192
1 row inset (0.00 sec)
192
193
```
193
194
195
+
### Connect to StarRocks
196
+
197
+
The SMT configuration file sets these addresses in`flink.starrocks.jdbc-url` and `flink.starrocks.load-url`.
0 commit comments