Skip to content

Commit

Permalink
[FLINK-37150][doc] Update flink configuration file documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
JunRuiLee committed Feb 11, 2025
1 parent 15f54ba commit 88d32a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
8 changes: 1 addition & 7 deletions docs/content.zh/docs/deployment/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,12 @@ On session clusters, the provided configuration will only be used for configurin

# Flink 配置文件

自 Flink-1.19 版本起,Flink 正式引入了对标准 YAML 1.2 语法的完整支持。与之前版本中仅支持简单键值对的配置方式相比,这一更新为用户提供了更加灵活和强大的配置能力。为了利用这一新特性,用户需使用新引入的配置文件 `config.yaml`原有的 `flink-conf.yaml` 配置文件不再推荐使用,并在即将到来的 Flink-2.0 版本中不再支持。为了确保平滑迁移,建议用户尽早将现有作业配置迁移到新的配置方式
自 Flink-2.0 版本起,Flink 仅支持使用支持标准 YAML 1.2 语法的配置文件 `config.yaml`原有的 `flink-conf.yaml` 配置文件将不再支持。与之前版本中仅支持简单键值对的配置方式相比,这一更新为用户提供了更加灵活和强大的配置能力

本节将帮助用户理解如何通过 `config.yaml` 配置文件对 Flink 集群和作业进行配置,以及如何将老配置迁移至新的配置文件中。

### 用法

从 Flink-1.19 版本开始,默认的配置文件已更改为 `config.yaml`,并置于 `conf/` 目录下。用户在进行配置时应直接修改此文件。

如果用户希望继续使用 Flink-1.19 之前的配置文件 `flink-conf.yaml`,只需将该文件拷贝到 `conf/` 目录下。一旦检测到 `flink-conf.yaml` 文件,Flink 会优先使用其作为配置文件。

`config.yaml` 的配置方式如下:

#### Config Key
Expand Down Expand Up @@ -119,8 +115,6 @@ bin/migrate-config-file.sh
````
运行上述指令后,该迁移脚本会自动读取 `conf/` 目录下的旧配置文件 `flink-conf.yaml`,并将迁移后的结果输出到 `conf/` 目录下的新配置文件 `config.yaml` 中。需要注意的是,因为老配置项解析器的限制,`flink-conf.yaml` 中所有的 value 会被识别为 `String` 类型,所以生成的 `config.yaml` 文件中的 value 也都为 `String` 类型,即部分 value 会被引号引起来。不过 Flink 会在后续的配置解析时将其转换为使用 `ConfigOption` 定义的实际类型。

此外,用户需要在迁移完成后删除 `conf/` 目录下的 `flink-conf.yaml` 文件来使 `config.yaml` 文件生效。

# Basic Setup

The default configuration supports starting a single-node Flink session cluster without any changes.
Expand Down
8 changes: 1 addition & 7 deletions docs/content/docs/deployment/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,12 @@ On session clusters, the provided configuration will only be used for configurin

# Flink Configuration File

Starting with version 1.19, Flink has officially introduced full support for the standard YAML 1.2 syntax. Compared to the previous versions which only supported simple key-value pairs, this update provides users with more flexible and powerful configuration capabilities. To take advantage of this new feature, users need to use the newly introduced `config.yaml` configuration file. The existing `flink-conf.yaml` configuration file is deprecated and will no longer work in the upcoming version 2.0. To ensure a smooth transition, users are advised to migrate their existing Flink configuration to the new configuration file as soon as possible.
Starting with Flink version 2.0, Flink only supports the configuration file `config.yaml`, which adheres to the standard YAML 1.2 syntax. The previous `flink-conf.yaml` configuration file is no longer supported. Compared to the previous versions which only supported simple key-value pairs, this update provides users with more flexible and powerful configuration capabilities.

This section will help users understand how to configure the Flink cluster and jobs through the `config.yaml` configuration file, as well as how to migrate old configuration to the new configuration file.

### Usage

Starting from Flink-1.19, the default configuration file has been changed to `config.yaml` and placed in the `conf/` directory. Users should directly modify this file to configure Flink.

To continue using the legacy configuration file `flink-conf.yaml`, users just need to copy this file into the `conf/` directory. Once the legacy configuration file `flink-conf.yaml` is detected, Flink will prioritize using it as the configuration file.

The usage for `config.yaml` is as follows:

#### Config Key
Expand Down Expand Up @@ -119,8 +115,6 @@ bin/migrate-config-file.sh
````
After running the command above, the migration script will automatically read the old configuration file `flink-conf.yaml` from the `conf/` directory and output the migrated results to the new configuration file `config.yaml` in the `conf/` directory. Note that due to the limitation of the legacy configuration parser, all values in flink-conf.yaml will be recognized as String type, so the values in the generated config.yaml file will also be of String type, which means some values will be enclosed in quotes. However, Flink will convert them to the actual types defined using `ConfigOption` during subsequent configuration parsing.

Additionally, users need to delete the `flink-conf.yaml` file in the `conf/` directory after migration to make the `config.yaml` file take effect.

# Basic Setup

The default configuration supports starting a single-node Flink session cluster without any changes.
Expand Down

0 comments on commit 88d32a0

Please sign in to comment.