Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

set up proxy for metron enrichment

Highlighted

set up proxy for metron enrichment

New Contributor

hey guys,

Very difficult to troubleshoot metron, very few doc on this topic.

I'm installing metron via ambari way.

But, I am behind a proxy and when metron want to download geolite archive, I get this error :

Execution of '/usr/hcp/1.1.0.0-71/metron/bin/geo_enrichment_load.sh                                 -g http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz                                 -r /apps/metron/geo/default/                                 -z sandbox.hortonworks.com:2181' returned 5. Retrieving GeoLite2 archive
Downloading http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz to /tmp/GeoLite2-City.mmdb.gz
Unable to copy remote GeoIP database to local file: java.net.UnknownHostException: geolite.maxmind.com
java.net.UnknownHostException: geolite.maxmind.com

I guess it's a proxy issue, but i don't know how to fix it.

I tried :

- set http_proxy ...

- set proxy for ambari

1 REPLY 1

Re: set up proxy for metron enrichment

New Contributor

When I read the code bellow, it shows that indeed, coders forgot to implement proxy option :( !!

protected File downloadGeoFile(String urlStr, String tmpDir) {
    File localFile = null;
    try {
      URL url = new URL(urlStr);
      localFile = new File(tmpDir + new File(url.getPath()).getName());

      System.out.println("Downloading " + url.toString() + " to " + localFile.getAbsolutePath());
      if (localFile.exists() && !localFile.delete()) {
        System.err.println("File already exists locally and can't be deleted.  Please delete before continuing");
        System.exit(3);
      }
      FileUtils.copyURLToFile(url, localFile, 5000, 10000);
    } catch (MalformedURLException e) {
      System.err.println("Malformed URL - aborting: " + e);
      e.printStackTrace();
      System.exit(4);
    } catch (IOException e) {
      System.err.println("Unable to copy remote GeoIP database to local file: " + e);
      e.printStackTrace();
      System.exit(5);
    }
    return localFile;
  }

Maybe i don't understand how to configure metron behind a proxy ??

Don't have an account?
Coming from Hortonworks? Activate your account here