Custom configuration file flink-conf.yaml

tashoyan

I need to specify different Flink settings for different applications. In other words, each application should run with its custom file flink-conf.yaml. What is the proper way to do it?

I found some old recommendations to declare FLINK_CONF_DIR pointing to a custom directory with Flink configuration files (for example: How could I override configuration value in Apache Flink?). However, the official Flink documentation does not mention the FLINK_CONF_DIR variable at all (as of Flink 1.13). Therefore I have doubts, that this way is officially recommended and supported by Flink developers.

UPDATE 1: Details on application running

I am running Flink on YARN in the Application mode. Here is how I launch the application:

"$flink_home/bin/flink" \
  run-application \
  --target yarn-application \
  --class com.example.App1

The out-of-the-box Flink configuration is located in the $flink_home/conf directory. As I have several applications App1, App2, ..., I want them to use their respective Flink configurations instead of the out-of-the-box configuration.

David Anderson

TL;DR: The paragraph about FLINK_CONF_DIR was accidentally removed when the Flink on YARN docs were rewritten for the Flink 1.12 release. It is still the intended and supported way to establish per-application settings in YARN clusters.


Other ways to override the configuration:

You can override the settings specified in the cluster's flink-conf.yaml file with settings you specify on the command line, as described in this answer.

You can also override specific settings from the global configuration in your code, e.g.:

Configuration conf = new Configuration();
conf.setString("state.backend", "filesystem");
env = StreamExecutionEnvironment.getExecutionEnvironment(conf);

You can also load all of the settings in a flink-conf.yaml file from your application code, via

FileSystem.initialize(GlobalConfiguration.loadConfiguration("/path/to/conf/directory"));

And with Kubernetes you can mount different ConfigMaps for different applications.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Where does the flink-conf.yaml go?

yaml file handlers configuration

Daemon OpenVPN configuration file with .conf?

Flink Kubernetes operator | how to pass s3 key/secrets to flink-conf.yaml

configuration: why not conf option = file name and conf value = file content

Docker pass configuration to yaml file

Read YAML configuration file in Python

Source other configuration file in gpg.conf

Setting a custom directory for Confuse YAML Configuration Files

Get the keyname from a YAML configuration file

Apply configuration yaml file via API or SDK

Yaml configuration list of objects to properties file

Executable access to yaml configuration file using setuptools

How to specify external YAML configuration file for springboot

the best way to parse and validate YAML configuration file

YAML Configuration File Parsing Error in CircleCI

ClassNotFoundException: org.apache.hadoop.conf.Configuration Starting Flink SQL Client

update custom configuration file in Docker

Custom Windows Configuration Batch File

kubernetes: validating a yaml file against a custom resource

Symfony 4 Custom config yaml file for Bundle

Command to open ejabberd default configuration (conf) file in Docker

How to override unit Environment configuration via .conf file in systemd?

Can Apache Configuration File (httpd.conf) Be Located Elsewhere?

Quasar CLI: Setting the configuration file quasar.conf.js

How can I change the configuration of /etc/updatedb.conf file?

Webdriver instances not created for custom protractor.conf file

How to specify custom conf file for Spark Standalone's master?

How to validate values in a YAML configuration file while loading it?