[
https://issues.apache.org/jira/browse/FLINK-35747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17862700#comment-17862700
]
dncba commented on FLINK-35747:
-------------------------------
pr
> 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
> 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)