Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-25538

Property -Dhttp.proxyHost doesn't work when install HDP.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.7.5
    • None
    • ambari-sever
    • None

    Description

      There is Problem that the Proxy doesn't work in Ambari-server 2.7.5 even if pass system properties(-Dhttp.proxyHost and -Dhttp.proxyPort).

      I find the reason. During URLRedirectProvider.buildHttpClient() build httpClient, no code inherited java system properties relevant HTTP.

      The ambari 2.7.4 is fine. Since ambari 2.7.4 use HttpURLConnection to load VDF.XML, the proxy property (http.proxyHost, http.proxyPort) is passed for HTTP Request and It is fine.

      Here is sample code to be inherited system properties when build httpClient.

      public static String executeGet(String spec, boolean useSystemProperty) throws Exception {
         CloseableHttpClient httpClient = useSystemProperty ?
               builder.useSystemProperties().build() : HttpClientBuilder.create().build();
      
         HttpGet httpGet = new HttpGet(spec);
         CloseableHttpResponse response = httpClient.execute(httpGet);
      
         final InputStream is = response.getEntity().getContent();
         return IOUtils.toString(is, StandardCharsets.UTF_8);
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            myfriendprintf Junseok
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: