Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-35747

customer ‘rest.bind-address' config overwrite by code

    XMLWordPrintableJSON

Details

    Description

      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

      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);
      
              `````
          }
      }
      

      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

       

      
      
      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);
              }
              `````
          }
      }
      
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dncba dncba
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: