Support Questions
Find answers, ask questions, and share your expertise
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


set up proxy for metron enrichment

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/                                 -g                                 -r /apps/metron/geo/default/                                 -z' returned 5. Retrieving GeoLite2 archive
Downloading to /tmp/GeoLite2-City.mmdb.gz
Unable to copy remote GeoIP database to local file:

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


Re: set up proxy for metron enrichment

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");
      FileUtils.copyURLToFile(url, localFile, 5000, 10000);
    } catch (MalformedURLException e) {
      System.err.println("Malformed URL - aborting: " + e);
    } catch (IOException e) {
      System.err.println("Unable to copy remote GeoIP database to local file: " + e);
    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