Skip to content

Commit 443f90f

Browse files
committed
Merge main into sync PR 79503
Signed-off-by: luohaha <18810541851@163.com>
2 parents 4c29de5 + 70b29bd commit 443f90f

42 files changed

Lines changed: 2473 additions & 395 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

conf/be.conf

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@ starlet_port = 9070
5858
# eg:
5959
# JAVA_OPTS="-Djava.security.krb5.conf=/etc/krb5.conf"
6060
# used for query iceberg metadata and Java UDF for JDK17
61-
# -Djava.security.manager=allow is required on JDK 18-23 (JEP 411) for the UDF security
62-
# manager that UDFClassLoader installs when java.security.policy is set. It is a no-op on
63-
# JDK 17. Drop it before moving to JDK 24 or later: JEP 486 makes the JVM refuse to start
64-
# on any value other than 'disallow'. bin/start_backend.sh appends the flag automatically
65-
# on JDK 18-23 when it is unset.
66-
JAVA_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED -Djava.security.manager=allow"
61+
# bin/start_backend.sh appends -Djava.security.manager=allow on JDK 18-23 (JEP 411) for the
62+
# UDF security manager that UDFClassLoader installs when java.security.policy is set. Do not
63+
# put the flag here: a value set in JAVA_OPTS always wins over the script, and JDK 24+
64+
# (JEP 486) refuses to start on any value other than 'disallow'.
65+
JAVA_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED"

conf/cn.conf

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,8 @@ starlet_port = 9070
5757
# eg:
5858
# JAVA_OPTS="-Djava.security.krb5.conf=/etc/krb5.conf"
5959
# used for query iceberg metadata and Java UDF for JDK17
60-
# -Djava.security.manager=allow is required on JDK 18-23 (JEP 411) for the UDF security
61-
# manager that UDFClassLoader installs when java.security.policy is set. It is a no-op on
62-
# JDK 17. Drop it before moving to JDK 24 or later: JEP 486 makes the JVM refuse to start
63-
# on any value other than 'disallow'. bin/start_backend.sh appends the flag automatically
64-
# on JDK 18-23 when it is unset, so uncommenting this line is only needed to override it.
65-
# JAVA_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED -Djava.security.manager=allow"
60+
# bin/start_backend.sh appends -Djava.security.manager=allow on JDK 18-23 (JEP 411) for the
61+
# UDF security manager that UDFClassLoader installs when java.security.policy is set. Do not
62+
# put the flag here: a value set in JAVA_OPTS always wins over the script, and JDK 24+
63+
# (JEP 486) refuses to start on any value other than 'disallow'.
64+
# JAVA_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED"

conf/fe.conf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
LOG_DIR = ${STARROCKS_HOME}/log
2525

2626
DATE = "$(date +%Y%m%d-%H%M%S)"
27-
# -Djava.security.manager=allow is required on JDK 18-23 (JEP 411) to install the UDF
28-
# security manager while analyzing CREATE FUNCTION. It is a no-op on JDK 17. Drop it before
29-
# moving to JDK 24 or later: JEP 486 makes the JVM refuse to start on any value other than
30-
# 'disallow'. bin/start_fe.sh appends the flag automatically on JDK 18-23 when it is unset.
31-
JAVA_OPTS="-Dlog4j2.formatMsgNoLookups=true -Xmx8192m -XX:+UseG1GC -Xlog:gc*:${LOG_DIR}/fe.gc.log.$DATE:time -XX:ErrorFile=${LOG_DIR}/hs_err_pid%p.log -Djava.security.policy=${STARROCKS_HOME}/conf/udf_security.policy -Djava.security.manager=allow"
27+
# bin/start_fe.sh appends -Djava.security.manager=allow on JDK 18-23 (JEP 411), which the FE
28+
# needs to install the UDF security manager while analyzing CREATE FUNCTION. Do not put the
29+
# flag here: a value set in JAVA_OPTS always wins over the script, and JDK 24+ (JEP 486)
30+
# refuses to start on any value other than 'disallow'.
31+
JAVA_OPTS="-Dlog4j2.formatMsgNoLookups=true -Xmx8192m -XX:+UseG1GC -Xlog:gc*:${LOG_DIR}/fe.gc.log.$DATE:time -XX:ErrorFile=${LOG_DIR}/hs_err_pid%p.log -Djava.security.policy=${STARROCKS_HOME}/conf/udf_security.policy"
3232

3333
##
3434
## the lowercase properties are read by main program.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
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.

docs/en/integrations/loading_tools/SMT.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: "StarRocks Migration Tool (SMT) is a data migration tool provided b
66

77
# StarRocks Migration Tool (SMT)
88

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:
1010
- Generate statements to create tables in StarRocks based on information of the source database and the target StarRocks cluster.
1111
- 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:
1212

@@ -22,6 +22,22 @@ StarRocks Migration Tool (SMT) is a data migration tool provided by StarRocks to
2222

2323
Download link: https://cdn-thirdparty.starrocks.com/smt.tar.gz?r=2
2424

25+
## What SMT does and does not do
26+
27+
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+
2541
## Steps to use SMT
2642

2743
The generally involved steps are as follows:
@@ -225,6 +241,12 @@ As shown in the image, SMT can automatically generate CREATE TABLE statements of
225241

226242
## Synchronize PostgreSQL to StarRocks
227243

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+
228250
### Introduction
229251

230252
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
334356
- How to enable PostgreSQL WAL?
335357
336358
```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
340362
# Enable wal logical replication
341363
echo "wal_level = logical" >> postgresql.conf
342364
echo "max_wal_senders = 2" >> postgresql.conf

docs/en/loading/Flink-connector-starrocks.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ description: "How to use the StarRocks Flink connector to continuously load data
66

77
# Continuously load data from Apache Flink®
88

9+
import FlinkStarRocksConnection from '../_assets/commonMarkdown/Edition_Specific_Flink_StarRocks_Connection.mdx'
10+
911
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).
1012

1113
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
9092
>
9193
> The name of Flink connector which is not formally released contains the `SNAPSHOT` suffix.
9294

95+
## Connect to StarRocks
96+
97+
<FlinkStarRocksConnection />
98+
9399
## Options
94100

95101
### General Options

docs/en/loading/Flink_cdc_load.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ description: "How to use Flink CDC to capture MySQL change data in real time and
1212
# Realtime synchronization from MySQL
1313

1414
import InsertPrivNote from '../_assets/commonMarkdown/insertPrivNote.mdx'
15+
import FlinkStarRocksConnection from '../_assets/commonMarkdown/Edition_Specific_Flink_StarRocks_Connection.mdx'
1516

1617
StarRocks supports multiple methods to synchronize data from MySQL to StarRocks in real time, delivering low latency real-time analytics of massive data.
1718

@@ -191,6 +192,12 @@ To synchronize data from MySQL in real time, the system needs to read data from
191192
1 row in set (0.00 sec)
192193
```
193194

195+
### Connect to StarRocks
196+
197+
The SMT configuration file sets these addresses in `flink.starrocks.jdbc-url` and `flink.starrocks.load-url`.
198+
199+
<FlinkStarRocksConnection />
200+
194201
## Synchronize database & table schema
195202

196203
1. Edit the SMT configuration file.

0 commit comments

Comments
 (0)