You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Ferenc Csaky (Jira)" <ji...@apache.org> on 2024/10/08 18:30:00 UTC
[jira] [Assigned] (FLINK-35747) customer ‘rest.bind-address' config overwrite by code
[ https://issues.apache.org/jira/browse/FLINK-35747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ferenc Csaky reassigned FLINK-35747:
------------------------------------
Assignee: dncba
> customer ‘rest.bind-address' config overwrite by code
> ------------------------------------------------------
>
> Key: FLINK-35747
> URL: https://issues.apache.org/jira/browse/FLINK-35747
> Project: Flink
> Issue Type: Bug
> Components: Deployment / YARN
> Affects Versions: 1.19.1
> Reporter: dncba
> Assignee: dncba
> Priority: Major
> Labels: pull-request-available
>
> When I want flink on Yarn webui bind on 0.0.0.0 to listen Ipv4 & Ipv6 double stack, I found the ‘rest.bind-address' config will auto overwrite by here
> {code:java}
> package org.apache.flink.yarn.entrypoint;
> ````
> public class YarnEntrypointUtils {
> ````
> public static Configuration loadConfiguration(
> final Configuration configuration =
> GlobalConfiguration.loadConfiguration(workingDirectory, dynamicParameters);
> final String hostname =env.get(ApplicationConstants.Environment.NM_HOST.key());
> configuration.set(JobManagerOptions.ADDRESS, hostname);
> configuration.set(RestOptions.ADDRESS, hostname);
>
> # overwrite hostname by code
> configuration.set(RestOptions.BIND_ADDRESS, hostname);
> `````
> }
> }
> {code}
> In most case the are right. when user want config the ‘rest.bind-address' by slef , the customer config will be auto overwirte.
>
> the best way is check the user config before the ovewrite. like this
>
> {code:java}
> public class YarnEntrypointUtils {
> ````
> public static Configuration loadConfiguration(
> final Configuration configuration =
> GlobalConfiguration.loadConfiguration(workingDirectory, dynamicParameters);
> final String hostname =env.get(ApplicationConstants.Environment.NM_HOST.key());
> configuration.set(JobManagerOptions.ADDRESS, hostname);
> configuration.set(RestOptions.ADDRESS, hostname);
>
> # check before the overwrite
> String bindAddress = configuration.getString(RestOptions.BIND_ADDRESS);
> if (StringUtils.isBlank(bindAddress)) {
> configuration.setString(RestOptions.BIND_ADDRESS, hostname);
> }
> `````
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)