You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@metron.apache.org by le...@apache.org on 2017/01/26 16:21:54 UTC

[1/3] incubator-metron git commit: METRON-283 Migrate Geo Enrichment outside of MySQL (justinleet) closes apache/incubator-metron#421

Repository: incubator-metron
Updated Branches:
  refs/heads/master c74c7de27 -> fa6f3df51


http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/stellar/GeoEnrichmentFunctions.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/stellar/GeoEnrichmentFunctions.java b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/stellar/GeoEnrichmentFunctions.java
new file mode 100644
index 0000000..11e024e
--- /dev/null
+++ b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/stellar/GeoEnrichmentFunctions.java
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.metron.enrichment.stellar;
+
+import org.apache.log4j.Logger;
+import org.apache.metron.common.dsl.Context;
+import org.apache.metron.common.dsl.ParseException;
+import org.apache.metron.common.dsl.Stellar;
+import org.apache.metron.common.dsl.StellarFunction;
+import org.apache.metron.enrichment.adapters.geo.GeoLiteDatabase;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+public class GeoEnrichmentFunctions {
+  private static final Logger LOG = Logger.getLogger(GeoEnrichmentFunctions.class);
+
+  @Stellar(name="GET"
+          ,namespace="GEO"
+          ,description="Look up an IPV4 address and returns geographic information about it"
+          ,params = {
+                      "ip - The IPV4 address to lookup" +
+                      "fields - Optional list of GeoIP fields to grab. Options are locID, country, city, postalCode, dmaCode, latitude, longitude, location_point"
+                    }
+          ,returns = "If a Single field is requested a string of the field, If multiple fields a map of string of the fields, and null otherwise"
+  )
+  public static class GeoGet implements StellarFunction {
+    boolean initialized = false;
+
+    @Override
+    public Object apply(List<Object> args, Context context) throws ParseException {
+      if(!initialized) {
+        return null;
+      }
+      if(args.size() > 2) {
+        throw new IllegalArgumentException("GEO_GET received more arguments than expected: " + args.size());
+      }
+
+      if(args.size() == 1 && args.get(0) instanceof String) {
+        // If no fields are provided, return everything
+        String ip = (String) args.get(0);
+        if(ip == null || ip.trim().isEmpty()) {
+          return null;
+        }
+
+        Optional<HashMap<String, String>> result = GeoLiteDatabase.INSTANCE.get(ip);
+        if(result.isPresent()) {
+          return result.get();
+        }
+      } else if (args.size() == 2 && args.get(1) instanceof List) {
+        // If fields are provided, return just those fields.
+        String ip = (String) args.get(0);
+        @SuppressWarnings("unchecked")
+        List<String> fields = (List) args.get(1);
+        Optional<HashMap<String, String>> result = GeoLiteDatabase.INSTANCE.get(ip);
+
+        // If only one field is requested, just return it directly
+        if(fields.size() == 1 && result.isPresent()) {
+          return result.get().get(fields.get(0));
+        } else if (result.isPresent()) {
+          // If multiple fields are requested, return all of them
+          HashMap<String, String> filteredInfo = new HashMap<>();
+          for(String field : fields) {
+            HashMap<String, String> geoInfo = result.get();
+            filteredInfo.put(field, geoInfo.get(field));
+          }
+          return filteredInfo;
+        }
+      }
+
+      return null;
+    }
+
+    @Override
+    public void initialize(Context context) {
+        LOG.info("Initializing GeoEnrichmentFunctions");
+        Map<String, Object> config = getConfig(context);
+        String hdfsDir = (String) config.get(GeoLiteDatabase.GEO_HDFS_FILE);
+        GeoLiteDatabase.INSTANCE.update(hdfsDir);
+        initialized = true;
+    }
+
+    private static Map<String, Object> getConfig(Context context) {
+      return (Map<String, Object>) context.getCapability(Context.Capabilities.GLOBAL_CONFIG, false).orElse(new HashMap<>());
+    }
+
+    @Override
+    public boolean isInitialized() {
+      return initialized;
+    }
+
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/main/resources/ddl/geoip_ddl.sql
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/main/resources/ddl/geoip_ddl.sql b/metron-platform/metron-enrichment/src/main/resources/ddl/geoip_ddl.sql
deleted file mode 100644
index 02616c6..0000000
--- a/metron-platform/metron-enrichment/src/main/resources/ddl/geoip_ddl.sql
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- */
-CREATE DATABASE IF NOT EXISTS GEO;
-
-USE GEO;
-
-DROP TABLE IF EXISTS `blocks`;
-CREATE TABLE  `blocks` ( `startIPNum` int(10) unsigned NOT NULL,`endIPNum` int(10) unsigned NOT NULL,`locID`
-int(10) unsigned NOT NULL, PRIMARY KEY  (`startIPNum`,`endIPNum`) )
-ENGINE=MyISAM DEFAULT CHARSET=latin1 PACK_KEYS=1 DELAY_KEY_WRITE=1;
-
-DROP TABLE IF EXISTS `location`;
-CREATE TABLE  `location` (`locID` int(10) unsigned NOT NULL,`country` char(2) default NULL,`region` char(2)
- default NULL,`city` varchar(45) default NULL,`postalCode` char(7) default NULL,`latitude` double default
-NULL,`longitude` double default NULL,`dmaCode` char(3) default NULL,`areaCode` char(3) default NULL,PRIMARY KEY
-  (`locID`),KEY `Index_Country` (`country`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED;
-
-load data infile '/var/lib/mysql-files/GeoLiteCity-Blocks.csv'  into table `blocks`  fields terminated by ',' optionally enclosed by '"'  lines terminated by '\n' ignore 2 lines;
-load data infile '/var/lib/mysql-files/GeoLiteCity-Location.csv'  into table `location`  fields terminated by ',' optionally enclosed by '"'  lines terminated by '\n' ignore 2 lines;
-
-
-DELIMITER $$
-DROP FUNCTION IF EXISTS `IPTOLOCID` $$
-CREATE FUNCTION `IPTOLOCID`( ip VARCHAR(15)) RETURNS int(10) unsigned
-  BEGIN
-    DECLARE ipn INTEGER UNSIGNED;
-    DECLARE locID_var INTEGER;
-    IF ip LIKE '192.168.%' OR ip LIKE '10.%' THEN RETURN 0;
-    END IF;
-    SET ipn = INET_ATON(ip);
-    SELECT locID INTO locID_var FROM `blocks` INNER JOIN (SELECT MAX(startIPNum) AS start FROM `blocks` WHERE startIPNum <= ipn) AS s ON (startIPNum = s.start) WHERE endIPNum >= ipn;
-    RETURN locID_var;
-  END
-$$
-DELIMITER ;

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/geo/GeoAdapterTest.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/geo/GeoAdapterTest.java b/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/geo/GeoAdapterTest.java
index f899cf9..f91939d 100644
--- a/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/geo/GeoAdapterTest.java
+++ b/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/geo/GeoAdapterTest.java
@@ -17,100 +17,66 @@
  */
 package org.apache.metron.enrichment.adapters.geo;
 
+import com.google.common.collect.ImmutableMap;
 import org.adrianwalker.multilinestring.Multiline;
 import org.apache.metron.enrichment.bolt.CacheKey;
+import org.apache.metron.test.utils.UnitTestHelper;
 import org.json.simple.JSONObject;
 import org.json.simple.parser.JSONParser;
+import org.json.simple.parser.ParseException;
 import org.junit.Assert;
-import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
 
-import java.sql.ResultSet;
-import java.sql.Statement;
-
-import static org.mockito.Mockito.when;
+import java.io.File;
+import java.util.Map;
 
 public class GeoAdapterTest {
-
-
-  private String ip = "72.163.4.161";
-
+  private static final String IP = "216.160.83.56";
 
   /**
    * {
-   * "locID":"1",
-   * "country":"test country",
-   * "city":"test city",
-   * "postalCode":"test zip",
-   * "latitude":"test latitude",
-   * "longitude":"test longitude",
-   * "dmaCode":"test dma",
-   * "location_point":"test latitude,test longitude"
+   * "locID":"6252001",
+   * "country":"US",
+   * "city":"Milton",
+   * "postalCode":"98354",
+   * "latitude":"47.2513",
+   * "longitude":"-122.3149",
+   * "dmaCode":"819",
+   * "location_point":"47.2513,-122.3149"
    * }
    */
   @Multiline
-  private String expectedMessageString;
+  private static String expectedMessageString;
 
-  private JSONObject expectedMessage;
+  private static JSONObject expectedMessage;
 
-  @Mock
-  Statement statetment;
-  @Mock
-  ResultSet resultSet, resultSet1;
+  private static GeoAdapter geo;
+  private static File geoHdfsFile;
 
-
-  @Before
-  public void setup() throws Exception {
+  @BeforeClass
+  public static void setupOnce() throws ParseException {
     JSONParser jsonParser = new JSONParser();
     expectedMessage = (JSONObject) jsonParser.parse(expectedMessageString);
-    MockitoAnnotations.initMocks(this);
-    when(statetment.executeQuery("select IPTOLOCID(\"" + ip + "\") as ANS")).thenReturn(resultSet);
-    when(statetment.executeQuery("select * from location where locID = 1")).thenReturn(resultSet1);
-    when(resultSet.next()).thenReturn(Boolean.TRUE, Boolean.FALSE);
-    when(resultSet.getString("ANS")).thenReturn("1");
-    when(resultSet1.next()).thenReturn(Boolean.TRUE, Boolean.FALSE);
-    when(resultSet1.getString("locID")).thenReturn("1");
-    when(resultSet1.getString("country")).thenReturn("test country");
-    when(resultSet1.getString("city")).thenReturn("test city");
-    when(resultSet1.getString("postalCode")).thenReturn("test zip");
-    when(resultSet1.getString("latitude")).thenReturn("test latitude");
-    when(resultSet1.getString("longitude")).thenReturn("test longitude");
-    when(resultSet1.getString("dmaCode")).thenReturn("test dma");
-  }
 
+    String baseDir = UnitTestHelper.findDir("GeoLite");
+    geoHdfsFile = new File(new File(baseDir), "GeoIP2-City-Test.mmdb.gz");
+
+    geo = new GeoAdapter();
+    geo.initializeAdapter(ImmutableMap.of(GeoLiteDatabase.GEO_HDFS_FILE, geoHdfsFile.getAbsolutePath()));
+  }
 
   @Test
   public void testEnrich() throws Exception {
-    GeoAdapter geo = new GeoAdapter() {
-      @Override
-      public boolean initializeAdapter() {
-        return true;
-      }
-    };
-    geo.setStatement(statetment);
-    JSONObject actualMessage = geo.enrich(new CacheKey("dummy", ip, null));
+    JSONObject actualMessage = geo.enrich(new CacheKey("dummy", IP, null));
+
     Assert.assertNotNull(actualMessage.get("locID"));
     Assert.assertEquals(expectedMessage, actualMessage);
   }
 
   @Test
   public void testEnrichNonString() throws Exception {
-    GeoAdapter geo = new GeoAdapter() {
-      @Override
-      public boolean initializeAdapter() {
-        return true;
-      }
-    };
-    geo.setStatement(statetment);
-    JSONObject actualMessage = geo.enrich(new CacheKey("dummy", ip, null));
-    Assert.assertNotNull(actualMessage.get("locID"));
-    Assert.assertEquals(expectedMessage, actualMessage);
-
-    actualMessage = geo.enrich(new CacheKey("dummy", 10L, null));
-    Assert.assertEquals(actualMessage,new JSONObject());
+    JSONObject actualMessage = geo.enrich(new CacheKey("dummy", 10L, null));
+    Assert.assertEquals(new JSONObject(), actualMessage);
   }
-
 }
-

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/geo/GeoLiteDatabaseTest.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/geo/GeoLiteDatabaseTest.java b/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/geo/GeoLiteDatabaseTest.java
new file mode 100644
index 0000000..cc891c6
--- /dev/null
+++ b/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/geo/GeoLiteDatabaseTest.java
@@ -0,0 +1,181 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.metron.enrichment.adapters.geo;
+
+import com.google.common.collect.ImmutableMap;
+import org.adrianwalker.multilinestring.Multiline;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.metron.common.dsl.Context;
+import org.apache.metron.test.utils.UnitTestHelper;
+import org.json.simple.JSONObject;
+import org.json.simple.parser.JSONParser;
+import org.json.simple.parser.ParseException;
+import org.junit.*;
+import org.junit.rules.TemporaryFolder;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Optional;
+
+public class GeoLiteDatabaseTest {
+  private static Context context;
+  private static File geoHdfsFile;
+  private static File geoHdfsFile_update;
+  private static final String IP_WITH_DMA = "81.2.69.192";
+  private static final String IP_NO_DMA = "216.160.83.56";
+
+  /**
+   * {
+   * "locID":"6252001",
+   * "country":"US",
+   * "city":"Milton",
+   * "postalCode":"98354",
+   * "latitude":"47.2513",
+   * "longitude":"-122.3149",
+   * "dmaCode":"819",
+   * "location_point":"47.2513,-122.3149"
+   * }
+   */
+  @Multiline
+  private static String expectedNoDmaMessageString;
+
+  private static JSONObject expectedNoDmaMessage;
+
+  /**
+   * {
+   * "locID":"2635167",
+   * "country":"GB",
+   * "city":"London",
+   * "postalCode":"",
+   * "latitude":"51.5142",
+   * "longitude":"-0.0931",
+   * "dmaCode":"",
+   * "location_point":"51.5142,-0.0931"
+   * }
+   */
+  @Multiline
+  private static String expectedDmaMessageString;
+
+  private static JSONObject expectedDmaMessage;
+
+  private static FileSystem fs;
+
+  @Rule
+  public TemporaryFolder testFolder = new TemporaryFolder();
+
+  @BeforeClass
+  public static void setupOnce() throws ParseException, IOException {
+    JSONParser jsonParser = new JSONParser();
+    expectedNoDmaMessage = (JSONObject) jsonParser.parse(expectedNoDmaMessageString);
+    expectedDmaMessage = (JSONObject) jsonParser.parse(expectedDmaMessageString);
+
+    String baseDir = UnitTestHelper.findDir("GeoLite");
+    geoHdfsFile = new File(new File(baseDir), "GeoIP2-City-Test.mmdb.gz");
+    geoHdfsFile_update = new File(new File(baseDir), "GeoIP2-City-Test-2.mmdb.gz");
+
+    Configuration config = new Configuration();
+    fs = FileSystem.get(config);
+  }
+
+  @Before
+  public void setup() throws Exception {
+    testFolder.create();
+    context = new Context.Builder().with(Context.Capabilities.GLOBAL_CONFIG
+            , () -> ImmutableMap.of(GeoLiteDatabase.GEO_HDFS_FILE, geoHdfsFile.getAbsolutePath())
+    )
+            .build();
+  }
+
+  @Test
+  public void testGetLocal() throws Exception {
+    GeoLiteDatabase.INSTANCE.update(geoHdfsFile.getAbsolutePath());
+
+    Optional<HashMap<String, String>> result = GeoLiteDatabase.INSTANCE.get("192.168.0.1");
+    Assert.assertEquals("Local IP should return empty map", new HashMap<String, String>(), result.get());
+  }
+
+  @Test
+  @SuppressWarnings("unchecked")
+  public void testGetRemoteWithDma() throws Exception {
+    GeoLiteDatabase.INSTANCE.update(geoHdfsFile.getAbsolutePath());
+
+    Optional<HashMap<String, String>> result = GeoLiteDatabase.INSTANCE.get(IP_WITH_DMA);
+    Assert.assertEquals("Remote Local IP should return result based on DB", expectedDmaMessage, result.get());
+  }
+
+  @Test
+  @SuppressWarnings("unchecked")
+  public void testGetRemoteNoDma() throws Exception {
+    GeoLiteDatabase.INSTANCE.update(geoHdfsFile.getAbsolutePath());
+
+    Optional<HashMap<String, String>> result = GeoLiteDatabase.INSTANCE.get(IP_NO_DMA);
+    Assert.assertEquals("Remote Local IP should return result based on DB", expectedNoDmaMessage, result.get());
+  }
+
+  @Test
+  @SuppressWarnings("unchecked")
+  public void testMultipleUpdates() throws Exception {
+    GeoLiteDatabase.INSTANCE.update(geoHdfsFile.getAbsolutePath());
+    GeoLiteDatabase.INSTANCE.update(geoHdfsFile.getAbsolutePath());
+
+    Optional<HashMap<String, String>> result = GeoLiteDatabase.INSTANCE.get(IP_NO_DMA);
+    Assert.assertEquals("Remote Local IP should return result based on DB", expectedNoDmaMessage, result.get());
+  }
+
+  @Test
+  @SuppressWarnings("unchecked")
+  public void testUpdateIfNecessary() throws Exception {
+    HashMap<String, Object> globalConfig = new HashMap<>();
+    globalConfig.put(GeoLiteDatabase.GEO_HDFS_FILE, geoHdfsFile.getAbsolutePath());
+    GeoLiteDatabase.INSTANCE.updateIfNecessary(globalConfig);
+
+    Optional<HashMap<String, String>> result = GeoLiteDatabase.INSTANCE.get(IP_NO_DMA);
+    Assert.assertEquals("Remote Local IP should return result based on DB", expectedNoDmaMessage, result.get());
+  }
+
+
+  @Test
+  @SuppressWarnings("unchecked")
+  public void testMultipleUpdateIfNecessary() throws Exception {
+    HashMap<String, Object> globalConfig = new HashMap<>();
+    globalConfig.put(GeoLiteDatabase.GEO_HDFS_FILE, geoHdfsFile.getAbsolutePath());
+    GeoLiteDatabase.INSTANCE.updateIfNecessary(globalConfig);
+    GeoLiteDatabase.INSTANCE.updateIfNecessary(globalConfig);
+
+    Optional<HashMap<String, String>> result = GeoLiteDatabase.INSTANCE.get(IP_NO_DMA);
+    Assert.assertEquals("Remote Local IP should return result based on DB", expectedNoDmaMessage, result.get());
+  }
+
+  @Test
+  @SuppressWarnings("unchecked")
+  public void testDifferingUpdateIfNecessary() throws Exception {
+    HashMap<String, Object> globalConfig = new HashMap<>();
+    globalConfig.put(GeoLiteDatabase.GEO_HDFS_FILE, geoHdfsFile.getAbsolutePath());
+    GeoLiteDatabase.INSTANCE.updateIfNecessary(globalConfig);
+    Optional<HashMap<String, String>> result = GeoLiteDatabase.INSTANCE.get(IP_NO_DMA);
+    Assert.assertEquals("Remote Local IP should return result based on DB", expectedNoDmaMessage, result.get());
+
+    globalConfig.put(GeoLiteDatabase.GEO_HDFS_FILE, geoHdfsFile_update.getAbsolutePath());
+    GeoLiteDatabase.INSTANCE.updateIfNecessary(globalConfig);
+    result = GeoLiteDatabase.INSTANCE.get(IP_NO_DMA);
+
+    Assert.assertEquals("Remote Local IP should return result based on DB", expectedNoDmaMessage, result.get());
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/host/HostFromJSONListAdapterTest.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/host/HostFromJSONListAdapterTest.java b/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/host/HostFromJSONListAdapterTest.java
index cd2ba17..767b17d 100644
--- a/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/host/HostFromJSONListAdapterTest.java
+++ b/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/host/HostFromJSONListAdapterTest.java
@@ -85,7 +85,7 @@ public class HostFromJSONListAdapterTest {
   @Test
   public void testInitializeAdapter() throws Exception {
     HostFromJSONListAdapter hja = new HostFromJSONListAdapter(expectedKnownHostsString);
-    Assert.assertTrue(hja.initializeAdapter());
+    Assert.assertTrue(hja.initializeAdapter(null));
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/host/HostFromPropertiesFileAdapterTest.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/host/HostFromPropertiesFileAdapterTest.java b/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/host/HostFromPropertiesFileAdapterTest.java
index ea5cabe..8ce93c1 100644
--- a/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/host/HostFromPropertiesFileAdapterTest.java
+++ b/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/host/HostFromPropertiesFileAdapterTest.java
@@ -90,7 +90,7 @@ public class HostFromPropertiesFileAdapterTest {
     public void testInitializeAdapter() throws Exception {
         Map<String, JSONObject> mapKnownHosts = new HashMap<>();
         HostFromPropertiesFileAdapter hfa = new HostFromPropertiesFileAdapter(mapKnownHosts);
-        Assert.assertFalse(hfa.initializeAdapter());
+        Assert.assertFalse(hfa.initializeAdapter(null));
         JSONArray jsonArray = (JSONArray) JSONValue.parse(expectedKnownHostsString);
         Iterator jsonArrayIterator = jsonArray.iterator();
         while(jsonArrayIterator.hasNext()) {
@@ -99,7 +99,7 @@ public class HostFromPropertiesFileAdapterTest {
             mapKnownHosts.put(host, jsonObject);
         }
         hfa = new HostFromPropertiesFileAdapter(mapKnownHosts);
-        Assert.assertTrue(hfa.initializeAdapter());
+        Assert.assertTrue(hfa.initializeAdapter(null));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/simplehbase/SimpleHBaseAdapterTest.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/simplehbase/SimpleHBaseAdapterTest.java b/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/simplehbase/SimpleHBaseAdapterTest.java
index 7999a4c..35a90b7 100644
--- a/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/simplehbase/SimpleHBaseAdapterTest.java
+++ b/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/simplehbase/SimpleHBaseAdapterTest.java
@@ -173,7 +173,7 @@ public class SimpleHBaseAdapterTest {
   public void testInitializeAdapter() {
     SimpleHBaseConfig config = new SimpleHBaseConfig();
     SimpleHBaseAdapter sha = new SimpleHBaseAdapter(config);
-    sha.initializeAdapter();
+    sha.initializeAdapter(null);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/threatintel/ThreatIntelAdapterTest.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/threatintel/ThreatIntelAdapterTest.java b/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/threatintel/ThreatIntelAdapterTest.java
index 966538f..e96c7a7 100644
--- a/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/threatintel/ThreatIntelAdapterTest.java
+++ b/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/adapters/threatintel/ThreatIntelAdapterTest.java
@@ -157,7 +157,7 @@ public class ThreatIntelAdapterTest {
     config.withProviderImpl(ExceptionProvider.class.getName());
     ThreatIntelAdapter tia = new ThreatIntelAdapter(config);
     UnitTestHelper.setLog4jLevel(ThreatIntelAdapter.class, Level.FATAL);
-    tia.initializeAdapter();
+    tia.initializeAdapter(null);
     UnitTestHelper.setLog4jLevel(ThreatIntelAdapter.class, Level.ERROR);
     Assert.assertFalse(tia.isInitialized());
   }

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/bolt/GenericEnrichmentBoltTest.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/bolt/GenericEnrichmentBoltTest.java b/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/bolt/GenericEnrichmentBoltTest.java
index 27acda3..b0076a4 100644
--- a/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/bolt/GenericEnrichmentBoltTest.java
+++ b/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/bolt/GenericEnrichmentBoltTest.java
@@ -18,6 +18,7 @@
 package org.apache.metron.enrichment.bolt;
 
 import org.apache.log4j.Level;
+import org.apache.metron.enrichment.adapters.geo.GeoLiteDatabase;
 import org.apache.metron.test.utils.UnitTestHelper;
 import org.apache.storm.tuple.Values;
 import com.google.common.collect.ImmutableMap;
@@ -38,6 +39,7 @@ import org.mockito.ArgumentMatcher;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 
+import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.util.HashMap;
@@ -137,6 +139,8 @@ public class GenericEnrichmentBoltTest extends BaseEnrichmentBoltTest {
 
   @Test
   public void test() throws IOException {
+    when(tuple.getSourceComponent()).thenReturn("unit test component");
+    when(tuple.getSourceStreamId()).thenReturn("unit test stream");
     String key = "someKey";
     String enrichmentType = "enrichmentType";
     Enrichment<EnrichmentAdapter<CacheKey>> testEnrichment = new Enrichment<>();
@@ -151,6 +155,13 @@ public class GenericEnrichmentBoltTest extends BaseEnrichmentBoltTest {
     genericEnrichmentBolt.setCuratorFramework(client);
     genericEnrichmentBolt.setTreeCache(cache);
     genericEnrichmentBolt.getConfigurations().updateSensorEnrichmentConfig(sensorType, new FileInputStream(sampleSensorEnrichmentConfigPath));
+
+    HashMap<String, Object> globalConfig = new HashMap<>();
+    String baseDir = UnitTestHelper.findDir("GeoLite");
+    File geoHdfsFile = new File(new File(baseDir), "GeoIP2-City-Test.mmdb.gz");
+    globalConfig.put(GeoLiteDatabase.GEO_HDFS_FILE, geoHdfsFile.getAbsolutePath());
+    genericEnrichmentBolt.getConfigurations().updateGlobalConfig(globalConfig);
+
     try {
       genericEnrichmentBolt.prepare(new HashMap(), topologyContext, outputCollector);
       fail("Should fail if a maxCacheSize property is not set");
@@ -166,10 +177,10 @@ public class GenericEnrichmentBoltTest extends BaseEnrichmentBoltTest {
       fail("Should fail if an adapter is not set");
     } catch(IllegalStateException e) {}
     genericEnrichmentBolt.withEnrichment(testEnrichment);
-    when(enrichmentAdapter.initializeAdapter()).thenReturn(true);
+    when(enrichmentAdapter.initializeAdapter(globalConfig)).thenReturn(true);
     genericEnrichmentBolt.prepare(new HashMap(), topologyContext, outputCollector);
-    verify(enrichmentAdapter, times(1)).initializeAdapter();
-    when(enrichmentAdapter.initializeAdapter()).thenReturn(false);
+    verify(enrichmentAdapter, times(1)).initializeAdapter(globalConfig);
+    when(enrichmentAdapter.initializeAdapter(globalConfig)).thenReturn(false);
     UnitTestHelper.setLog4jLevel(GenericEnrichmentBolt.class, Level.FATAL);
     try {
       genericEnrichmentBolt.prepare(new HashMap(), topologyContext, outputCollector);

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/bolt/ThreatIntelJoinBoltTest.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/bolt/ThreatIntelJoinBoltTest.java b/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/bolt/ThreatIntelJoinBoltTest.java
index bb539f3..d942d9b 100644
--- a/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/bolt/ThreatIntelJoinBoltTest.java
+++ b/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/bolt/ThreatIntelJoinBoltTest.java
@@ -21,16 +21,20 @@ import com.fasterxml.jackson.databind.JsonMappingException;
 import junit.framework.Assert;
 import junit.framework.TestCase;
 import org.adrianwalker.multilinestring.Multiline;
+import org.apache.hadoop.fs.Path;
 import org.apache.metron.common.configuration.enrichment.SensorEnrichmentConfig;
 import org.apache.metron.common.configuration.enrichment.threatintel.ThreatTriageConfig;
 import org.apache.metron.common.utils.JSONUtils;
+import org.apache.metron.enrichment.adapters.geo.GeoLiteDatabase;
 import org.apache.metron.test.bolt.BaseEnrichmentBoltTest;
+import org.apache.metron.test.utils.UnitTestHelper;
 import org.json.simple.JSONObject;
 import org.json.simple.parser.JSONParser;
 import org.json.simple.parser.ParseException;
 import org.junit.Before;
 import org.junit.Test;
 
+import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.util.HashMap;
@@ -158,6 +162,11 @@ public class ThreatIntelJoinBoltTest extends BaseEnrichmentBoltTest {
       }
     }
     threatIntelJoinBolt.getConfigurations().updateSensorEnrichmentConfig(sensorType, enrichmentConfig);
+    HashMap<String, Object> globalConfig = new HashMap<>();
+    String baseDir = UnitTestHelper.findDir("GeoLite");
+    File geoHdfsFile = new File(new File(baseDir), "GeoIP2-City-Test.mmdb.gz");
+    globalConfig.put(GeoLiteDatabase.GEO_HDFS_FILE, geoHdfsFile.getAbsolutePath());
+    threatIntelJoinBolt.getConfigurations().updateGlobalConfig(globalConfig);
     threatIntelJoinBolt.withMaxCacheSize(100);
     threatIntelJoinBolt.withMaxTimeRetain(10000);
     threatIntelJoinBolt.prepare(new HashMap<>(), topologyContext, outputCollector);

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/integration/EnrichmentIntegrationTest.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/integration/EnrichmentIntegrationTest.java b/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/integration/EnrichmentIntegrationTest.java
index f399c81..27c1d11 100644
--- a/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/integration/EnrichmentIntegrationTest.java
+++ b/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/integration/EnrichmentIntegrationTest.java
@@ -25,19 +25,16 @@ import org.apache.hadoop.hbase.client.HTableInterface;
 import org.apache.metron.TestConstants;
 import org.apache.metron.common.Constants;
 import org.apache.metron.common.utils.JSONUtils;
+import org.apache.metron.enrichment.adapters.geo.GeoLiteDatabase;
 import org.apache.metron.enrichment.bolt.ErrorEnrichmentBolt;
 import org.apache.metron.enrichment.converter.EnrichmentHelper;
 import org.apache.metron.enrichment.converter.EnrichmentKey;
 import org.apache.metron.enrichment.converter.EnrichmentValue;
 import org.apache.metron.enrichment.integration.components.ConfigUploadComponent;
-import org.apache.metron.enrichment.integration.mock.MockGeoAdapter;
 import org.apache.metron.enrichment.lookup.LookupKV;
 import org.apache.metron.enrichment.lookup.accesstracker.PersistentBloomTrackerCreator;
 import org.apache.metron.enrichment.stellar.SimpleHBaseEnrichmentFunctions;
 import org.apache.metron.hbase.TableProvider;
-import org.apache.metron.enrichment.converter.EnrichmentKey;
-import org.apache.metron.enrichment.converter.EnrichmentValue;
-import org.apache.metron.enrichment.converter.EnrichmentHelper;
 import org.apache.metron.integration.*;
 import org.apache.metron.integration.components.FluxTopologyComponent;
 import org.apache.metron.integration.components.KafkaComponent;
@@ -46,20 +43,17 @@ import org.apache.metron.integration.components.ZKServerComponent;
 import org.apache.metron.integration.processors.KafkaProcessor;
 import org.apache.metron.integration.utils.TestUtils;
 import org.apache.metron.test.mock.MockHTable;
+import org.apache.metron.test.utils.UnitTestHelper;
+import org.json.simple.parser.ParseException;
 import org.junit.Assert;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 import javax.annotation.Nullable;
 import java.io.File;
 import java.io.IOException;
 import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
+import java.util.*;
 
 public class EnrichmentIntegrationTest extends BaseIntegrationTest {
   private static final String SRC_IP = "ip_src_addr";
@@ -69,10 +63,21 @@ public class EnrichmentIntegrationTest extends BaseIntegrationTest {
   private static final Map<String, Object> PLAYFUL_ENRICHMENT = new HashMap<String, Object>() {{
     put("orientation", "north");
   }};
+
+  public static final String DEFAULT_COUNTRY = "test country";
+  public static final String DEFAULT_CITY = "test city";
+  public static final String DEFAULT_POSTAL_CODE = "test postalCode";
+  public static final String DEFAULT_LATITUDE = "test latitude";
+  public static final String DEFAULT_LONGITUDE = "test longitude";
+  public static final String DEFAULT_DMACODE= "test dmaCode";
+  public static final String DEFAULT_LOCATION_POINT= Joiner.on(',').join(DEFAULT_LATITUDE,DEFAULT_LONGITUDE);
+
   protected String fluxPath = "../metron-enrichment/src/main/flux/enrichment/test.yaml";
   protected String sampleParsedPath = TestConstants.SAMPLE_DATA_PARSED_PATH + "TestExampleParsed";
-  private String sampleIndexedPath = TestConstants.SAMPLE_DATA_INDEXED_PATH + "TestIndexed";
   private final List<byte[]> inputMessages = getInputMessages(sampleParsedPath);
+
+  private static File geoHdfsFile;
+
   public static class Provider implements TableProvider, Serializable {
     MockHTable.Provider  provider = new MockHTable.Provider();
     @Override
@@ -88,6 +93,13 @@ public class EnrichmentIntegrationTest extends BaseIntegrationTest {
       return null;
     }
   }
+
+  @BeforeClass
+  public static void setupOnce() throws ParseException {
+    String baseDir = UnitTestHelper.findDir("GeoLite");
+    geoHdfsFile = new File(new File(baseDir), "GeoIP2-City-Test.mmdb.gz");
+  }
+
   @Test
   public void test() throws Exception {
     final String cf = "cf";
@@ -124,6 +136,7 @@ public class EnrichmentIntegrationTest extends BaseIntegrationTest {
       config.put(SimpleHBaseEnrichmentFunctions.ACCESS_TRACKER_TYPE_CONF, "PERSISTENT_BLOOM");
       config.put(PersistentBloomTrackerCreator.Config.PERSISTENT_BLOOM_TABLE, trackerHBaseTableName);
       config.put(PersistentBloomTrackerCreator.Config.PERSISTENT_BLOOM_CF, cf);
+      config.put(GeoLiteDatabase.GEO_HDFS_FILE, geoHdfsFile.getAbsolutePath());
       globalConfigStr = JSONUtils.INSTANCE.toJSON(config, true);
     }
     ConfigUploadComponent configUploadComponent = new ConfigUploadComponent()
@@ -366,21 +379,25 @@ public class EnrichmentIntegrationTest extends BaseIntegrationTest {
   }
 
   private static void geoEnrichmentValidation(Map<String, Object> indexedDoc) {
-    //should have geo enrichment on every message due to mock geo adapter
-    Assert.assertEquals(indexedDoc.get("enrichments.geo." + DST_IP + ".location_point"), MockGeoAdapter.DEFAULT_LOCATION_POINT);
-    Assert.assertEquals(indexedDoc.get("enrichments.geo." + SRC_IP +".location_point"), MockGeoAdapter.DEFAULT_LOCATION_POINT);
-    Assert.assertEquals(indexedDoc.get("enrichments.geo." + DST_IP + ".longitude"), MockGeoAdapter.DEFAULT_LONGITUDE);
-    Assert.assertEquals(indexedDoc.get("enrichments.geo." + SRC_IP + ".longitude"), MockGeoAdapter.DEFAULT_LONGITUDE);
-    Assert.assertEquals(indexedDoc.get("enrichments.geo." + DST_IP + ".city"), MockGeoAdapter.DEFAULT_CITY);
-    Assert.assertEquals(indexedDoc.get("enrichments.geo." + SRC_IP + ".city"), MockGeoAdapter.DEFAULT_CITY);
-    Assert.assertEquals(indexedDoc.get("enrichments.geo." + DST_IP + ".latitude"), MockGeoAdapter.DEFAULT_LATITUDE);
-    Assert.assertEquals(indexedDoc.get("enrichments.geo." + SRC_IP + ".latitude"), MockGeoAdapter.DEFAULT_LATITUDE);
-    Assert.assertEquals(indexedDoc.get("enrichments.geo." + DST_IP + ".country"), MockGeoAdapter.DEFAULT_COUNTRY);
-    Assert.assertEquals(indexedDoc.get("enrichments.geo." + SRC_IP + ".country"), MockGeoAdapter.DEFAULT_COUNTRY);
-    Assert.assertEquals(indexedDoc.get("enrichments.geo." + DST_IP + ".dmaCode"), MockGeoAdapter.DEFAULT_DMACODE);
-    Assert.assertEquals(indexedDoc.get("enrichments.geo." + SRC_IP + ".dmaCode"), MockGeoAdapter.DEFAULT_DMACODE);
-    Assert.assertEquals(indexedDoc.get("enrichments.geo." + DST_IP + ".postalCode"), MockGeoAdapter.DEFAULT_POSTAL_CODE);
-    Assert.assertEquals(indexedDoc.get("enrichments.geo." + SRC_IP + ".postalCode"), MockGeoAdapter.DEFAULT_POSTAL_CODE);
+    // Need to check both separately. Local IPs will have no Geo entries
+    if(indexedDoc.containsKey("enrichments.geo." + DST_IP + ".location_point")) {
+      Assert.assertEquals(DEFAULT_LOCATION_POINT, indexedDoc.get("enrichments.geo." + DST_IP + ".location_point"));
+      Assert.assertEquals(DEFAULT_LONGITUDE, indexedDoc.get("enrichments.geo." + DST_IP + ".longitude"));
+      Assert.assertEquals(DEFAULT_CITY, indexedDoc.get("enrichments.geo." + DST_IP + ".city"));
+      Assert.assertEquals(DEFAULT_LATITUDE, indexedDoc.get("enrichments.geo." + DST_IP + ".latitude"));
+      Assert.assertEquals(DEFAULT_COUNTRY, indexedDoc.get("enrichments.geo." + DST_IP + ".country"));
+      Assert.assertEquals(DEFAULT_DMACODE, indexedDoc.get("enrichments.geo." + DST_IP + ".dmaCode"));
+      Assert.assertEquals(DEFAULT_POSTAL_CODE, indexedDoc.get("enrichments.geo." + DST_IP + ".postalCode"));
+    }
+    if(indexedDoc.containsKey("enrichments.geo." + SRC_IP + ".location_point")) {
+      Assert.assertEquals(DEFAULT_LOCATION_POINT, indexedDoc.get("enrichments.geo." + SRC_IP + ".location_point"));
+      Assert.assertEquals(DEFAULT_LONGITUDE, indexedDoc.get("enrichments.geo." + SRC_IP + ".longitude"));
+      Assert.assertEquals(DEFAULT_CITY, indexedDoc.get("enrichments.geo." + SRC_IP + ".city"));
+      Assert.assertEquals(DEFAULT_LATITUDE, indexedDoc.get("enrichments.geo." + SRC_IP + ".latitude"));
+      Assert.assertEquals(DEFAULT_COUNTRY, indexedDoc.get("enrichments.geo." + SRC_IP + ".country"));
+      Assert.assertEquals(DEFAULT_DMACODE, indexedDoc.get("enrichments.geo." + SRC_IP + ".dmaCode"));
+      Assert.assertEquals(DEFAULT_POSTAL_CODE, indexedDoc.get("enrichments.geo." + SRC_IP + ".postalCode"));
+    }
   }
 
   private static void hostEnrichmentValidation(Map<String, Object> indexedDoc) {

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/integration/mock/MockGeoAdapter.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/integration/mock/MockGeoAdapter.java b/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/integration/mock/MockGeoAdapter.java
deleted file mode 100644
index b0491b8..0000000
--- a/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/integration/mock/MockGeoAdapter.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.metron.enrichment.integration.mock;
-
-import com.google.common.base.Joiner;
-import org.apache.metron.enrichment.bolt.CacheKey;
-import org.apache.metron.enrichment.interfaces.EnrichmentAdapter;
-import org.json.simple.JSONObject;
-
-import java.io.Serializable;
-
-public class MockGeoAdapter implements EnrichmentAdapter<CacheKey>,
-        Serializable {
-
-  public static final String DEFAULT_LOC_ID = "1";
-  public static final String DEFAULT_COUNTRY = "test country";
-  public static final String DEFAULT_CITY = "test city";
-  public static final String DEFAULT_POSTAL_CODE = "test postalCode";
-  public static final String DEFAULT_LATITUDE = "test latitude";
-  public static final String DEFAULT_LONGITUDE = "test longitude";
-  public static final String DEFAULT_DMACODE= "test dmaCode";
-  public static final String DEFAULT_LOCATION_POINT= Joiner.on(',').join(DEFAULT_LATITUDE,DEFAULT_LONGITUDE);
-
-  @Override
-  public void logAccess(CacheKey value) {
-
-  }
-
-  @Override
-  public JSONObject enrich(CacheKey cache ) {
-    JSONObject enriched = new JSONObject();
-    enriched.put("locID", DEFAULT_LOC_ID);
-    enriched.put("country", DEFAULT_COUNTRY);
-    enriched.put("city", DEFAULT_CITY);
-    enriched.put("postalCode", DEFAULT_POSTAL_CODE);
-    enriched.put("latitude", DEFAULT_LATITUDE);
-    enriched.put("longitude", DEFAULT_LONGITUDE);
-    enriched.put("dmaCode", DEFAULT_DMACODE);
-    enriched.put("location_point", DEFAULT_LOCATION_POINT);
-    return enriched;
-  }
-
-  @Override
-  public boolean initializeAdapter() {
-    return true;
-  }
-
-  @Override
-  public void cleanup() {
-
-  }
-
-  @Override
-  public String getOutputPrefix(CacheKey value) {
-    return value.getField();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/stellar/GeoEnrichmentFunctionsTest.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/stellar/GeoEnrichmentFunctionsTest.java b/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/stellar/GeoEnrichmentFunctionsTest.java
new file mode 100644
index 0000000..c87449d
--- /dev/null
+++ b/metron-platform/metron-enrichment/src/test/java/org/apache/metron/enrichment/stellar/GeoEnrichmentFunctionsTest.java
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.metron.enrichment.stellar;
+
+import com.google.common.collect.ImmutableMap;
+import org.adrianwalker.multilinestring.Multiline;
+import org.apache.metron.common.dsl.Context;
+import org.apache.metron.common.dsl.StellarFunctions;
+import org.apache.metron.common.stellar.StellarProcessor;
+import org.apache.metron.enrichment.adapters.geo.GeoLiteDatabase;
+import org.apache.metron.test.utils.UnitTestHelper;
+import org.json.simple.JSONObject;
+import org.json.simple.parser.JSONParser;
+import org.json.simple.parser.ParseException;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+
+public class GeoEnrichmentFunctionsTest {
+  private static Context context;
+  private static File geoHdfsFile;
+
+  /**
+   * {
+   * "locID":"6252001",
+   * "country":"US",
+   * "city":"Milton",
+   * "postalCode":"98354",
+   * "latitude":"47.2513",
+   * "longitude":"-122.3149",
+   * "dmaCode":"819",
+   * "location_point":"47.2513,-122.3149"
+   * }
+   */
+  @Multiline
+  private static String expectedMessageString;
+
+  private static JSONObject expectedMessage;
+
+  /**
+   * {
+   * "country":"US",
+   * "city":"Milton",
+   * "dmaCode":"819",
+   * "location_point":"47.2513,-122.3149"
+   * }
+   */
+  @Multiline
+  private static String expectedSubsetString;
+
+  private static JSONObject expectedSubsetMessage;
+
+  @BeforeClass
+  public static void setupOnce() throws ParseException {
+    JSONParser jsonParser = new JSONParser();
+    expectedMessage = (JSONObject) jsonParser.parse(expectedMessageString);
+
+    expectedSubsetMessage = (JSONObject) jsonParser.parse(expectedSubsetString);
+
+    String baseDir = UnitTestHelper.findDir("GeoLite");
+    geoHdfsFile = new File(new File(baseDir), "GeoIP2-City-Test.mmdb.gz");
+  }
+
+  @Before
+  public void setup() throws Exception {
+    context = new Context.Builder().with(Context.Capabilities.GLOBAL_CONFIG
+            , () -> ImmutableMap.of(GeoLiteDatabase.GEO_HDFS_FILE, geoHdfsFile.getAbsolutePath())
+    )
+            .build();
+  }
+
+  public Object run(String rule, Map<String, Object> variables) throws Exception {
+    StellarProcessor processor = new StellarProcessor();
+    Assert.assertTrue(rule + " not valid.", processor.validate(rule, context));
+    return processor.parse(rule, x -> variables.get(x), StellarFunctions.FUNCTION_RESOLVER(), context);
+  }
+
+  @Test
+  public void testGetNull() throws Exception {
+    String stellar = "GEO_GET()";
+    Object result = run(stellar, ImmutableMap.of());
+    Assert.assertEquals("Null IP should return null", null, result);
+  }
+
+  @Test
+  public void testGetEmptyString() throws Exception {
+    String stellar = "GEO_GET('  ')";
+    Object result = run(stellar, ImmutableMap.of());
+    Assert.assertEquals("Empty IP should return null", null, result);
+  }
+
+  @Test
+  public void testGetLocal() throws Exception {
+    String stellar = "GEO_GET('192.168.0.1')";
+    Object result = run(stellar, ImmutableMap.of());
+    Assert.assertEquals("Local IP should return empty map", new HashMap<String, String>(), result);
+  }
+
+  @Test
+  @SuppressWarnings("unchecked")
+  public void testGetRemote() throws Exception {
+    String stellar = "GEO_GET('216.160.83.56')";
+    Object result = run(stellar, ImmutableMap.of());
+    Assert.assertEquals("Remote Local IP should return result based on DB", expectedMessage, result);
+  }
+
+  @Test
+  @SuppressWarnings("unchecked")
+  public void testGetRemoteSingleField() throws Exception {
+    String stellar = "GEO_GET('216.160.83.56', ['country'])";
+    Object result = run(stellar, ImmutableMap.of());
+    Assert.assertEquals("Remote Local IP should return country result based on DB", "US", result);
+  }
+
+  @Test
+  @SuppressWarnings("unchecked")
+  public void testGetRemoteMultipleFields() throws Exception {
+    String stellar = "GEO_GET('216.160.83.56', ['country', 'city', 'dmaCode', 'location_point'])";
+    Object result = run(stellar, ImmutableMap.of());
+    Assert.assertEquals("Remote Local IP should return country result based on DB", expectedSubsetMessage, result);
+  }
+
+  @Test(expected=org.apache.metron.common.dsl.ParseException.class)
+  @SuppressWarnings("unchecked")
+  public void testGetTooManyParams() throws Exception {
+    String stellar = "GEO_GET('216.160.83.56', ['country', 'city', 'dmaCode', 'location_point'], 'garbage')";
+    run(stellar, ImmutableMap.of());
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/test/resources/GeoLite/GeoIP2-City-Test-2.mmdb.gz
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/test/resources/GeoLite/GeoIP2-City-Test-2.mmdb.gz b/metron-platform/metron-enrichment/src/test/resources/GeoLite/GeoIP2-City-Test-2.mmdb.gz
new file mode 100644
index 0000000..406c656
Binary files /dev/null and b/metron-platform/metron-enrichment/src/test/resources/GeoLite/GeoIP2-City-Test-2.mmdb.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/test/resources/GeoLite/GeoIP2-City-Test.mmdb.gz
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/test/resources/GeoLite/GeoIP2-City-Test.mmdb.gz b/metron-platform/metron-enrichment/src/test/resources/GeoLite/GeoIP2-City-Test.mmdb.gz
new file mode 100644
index 0000000..406c656
Binary files /dev/null and b/metron-platform/metron-enrichment/src/test/resources/GeoLite/GeoIP2-City-Test.mmdb.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/test/resources/GeoMysqlAdapterTest.properties
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/test/resources/GeoMysqlAdapterTest.properties b/metron-platform/metron-enrichment/src/test/resources/GeoMysqlAdapterTest.properties
deleted file mode 100644
index ef7126f..0000000
--- a/metron-platform/metron-enrichment/src/test/resources/GeoMysqlAdapterTest.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-
-mysql.ip=172.30.9.120
-mysql.port=3306
-mysql.username=test
-mysql.password=123123
-
-#GeoEnrichment
-bolt.enrichment.geo.enrichment_tag=geo
-bolt.enrichment.geo.adapter.table=GEO
-bolt.enrichment.geo.MAX_CACHE_SIZE_OBJECTS_NUM=10000
-bolt.enrichment.geo.MAX_TIME_RETAIN_MINUTES=10
-bolt.enrichment.geo.source=ip_src_addr,ip_dst_addr

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/test/resources/TestSchemas/GeoMySqlSchema.json
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/test/resources/TestSchemas/GeoMySqlSchema.json b/metron-platform/metron-enrichment/src/test/resources/TestSchemas/GeoMySqlSchema.json
deleted file mode 100644
index c4f2a82..0000000
--- a/metron-platform/metron-enrichment/src/test/resources/TestSchemas/GeoMySqlSchema.json
+++ /dev/null
@@ -1,42 +0,0 @@
-{
-"title": "GeoMySql Schema",
-"type": "object",
-"properties": {
-
-         "city"    : {
-					   "type": "string"
-				  },
-		 "country" : {
-						"type": "string"
-					},
-		 "dmaCode" :
-		 			 {
-						"type": "string"
-					},
-	     "geoHash" : 
-	     			{
-						"type": "string"
-					},
-		 "latitude" : 
-		 			{
-						"type": "string"
-				   },
-		 "locID" : 
-		 			{
-					   "type": "string"
-				   },
-		 "location_point" : 
-		 			{
-					   "type": "string"
-				    },
-		 "longitude" : 
-		 			{
-						"type": "string"
-					},
-		 "postalCode" : 
-		 			{
-						"type": "string"
-					}
-   },
-   "required": ["city", "country", "dmaCode","latitude","locID","location_point","postalCode"]
-}

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-hbase/pom.xml
----------------------------------------------------------------------
diff --git a/metron-platform/metron-hbase/pom.xml b/metron-platform/metron-hbase/pom.xml
index 5b302f5..834c197 100644
--- a/metron-platform/metron-hbase/pom.xml
+++ b/metron-platform/metron-hbase/pom.xml
@@ -24,7 +24,6 @@
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-        <mysql.version>5.1.31</mysql.version>
         <slf4j.version>1.7.7</slf4j.version>
         <storm.hdfs.version>0.1.2</storm.hdfs.version>
         <guava.version>${global_hbase_guava_version}</guava.version>

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-integration-test/src/main/config/zookeeper/global.json
----------------------------------------------------------------------
diff --git a/metron-platform/metron-integration-test/src/main/config/zookeeper/global.json b/metron-platform/metron-integration-test/src/main/config/zookeeper/global.json
index 5ac0579..8d3005f 100644
--- a/metron-platform/metron-integration-test/src/main/config/zookeeper/global.json
+++ b/metron-platform/metron-integration-test/src/main/config/zookeeper/global.json
@@ -21,5 +21,7 @@
   "profiler.client.hbase.table": "profiler",
   "profiler.client.hbase.column.family": "P",
   "profiler.client.salt.divisor": "1000",
-  "hbase.provider.impl": "org.apache.metron.hbase.HTableProvider"
+  "hbase.provider.impl": "org.apache.metron.hbase.HTableProvider",
+
+  "geo.hdfs.file": "src/test/resources/GeoLite/GeoIP2-City-Test.mmdb.gz"
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-parsers/src/main/java/org/apache/metron/parsers/bolt/ParserBolt.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-parsers/src/main/java/org/apache/metron/parsers/bolt/ParserBolt.java b/metron-platform/metron-parsers/src/main/java/org/apache/metron/parsers/bolt/ParserBolt.java
index abbd9d8..416d3ed 100644
--- a/metron-platform/metron-parsers/src/main/java/org/apache/metron/parsers/bolt/ParserBolt.java
+++ b/metron-platform/metron-parsers/src/main/java/org/apache/metron/parsers/bolt/ParserBolt.java
@@ -17,6 +17,7 @@
  */
 package org.apache.metron.parsers.bolt;
 
+import org.apache.metron.enrichment.adapters.geo.GeoLiteDatabase;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.storm.task.OutputCollector;
 import org.apache.storm.task.TopologyContext;
@@ -72,6 +73,8 @@ public class ParserBolt extends ConfiguredParserBolt implements Serializable {
   @Override
   public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) {
     super.prepare(stormConf, context, collector);
+    String hdfsFile = (String) getConfigurations().getGlobalConfig().get(GeoLiteDatabase.GEO_HDFS_FILE);
+    GeoLiteDatabase.INSTANCE.update(hdfsFile);
     this.collector = collector;
     initializeStellar();
     if(getSensorParserConfig() != null && filter == null) {

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-parsers/src/test/java/org/apache/metron/parsers/bolt/ParserBoltTest.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-parsers/src/test/java/org/apache/metron/parsers/bolt/ParserBoltTest.java b/metron-platform/metron-parsers/src/test/java/org/apache/metron/parsers/bolt/ParserBoltTest.java
index cf90178..de98a64 100644
--- a/metron-platform/metron-parsers/src/test/java/org/apache/metron/parsers/bolt/ParserBoltTest.java
+++ b/metron-platform/metron-parsers/src/test/java/org/apache/metron/parsers/bolt/ParserBoltTest.java
@@ -19,6 +19,8 @@ package org.apache.metron.parsers.bolt;
 
 import org.apache.metron.common.configuration.*;
 
+import org.apache.metron.enrichment.adapters.geo.GeoLiteDatabase;
+import org.apache.metron.test.utils.UnitTestHelper;
 import org.apache.storm.task.OutputCollector;
 import org.apache.storm.tuple.Tuple;
 import com.google.common.collect.ImmutableList;
@@ -44,6 +46,7 @@ import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mock;
 
+import java.io.File;
 import java.io.IOException;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -135,6 +138,9 @@ public class ParserBoltTest extends BaseBoltTest {
       }
 
     };
+
+    buildGlobalConfig(parserBolt);
+
     parserBolt.setCuratorFramework(client);
     parserBolt.setTreeCache(cache);
     parserBolt.prepare(new HashMap(), topologyContext, outputCollector);
@@ -172,6 +178,9 @@ public class ParserBoltTest extends BaseBoltTest {
       }
 
     };
+
+    buildGlobalConfig(parserBolt);
+
     parserBolt.setCuratorFramework(client);
     parserBolt.setTreeCache(cache);
     parserBolt.prepare(new HashMap(), topologyContext, outputCollector);
@@ -228,6 +237,9 @@ public void testImplicitBatchOfOne() throws Exception {
       };
     }
   };
+
+  buildGlobalConfig(parserBolt);
+
   parserBolt.setCuratorFramework(client);
   parserBolt.setTreeCache(cache);
   parserBolt.prepare(new HashMap(), topologyContext, outputCollector);
@@ -273,6 +285,9 @@ public void testImplicitBatchOfOne() throws Exception {
         }
       }
     };
+
+    buildGlobalConfig(parserBolt);
+
     parserBolt.setCuratorFramework(client);
     parserBolt.setTreeCache(cache);
     parserBolt.prepare(new HashMap(), topologyContext, outputCollector);
@@ -309,6 +324,9 @@ public void testImplicitBatchOfOne() throws Exception {
         }
       }
     };
+
+    buildGlobalConfig(parserBolt);
+
     parserBolt.setCuratorFramework(client);
     parserBolt.setTreeCache(cache);
     parserBolt.prepare(new HashMap(), topologyContext, outputCollector);
@@ -377,6 +395,9 @@ public void testImplicitBatchOfOne() throws Exception {
         }
       }
     };
+
+    buildGlobalConfig(parserBolt);
+
     parserBolt.setCuratorFramework(client);
     parserBolt.setTreeCache(cache);
     parserBolt.prepare(new HashMap(), topologyContext, outputCollector);
@@ -387,8 +408,6 @@ public void testImplicitBatchOfOne() throws Exception {
     Assert.assertEquals(expected, recordingWriter.getRecords().get(0).get("timestamp"));
   }
 
-
-
   @Test
   public void testBatchOfOne() throws Exception {
 
@@ -412,6 +431,9 @@ public void testImplicitBatchOfOne() throws Exception {
         };
       }
     };
+
+    buildGlobalConfig(parserBolt);
+
     parserBolt.setCuratorFramework(client);
     parserBolt.setTreeCache(cache);
     parserBolt.prepare(new HashMap(), topologyContext, outputCollector);
@@ -450,6 +472,9 @@ public void testImplicitBatchOfOne() throws Exception {
         };
       }
     };
+
+    buildGlobalConfig(parserBolt);
+
     parserBolt.setCuratorFramework(client);
     parserBolt.setTreeCache(cache);
     parserBolt.prepare(new HashMap(), topologyContext, outputCollector);
@@ -498,6 +523,9 @@ public void testImplicitBatchOfOne() throws Exception {
         };
       }
     };
+
+    buildGlobalConfig(parserBolt);
+
     parserBolt.setCuratorFramework(client);
     parserBolt.setTreeCache(cache);
     parserBolt.prepare(new HashMap(), topologyContext, outputCollector);
@@ -522,6 +550,13 @@ public void testImplicitBatchOfOne() throws Exception {
 
   }
 
+  protected void buildGlobalConfig(ParserBolt parserBolt) {
+    HashMap<String, Object> globalConfig = new HashMap<>();
+    String baseDir = UnitTestHelper.findDir("GeoLite");
+    File geoHdfsFile = new File(new File(baseDir), "GeoIP2-City-Test.mmdb.gz");
+    globalConfig.put(GeoLiteDatabase.GEO_HDFS_FILE, geoHdfsFile.getAbsolutePath());
+    parserBolt.getConfigurations().updateGlobalConfig(globalConfig);
+  }
 
   private static void writeNonBatch(OutputCollector collector, ParserBolt bolt, Tuple t) {
     bolt.execute(t);

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-parsers/src/test/java/org/apache/metron/writers/integration/WriterBoltIntegrationTest.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-parsers/src/test/java/org/apache/metron/writers/integration/WriterBoltIntegrationTest.java b/metron-platform/metron-parsers/src/test/java/org/apache/metron/writers/integration/WriterBoltIntegrationTest.java
index f37b1fc..eaeaeb5 100644
--- a/metron-platform/metron-parsers/src/test/java/org/apache/metron/writers/integration/WriterBoltIntegrationTest.java
+++ b/metron-platform/metron-parsers/src/test/java/org/apache/metron/writers/integration/WriterBoltIntegrationTest.java
@@ -61,6 +61,7 @@ public class WriterBoltIntegrationTest extends BaseIntegrationTest {
   }
   /**
    {
+   "geo.hdfs.file": "src/test/resources/GeoLite/GeoIP2-City-Test.mmdb.gz",
     "fieldValidations" : [
         {
           "validation" : "org.apache.metron.writers.integration.WriterBoltIntegrationTest$MockValidator"

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-parsers/src/test/resources/GeoLite/GeoIP2-City-Test.mmdb.gz
----------------------------------------------------------------------
diff --git a/metron-platform/metron-parsers/src/test/resources/GeoLite/GeoIP2-City-Test.mmdb.gz b/metron-platform/metron-parsers/src/test/resources/GeoLite/GeoIP2-City-Test.mmdb.gz
new file mode 100644
index 0000000..406c656
Binary files /dev/null and b/metron-platform/metron-parsers/src/test/resources/GeoLite/GeoIP2-City-Test.mmdb.gz differ


[3/3] incubator-metron git commit: METRON-283 Migrate Geo Enrichment outside of MySQL (justinleet) closes apache/incubator-metron#421

Posted by le...@apache.org.
METRON-283 Migrate Geo Enrichment outside of MySQL (justinleet) closes apache/incubator-metron#421


Project: http://git-wip-us.apache.org/repos/asf/incubator-metron/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-metron/commit/fa6f3df5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-metron/tree/fa6f3df5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-metron/diff/fa6f3df5

Branch: refs/heads/master
Commit: fa6f3df51b881e84aa7a9525f24c627fa28ca62e
Parents: c74c7de
Author: justinleet <ju...@gmail.com>
Authored: Thu Jan 26 11:19:44 2017 -0500
Committer: leet <le...@apache.org>
Committed: Thu Jan 26 11:19:44 2017 -0500

----------------------------------------------------------------------
 LICENSE                                         |  17 ++
 dependencies_with_url.csv                       |   4 +-
 metron-deployment/README.md                     |   7 +-
 metron-deployment/amazon-ec2/conf/defaults.yml  |   1 -
 metron-deployment/amazon-ec2/playbook.yml       |   2 +-
 .../inventory/devimage-vagrant/hosts            |   4 -
 .../inventory/full-dev-platform/group_vars/all  |   1 -
 .../inventory/full-dev-platform/hosts           |   4 -
 .../inventory/metron_example/group_vars/all     |   1 -
 .../inventory/metron_example/hosts              |   5 -
 .../inventory/quick-dev-platform/group_vars/all |   1 -
 .../inventory/quick-dev-platform/hosts          |   4 -
 .../METRON/CURRENT/role_command_order.json      |   3 +-
 .../METRON/CURRENT/configuration/metron-env.xml |  64 +----
 .../common-services/METRON/CURRENT/metainfo.xml |  50 ----
 .../CURRENT/package/files/addMysqlUser.sh       |  51 ----
 .../CURRENT/package/files/createMysqlGeoIp.sh   |  53 -----
 .../CURRENT/package/files/removeMysqlUser.sh    |  43 ----
 .../package/scripts/enrichment_commands.py      |  35 ++-
 .../package/scripts/enrichment_master.py        |   4 +
 .../CURRENT/package/scripts/mysql_server.py     |  63 -----
 .../CURRENT/package/scripts/mysql_service.py    |  46 ----
 .../CURRENT/package/scripts/mysql_users.py      |  58 -----
 .../CURRENT/package/scripts/mysql_utils.py      |  56 -----
 .../package/scripts/params/params_linux.py      |  30 +--
 .../package/scripts/params/status_params.py     |   8 +-
 .../package/templates/enrichment.properties.j2  |   7 -
 .../METRON/CURRENT/service_advisor.py           |  10 -
 .../METRON/CURRENT/themes/metron_theme.json     |  69 +-----
 .../docker/rpm-docker/SPECS/metron.spec         |   5 +-
 .../packer-build/metron-centos-6.7.json         |   2 +-
 metron-deployment/playbooks/metron_install.yml  |  17 --
 .../roles/metron_streaming/defaults/main.yml    |   1 +
 .../roles/metron_streaming/tasks/geoip.yml      |  22 ++
 .../metron_streaming/tasks/hdfs_filesystem.yml  |  15 ++
 .../roles/metron_streaming/tasks/main.yml       |   3 +
 .../roles/metron_streaming/tasks/topologies.yml |   6 -
 metron-deployment/roles/monit/defaults/main.yml |   1 -
 .../roles/monit/tasks/monit-definitions.yml     |   4 -
 .../roles/monit/templates/monit/mysql.monit     |  21 --
 .../roles/mysql_client/tasks/main.yml           |  35 ---
 .../roles/mysql_client/templates/db_config.sql  |  21 --
 .../roles/mysql_server/defaults/main.yml        |  21 --
 .../roles/mysql_server/files/geoip_ddl.sql      |  49 ----
 .../roles/mysql_server/handlers/main.yml        |  19 --
 .../roles/mysql_server/meta/main.yml            |  21 --
 .../roles/mysql_server/tasks/geoip.yml          |  37 ---
 .../roles/mysql_server/tasks/main.yml           |  20 --
 .../roles/mysql_server/tasks/mysql-password.yml |  33 ---
 .../roles/mysql_server/tasks/mysql.yml          |  60 -----
 .../roles/mysql_server/templates/.my.cnf        |  20 --
 metron-deployment/roles/snort/files/snort.conf  |   2 -
 metron-docker/.gitignore                        |   1 -
 metron-docker/README.md                         |   2 -
 metron-docker/compose/docker-compose.yml        |  10 -
 metron-docker/compose/mysql/Dockerfile          |  37 ---
 metron-docker/compose/mysql/bin/init-mysql.sh   |  19 --
 metron-docker/compose/mysql/bin/start.sh        |  21 --
 metron-docker/compose/storm/Dockerfile          |   5 +-
 metron-docker/install-metron.sh                 |   3 -
 metron-docker/pom.xml                           |  36 ---
 metron-platform/metron-common/README.md         |   8 +
 .../common/bolt/ConfiguredParserBolt.java       |   2 +-
 .../common/configuration/Configurations.java    |   3 +-
 .../org/apache/metron/common/dsl/Context.java   |   7 +-
 .../metron-data-management/README.md            |  15 ++
 metron-platform/metron-data-management/pom.xml  |   2 +-
 .../nonbulk/geo/GeoEnrichmentLoader.java        | 233 +++++++++++++++++++
 .../src/main/scripts/geo_enrichment_load.sh     |  41 ++++
 .../nonbulk/geo/GeoEnrichmentLoaderTest.java    |  91 ++++++++
 metron-platform/metron-enrichment/pom.xml       |  18 +-
 .../src/main/config/enrichment.properties       |   7 -
 .../src/main/flux/enrichment/remote.yaml        |  17 --
 .../src/main/flux/enrichment/test.yaml          |   2 +-
 .../adapters/cif/AbstractCIFAdapter.java        |   3 +-
 .../adapters/cif/CIFHbaseAdapter.java           |   6 +-
 .../enrichment/adapters/geo/GeoAdapter.java     |  81 +++----
 .../adapters/geo/GeoLiteDatabase.java           | 184 +++++++++++++++
 .../adapters/host/AbstractHostAdapter.java      |   3 +-
 .../adapters/host/HostFromJSONListAdapter.java  |   6 +-
 .../host/HostFromPropertiesFileAdapter.java     |   6 +-
 .../enrichment/adapters/jdbc/JdbcAdapter.java   |   5 +-
 .../simplehbase/SimpleHBaseAdapter.java         |  10 +-
 .../adapters/stellar/StellarAdapter.java        |   6 +-
 .../threatintel/ThreatIntelAdapter.java         |  11 +-
 .../enrichment/bolt/GenericEnrichmentBolt.java  |  14 +-
 .../enrichment/bolt/ThreatIntelJoinBolt.java    |  12 +
 .../interfaces/EnrichmentAdapter.java           |   6 +-
 .../stellar/GeoEnrichmentFunctions.java         | 110 +++++++++
 .../src/main/resources/ddl/geoip_ddl.sql        |  49 ----
 .../enrichment/adapters/geo/GeoAdapterTest.java |  96 +++-----
 .../adapters/geo/GeoLiteDatabaseTest.java       | 181 ++++++++++++++
 .../host/HostFromJSONListAdapterTest.java       |   2 +-
 .../host/HostFromPropertiesFileAdapterTest.java |   4 +-
 .../simplehbase/SimpleHBaseAdapterTest.java     |   2 +-
 .../threatintel/ThreatIntelAdapterTest.java     |   2 +-
 .../bolt/GenericEnrichmentBoltTest.java         |  17 +-
 .../bolt/ThreatIntelJoinBoltTest.java           |   9 +
 .../integration/EnrichmentIntegrationTest.java  |  71 +++---
 .../integration/mock/MockGeoAdapter.java        |  72 ------
 .../stellar/GeoEnrichmentFunctionsTest.java     | 150 ++++++++++++
 .../GeoLite/GeoIP2-City-Test-2.mmdb.gz          | Bin 0 -> 10011 bytes
 .../resources/GeoLite/GeoIP2-City-Test.mmdb.gz  | Bin 0 -> 10011 bytes
 .../resources/GeoMysqlAdapterTest.properties    |  27 ---
 .../resources/TestSchemas/GeoMySqlSchema.json   |  42 ----
 metron-platform/metron-hbase/pom.xml            |   1 -
 .../src/main/config/zookeeper/global.json       |   4 +-
 .../apache/metron/parsers/bolt/ParserBolt.java  |   3 +
 .../metron/parsers/bolt/ParserBoltTest.java     |  39 +++-
 .../integration/WriterBoltIntegrationTest.java  |   1 +
 .../resources/GeoLite/GeoIP2-City-Test.mmdb.gz  | Bin 0 -> 10011 bytes
 111 files changed, 1393 insertions(+), 1558 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 9d2a8df..27aaf94 100644
--- a/LICENSE
+++ b/LICENSE
@@ -210,6 +210,23 @@ This product bundles some test examples from the Stix project (metron-platform/m
 
 This product bundles wait-for-it.sh, which is available under a "MIT Software License" license.  For details, see https://github.com/vishnubob/wait-for-it
 
+------------------------------------------------------------------------------------
+
+------------------------------------------------------------------------------------
+  Creative Commons Attribution-ShareAlike 4.0 International License
+------------------------------------------------------------------------------------
+
+This product includes GeoLite2 data created by MaxMind, available from
+<a href="http://www.maxmind.com">http://www.maxmind.com</a>.
+
+------------------------------------------------------------------------------------
+  Creative Commons Attribution-ShareAlike 3.0 License
+------------------------------------------------------------------------------------
+
+This product includes a MaxMind DB created by MaxMind, available from
+<a href="https://github.com/maxmind/MaxMind-DB">https://github.com/maxmind/MaxMind-DB</a>.
+
+------------------------------------------------------------------------------------
 
 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/dependencies_with_url.csv
----------------------------------------------------------------------
diff --git a/dependencies_with_url.csv b/dependencies_with_url.csv
index 67b5373..ca8fe12 100644
--- a/dependencies_with_url.csv
+++ b/dependencies_with_url.csv
@@ -18,6 +18,8 @@ com.esotericsoftware:minlog:jar:1.3.0:compile,New BSD License,http://code.google
 com.esotericsoftware:reflectasm:jar:1.10.1:compile,New BSD License,http://code.google.com/p/minlog/
 com.google.protobuf:protobuf-java:jar:2.5.0:compile,New BSD license,http://code.google.com/p/protobuf
 com.jcraft:jsch:jar:0.1.42:compile,BSD,http://www.jcraft.com/jsch/
+com.maxmind.db:maxmind-db:jar:1.2.1:compile,CC-BY-SA 3.0,https://github.com/maxmind/MaxMind-DB
+com.maxmind.geoip2:geoip2:jar:2.8.0:compile,Apache v2,https://github.com/maxmind/GeoIP2-java
 com.sun.xml.bind:jaxb-impl:jar:2.2.3-1:compile,CDDL,http://jaxb.java.net/
 com.sun.xml.bind:jaxb-impl:jar:2.2.5-2:compile,CDDL,http://jaxb.java.net/
 com.twitter:jsr166e:jar:1.1.0:compile,CC0 1.0 Universal,http://github.com/twitter/jsr166e
@@ -32,7 +34,6 @@ javax.xml.stream:stax-api:jar:1.0-2:compile,COMMON DEVELOPMENT AND DISTRIBUTION
 jline:jline:jar:0.9.94:compile,BSD,http://jline.sourceforge.net
 junit:junit:jar:4.12:compile,Eclipse Public License 1.0,http://junit.org
 junit:junit:jar:4.4:compile,Common Public License Version 1.0,http://junit.org
-mysql:mysql-connector-java:jar:5.1.31:compile,ACCEPTABLE,http://dev.mysql.com/usingmysql/java/
 net.sf.jopt-simple:jopt-simple:jar:3.2:compile,The MIT License,http://jopt-simple.sourceforge.net
 net.sf.jopt-simple:jopt-simple:jar:4.9:compile,The MIT License,http://jopt-simple.sourceforge.net
 net.sf.saxon:Saxon-HE:jar:9.5.1-5:compile,Mozilla Public License Version 2.0,http://www.saxonica.com/
@@ -218,3 +219,4 @@ org.yaml:snakeyaml:jar:1.15:compile,Apache License Version 2.0,http://www.snakey
 ring-cors:ring-cors:jar:0.1.5:compile,Eclipse Public License 1.0,https://github.com/r0man/ring-cors
 xerces:xercesImpl:jar:2.9.1:compile,ASLv2,http://xerces.apache.org/xerces2-j
 xml-apis:xml-apis:jar:1.3.04:compile,ASLv2,http://xml.apache.org/commons/components/external/
+

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/README.md
----------------------------------------------------------------------
diff --git a/metron-deployment/README.md b/metron-deployment/README.md
index 2abf363..120f835 100644
--- a/metron-deployment/README.md
+++ b/metron-deployment/README.md
@@ -100,7 +100,7 @@ This will set up
 - Metron Parsers
 - Enrichment
 - Indexing
-- GeoIP database on MySQL
+- GeoIP data
 - Optional Elasticsearch
 - Optional Kibana
 
@@ -134,15 +134,13 @@ Notably, the URL for the GeoIP database that is preloaded (and is prefilled by d
 After installation, a custom action is available in Ambari (where stop / start services are) to install Elasticsearch templates.  Similar to this, a custom Kibana action to Load Template is available.
 
 #### Offline installation
-Currently there is only one point that would reach out to the internet during an install.  This is the URL for the GeoIP database information that is preloaded into MySQL.
+Currently there is only one point that would reach out to the internet during an install.  This is the URL for the GeoIP database information.
 
 The RPMs DO NOT reach out to the internet (because there is currently no hosting for them).  They look on the local filesystem in `/localrepo`.
 
 ### Current Limitations
 There are a set of limitations that should be addressed based to improve the current state of the mpacks.
 
-- MySQL install should be optional (and allow for using an existing instance).
-- MySQL should not be installed on a node already running a MySQL instance (e.g. an Ambari Server using MySQL as its database).
 - There is currently no hosting for RPMs remotely.  They will have to be built locally.
 - Colocation of appropriate services should be enforced by Ambari.  See [#Installing Management Pack] for more details.
 - Storm's topology.classpath is not updated with the Metron service install and needs to be updated separately.
@@ -177,6 +175,5 @@ rpm -i <package>
 ```
 
 ## TODO
-- migrate existing MySQL/GeoLite playbook
 - Support Ubuntu deployments
 

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/amazon-ec2/conf/defaults.yml
----------------------------------------------------------------------
diff --git a/metron-deployment/amazon-ec2/conf/defaults.yml b/metron-deployment/amazon-ec2/conf/defaults.yml
index f4baa5a..d3e84ec 100644
--- a/metron-deployment/amazon-ec2/conf/defaults.yml
+++ b/metron-deployment/amazon-ec2/conf/defaults.yml
@@ -17,7 +17,6 @@
 ---
 # which services should be started?
 services_to_start:
-  - mysql
   - elasticsearch
   - pcap-service
   - kibana

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/amazon-ec2/playbook.yml
----------------------------------------------------------------------
diff --git a/metron-deployment/amazon-ec2/playbook.yml b/metron-deployment/amazon-ec2/playbook.yml
index 1204b52..a0b15dc 100644
--- a/metron-deployment/amazon-ec2/playbook.yml
+++ b/metron-deployment/amazon-ec2/playbook.yml
@@ -31,7 +31,7 @@
     - include: tasks/create-hosts.yml host_count=1 host_type=ambari_slave,metron_kafka_topics,metron_hbase_tables,metron,ec2,pcap_server
     - include: tasks/create-hosts.yml host_count=1 host_type=ambari_slave,enrichment,metron,ec2
     - include: tasks/create-hosts.yml host_count=2 host_type=search,metron,ec2
-    - include: tasks/create-hosts.yml host_count=1 host_type=web,mysql,metron,ec2
+    - include: tasks/create-hosts.yml host_count=1 host_type=web,metron,ec2
   tags:
     - ec2
 

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/inventory/devimage-vagrant/hosts
----------------------------------------------------------------------
diff --git a/metron-deployment/inventory/devimage-vagrant/hosts b/metron-deployment/inventory/devimage-vagrant/hosts
index 36ec7fa..98e8681 100644
--- a/metron-deployment/inventory/devimage-vagrant/hosts
+++ b/metron-deployment/inventory/devimage-vagrant/hosts
@@ -39,9 +39,6 @@ node1
 [sensors]
 node1
 
-[mysql]
-node1
-
 [pcap_server]
 node1
 
@@ -50,7 +47,6 @@ enrichment
 search
 web
 sensors
-mysql
 metron_kafka_topics
 metron_hbase_tables
 pcap_server

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/inventory/full-dev-platform/group_vars/all
----------------------------------------------------------------------
diff --git a/metron-deployment/inventory/full-dev-platform/group_vars/all b/metron-deployment/inventory/full-dev-platform/group_vars/all
index 2d07879..2f644af 100644
--- a/metron-deployment/inventory/full-dev-platform/group_vars/all
+++ b/metron-deployment/inventory/full-dev-platform/group_vars/all
@@ -17,7 +17,6 @@
 
 # which services should be started?
 services_to_start:
-  - mysql
   - elasticsearch
   - pcap-service
   - kibana

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/inventory/full-dev-platform/hosts
----------------------------------------------------------------------
diff --git a/metron-deployment/inventory/full-dev-platform/hosts b/metron-deployment/inventory/full-dev-platform/hosts
index 7dacc20..98e8681 100644
--- a/metron-deployment/inventory/full-dev-platform/hosts
+++ b/metron-deployment/inventory/full-dev-platform/hosts
@@ -42,15 +42,11 @@ node1
 [pcap_server]
 node1
 
-[mysql]
-node1
-
 [metron:children]
 enrichment
 search
 web
 sensors
-mysql
 metron_kafka_topics
 metron_hbase_tables
 pcap_server

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/inventory/metron_example/group_vars/all
----------------------------------------------------------------------
diff --git a/metron-deployment/inventory/metron_example/group_vars/all b/metron-deployment/inventory/metron_example/group_vars/all
index 38f1440..d6a31f3 100644
--- a/metron-deployment/inventory/metron_example/group_vars/all
+++ b/metron-deployment/inventory/metron_example/group_vars/all
@@ -17,7 +17,6 @@
 ---
 # which services should be started?
 services_to_start:
-  - mysql
   - elasticsearch
   - pcap-service
   - kibana

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/inventory/metron_example/hosts
----------------------------------------------------------------------
diff --git a/metron-deployment/inventory/metron_example/hosts b/metron-deployment/inventory/metron_example/hosts
index d2d540f..c53466d 100644
--- a/metron-deployment/inventory/metron_example/hosts
+++ b/metron-deployment/inventory/metron_example/hosts
@@ -51,18 +51,13 @@ node12
 [sensors]
 node1
 
-#same as mysql in 12 node topology
 [web]
 node12
 
-[mysql]
-node12
-
 [metron:children]
 enrichment
 search
 web
 sensors
-mysql
 metron_kafka_topics
 metron_hbase_tables

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/inventory/quick-dev-platform/group_vars/all
----------------------------------------------------------------------
diff --git a/metron-deployment/inventory/quick-dev-platform/group_vars/all b/metron-deployment/inventory/quick-dev-platform/group_vars/all
index e27e528..0153a0d 100644
--- a/metron-deployment/inventory/quick-dev-platform/group_vars/all
+++ b/metron-deployment/inventory/quick-dev-platform/group_vars/all
@@ -17,7 +17,6 @@
 
 # which services should be started?
 services_to_start:
-  - mysql
   - elasticsearch
   - pcap-service
   - kibana

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/inventory/quick-dev-platform/hosts
----------------------------------------------------------------------
diff --git a/metron-deployment/inventory/quick-dev-platform/hosts b/metron-deployment/inventory/quick-dev-platform/hosts
index 7dacc20..98e8681 100644
--- a/metron-deployment/inventory/quick-dev-platform/hosts
+++ b/metron-deployment/inventory/quick-dev-platform/hosts
@@ -42,15 +42,11 @@ node1
 [pcap_server]
 node1
 
-[mysql]
-node1
-
 [metron:children]
 enrichment
 search
 web
 sensors
-mysql
 metron_kafka_topics
 metron_hbase_tables
 pcap_server

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/METRON/CURRENT/role_command_order.json
----------------------------------------------------------------------
diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/METRON/CURRENT/role_command_order.json b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/METRON/CURRENT/role_command_order.json
index 0f4cd39..e08f401 100755
--- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/METRON/CURRENT/role_command_order.json
+++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/METRON/CURRENT/role_command_order.json
@@ -5,8 +5,7 @@
         "_comment" : "dependencies for all cases",
         "METRON_INDEXING-INSTALL" : ["METRON_PARSERS-INSTALL"],
         "METRON_PARSERS-START" : ["NAMENODE-START", "ZOOKEEPER_SERVER-START", "KAFKA_BROKER-START", "STORM_REST_API-START"],
-        "METRON_ENRICHMENT_MASTER-START" : ["NAMENODE-START", "ZOOKEEPER_SERVER-START", "KAFKA_BROKER-START", "STORM_REST_API-START", "ENRICHMENT_MYSQL_SERVER-START", "HBASE_MASTER-START", "HBASE_REGIONSERVER-START"],
-        "METRON_ENRICHMENT_MYSQL_SERVER-STOP" : ["METRON_ENRICHMENT_MASTER-STOP"],
+        "METRON_ENRICHMENT_MASTER-START" : ["NAMENODE-START", "ZOOKEEPER_SERVER-START", "KAFKA_BROKER-START", "STORM_REST_API-START", "HBASE_MASTER-START", "HBASE_REGIONSERVER-START"],
         "METRON_ENRICHMENT_SERVICE_CHECK-SERVICE_CHECK" : ["METRON_ENRICHMENT_MASTER-START"],
         "METRON_INDEXING-START" : ["NAMENODE-START", "ZOOKEEPER_SERVER-START", "KAFKA_BROKER-START", "STORM_REST_API-START","METRON_PARSERS-START"],
         "METRON_SERVICE_CHECK-SERVICE_CHECK" : ["METRON_PARSERS-START","METRON_INDEXING-START"]

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/configuration/metron-env.xml
----------------------------------------------------------------------
diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/configuration/metron-env.xml b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/configuration/metron-env.xml
index 7484d31..6015965 100644
--- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/configuration/metron-env.xml
+++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/configuration/metron-env.xml
@@ -69,42 +69,6 @@
         <display-name>Metron Parsers</display-name>
     </property>
     <property>
-        <name>metron_enrichment_db_user</name>
-        <value>metron</value>
-        <description>Database username to use to connect to the database.</description>
-        <display-name>Enrichment Database User</display-name>
-    </property>
-    <property>
-        <name>metron_enrichment_db_port</name>
-        <display-name>Metron Enrichment Database Port</display-name>
-        <value>3306</value>
-        <description>Database port to use to connect to the database.</description>
-    </property>
-    <property>
-        <name>metron_enrichment_db_password</name>
-        <value></value>
-        <property-type>PASSWORD</property-type>
-        <display-name>Metron Enrichment Database Password</display-name>
-        <description>Password to use against database</description>
-        <value-attributes>
-            <type>password</type>
-            <overridable>false</overridable>
-        </value-attributes>
-        <on-ambari-upgrade add="true"/>
-    </property>
-    <property>
-        <name>mysql_admin_password</name>
-        <value></value>
-        <property-type>PASSWORD</property-type>
-        <display-name>MySQL root user password</display-name>
-        <description>Password to use to add Metron user to MySQL</description>
-        <value-attributes>
-            <type>password</type>
-            <overridable>false</overridable>
-        </value-attributes>
-        <on-ambari-upgrade add="true"/>
-    </property>
-    <property>
         <name>metron_indexing_topology</name>
         <value>indexing</value>
         <description>The Storm topology name for Indexing</description>
@@ -118,7 +82,7 @@
     </property>
     <property>
         <name>geoip_url</name>
-        <value>http://geolite.maxmind.com/download/geoip/database/GeoLiteCity_CSV/GeoLiteCity-latest.tar.xz</value>
+        <value>http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz</value>
         <description>Location of the GeoIP data to load.</description>
         <display-name>GEOIP Load Datafile URL</display-name>
     </property>
@@ -173,32 +137,6 @@
         <value></value>
     </property>
     <property>
-        <name>install_mysql</name>
-        <description>Install New MySQL Instance for Enrichments</description>
-        <display-name>Install MySQL</display-name>
-        <value>Yes</value>
-        <value-attributes>
-            <overridable>false</overridable>
-            <type>value-list</type>
-            <entries>
-                <entry>
-                    <value>Yes</value>
-                    <label>Yes</label>
-                </entry>
-                <entry>
-                    <value>No</value>
-                    <label>No</label>
-                </entry>
-            </entries>
-            <selection-cardinality>1</selection-cardinality>
-        </value-attributes>
-    </property>
-    <property>
-        <name>mysql_host</name>
-        <display-name>MySQL Host Address</display-name>
-        <value></value>
-    </property>
-    <property>
         <name>global-json</name>
         <display-name>global.json template</display-name>
         <description>This is the jinja template for global.json file</description>

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/metainfo.xml
----------------------------------------------------------------------
diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/metainfo.xml b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/metainfo.xml
index 2677f60..3c71328 100644
--- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/metainfo.xml
+++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/metainfo.xml
@@ -113,29 +113,6 @@
         </component>
 
         <component>
-          <name>METRON_ENRICHMENT_MYSQL_SERVER</name>
-          <displayName>MySQL Server</displayName>
-          <category>MASTER</category>
-          <cardinality>1</cardinality>
-          <versionAdvertised>false</versionAdvertised>
-          <clientsToUpdateConfigs></clientsToUpdateConfigs>
-          <commandScript>
-            <script>scripts/mysql_server.py</script>
-            <scriptType>PYTHON</scriptType>
-          </commandScript>
-          <customCommands>
-            <customCommand>
-              <name>CLEAN</name>
-              <commandScript>
-                <script>scripts/mysql_server.py</script>
-                <scriptType>PYTHON</scriptType>
-                <timeout>600</timeout>
-              </commandScript>
-            </customCommand>
-          </customCommands>
-        </component>
-
-        <component>
           <name>METRON_INDEXING</name>
           <displayName>Metron Indexing</displayName>
           <category>MASTER</category>
@@ -234,33 +211,6 @@
             </package>
           </packages>
         </osSpecific>
-        <osSpecific>
-          <osFamily>redhat7</osFamily>
-          <packages>
-            <package>
-              <name>mysql-community-release</name>
-              <skipUpgrade>true</skipUpgrade>
-            </package>
-            <package>
-              <name>mysql-community-server</name>
-              <skipUpgrade>true</skipUpgrade>
-            </package>
-            <package>MySQL-python</package>
-          </packages>
-        </osSpecific>
-        <osSpecific>
-          <osFamily>redhat6</osFamily>
-          <packages>
-            <package>
-              <name>mysql-server</name>
-              <skipUpgrade>true</skipUpgrade>
-            </package>
-            <package>
-              <name>mysql</name>
-              <skipUpgrade>true</skipUpgrade>
-            </package>
-          </packages>
-        </osSpecific>
       </osSpecifics>
       <commandScript>
         <script>scripts/service_check.py</script>

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/addMysqlUser.sh
----------------------------------------------------------------------
diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/addMysqlUser.sh b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/addMysqlUser.sh
deleted file mode 100755
index 8a6a788..0000000
--- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/addMysqlUser.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/sh
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-mysqldbuser=$1
-mysqldbpasswd=$2
-mysqldbhost=$3
-mysqlqdminpassword=$4
-myhostname=$(hostname -f)
-
-
-echo "Adding user ${mysqldbuser}@${mysqldbhost} and ${mysqldbuser}@localhost"
-expect <<EOF
-log_user 0
-# start mysql process using password prompt
-spawn mysql -u root -p
-expect "password:"
-send "${mysqlqdminpassword}\r"
-# echo all output until the end
-expect "mysql>"
-send "CREATE USER '${mysqldbuser}'@'${mysqldbhost}' IDENTIFIED BY '${mysqldbpasswd}';\r"
-expect "mysql>"
-send "CREATE USER '${mysqldbuser}'@'localhost' IDENTIFIED BY '${mysqldbpasswd}';\r"
-expect "mysql>"
-send "GRANT ALL PRIVILEGES ON GEO.* TO '${mysqldbuser}'@'%' IDENTIFIED BY '${mysqldbpasswd}';\r"
-log_user 1
-expect "mysql>"
-send "GRANT ALL PRIVILEGES ON GEO.* TO '${mysqldbuser}'@'${mysqldbhost}';\r"
-expect "mysql>"
-send "GRANT ALL PRIVILEGES ON GEO.* TO '${mysqldbuser}'@'localhost';\r"
-expect "mysql>"
-send "flush privileges;\r"
-send "\q"
-EOF

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/createMysqlGeoIp.sh
----------------------------------------------------------------------
diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/createMysqlGeoIp.sh b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/createMysqlGeoIp.sh
deleted file mode 100755
index 40f11e1..0000000
--- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/createMysqlGeoIp.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/sh
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-from ../scripts/params import params
-
-geoipscript=$1
-geoipurl=$2
-mysqlqdminpassword=$3
-
-# Download and extract the actual GeoIP files
-mkdir -p /tmp/geoip
-mkdir -p /var/lib/mysql-files/
-
-# Stage the GeoIP data
-pushd /tmp/geoip
-curl -O ${geoipurl}
-tar xf GeoLiteCity-latest.tar.xz
-cp /tmp/geoip/*/*.csv /var/lib/mysql-files/
-popd
-
-# Load MySQL with the GeoIP data
-expect <<EOF
-log_user 0
-# start mysql process using password prompt
-spawn mysql -u root -p
-expect "password:"
-send "${mysqlqdminpassword}\r"
-# echo all output until the end
-log_user 1
-expect "mysql>"
-send "source ${geoipscript}\r"
-expect "mysql>"
-send "show databases;\r"
-send "\q"
-EOF

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/removeMysqlUser.sh
----------------------------------------------------------------------
diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/removeMysqlUser.sh b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/removeMysqlUser.sh
deleted file mode 100755
index 3fc7afb..0000000
--- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/removeMysqlUser.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env bash
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-
-mysqldbuser=$1
-userhost=$2
-mysqlqdminpassword=$3
-myhostname=$(hostname -f)
-sudo_prefix="/var/lib/ambari-agent/ambari-sudo.sh -H -E"
-
-echo "Removing user $mysqldbuser@$userhost"
-expect <<EOF
-log_user 0
-# start mysql process using password prompt
-spawn mysql -u root -p
-expect "password:"
-send "${mysqlqdminpassword}\r"
-# echo all output until the end
-log_user 1
-expect "mysql>"
-send "DROP USER '${mysqldbuser}'@'${userhost}';\r"
-expect "mysql>"
-send "flush privileges;;\r"
-send "\q"
-EOF
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/enrichment_commands.py
----------------------------------------------------------------------
diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/enrichment_commands.py b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/enrichment_commands.py
index cb9cf22..bc73c87 100755
--- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/enrichment_commands.py
+++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/enrichment_commands.py
@@ -17,7 +17,6 @@ limitations under the License.
 
 import os
 import time
-
 from resource_management.core.logger import Logger
 from resource_management.core.resources.system import Execute, File
 
@@ -74,15 +73,39 @@ class EnrichmentCommands:
             yum_repo_types[repo_type]()
             Logger.info("Writing out repo file")
             repo_template = ("echo \"[METRON-${metron.version}]\n"
-                            "name=Metron ${metron.version} packages\n"
-                            "baseurl={0}\n"
-                            "gpgcheck=0\n"
-                            "enabled=1\n\""
-                         "   > /etc/yum.repos.d/metron.repo")
+                             "name=Metron ${metron.version} packages\n"
+                             "baseurl={0}\n"
+                             "gpgcheck=0\n"
+                             "enabled=1\n\""
+                             "   > /etc/yum.repos.d/metron.repo")
             Execute(repo_template.format(self.__params.repo_url))
         else:
             raise ValueError("Unsupported repo type '{0}'".format(repo_type))
 
+    def init_geo(self):
+        Logger.info("Creating HDFS location for GeoIP database")
+        self.__params.HdfsResource(self.__params.geoip_hdfs_dir,
+                                   type="directory",
+                                   action="create_on_execute",
+                                   owner=self.__params.metron_user,
+                                   group=self.__params.user_group,
+                                   mode=0775,
+                                   )
+
+        Logger.info("Creating and loading GeoIp database")
+        command_template = """{0}/bin/geo_enrichment_load.sh \
+                                -g {1} \
+                                -r {2} \
+                                -z {3}"""
+        command = command_template.format(self.__params.metron_home,
+                                          self.__params.geoip_url,
+                                          self.__params.geoip_hdfs_dir,
+                                          self.__params.zookeeper_quorum
+                                          )
+        Logger.info("Executing command " + command)
+        Execute(command, user=self.__params.metron_user, tries=1, logoutput=True)
+        Logger.info("Done intializing GeoIP data")
+
     def init_kafka_topics(self):
         Logger.info('Creating Kafka topics')
         command_template = """{0}/kafka-topics.sh \

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/enrichment_master.py
----------------------------------------------------------------------
diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/enrichment_master.py b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/enrichment_master.py
index d9da4f6..b02ba5c 100755
--- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/enrichment_master.py
+++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/enrichment_master.py
@@ -22,6 +22,7 @@ from resource_management.libraries.functions.format import format
 from resource_management.libraries.script import Script
 
 from enrichment_commands import EnrichmentCommands
+import metron_service
 
 
 class Enrichment(Script):
@@ -48,9 +49,12 @@ class Enrichment(Script):
         env.set_params(params)
         commands = EnrichmentCommands(params)
 
+        metron_service.load_global_config(params)
+
         if not commands.is_configured():
             commands.init_kafka_topics()
             commands.create_hbase_tables()
+            commands.init_geo()
             commands.set_configured()
 
         commands.start_enrichment_topology()

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/mysql_server.py
----------------------------------------------------------------------
diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/mysql_server.py b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/mysql_server.py
deleted file mode 100755
index fcc83af..0000000
--- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/mysql_server.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env python
-"""
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-"""
-
-from resource_management.libraries.script.script import Script
-
-import mysql_users
-from mysql_service import mysql_service
-from mysql_utils import mysql_configure
-from resource_management.core.resources.packaging import Package
-from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
-
-class MysqlServer(Script):
-    def install(self, env):
-        self.install_packages(env)
-        self.configure(env)
-
-    def clean(self, env):
-        from params import params
-        env.set_params(params)
-        if params.install_mysql == 'Yes':
-            mysql_users.mysql_deluser()
-
-    def configure(self, env, upgrade_type=None, config_dir=None):
-        from params import params
-        env.set_params(params)
-        mysql_configure()
-
-    def start(self, env, rolling_restart=False):
-        from params import params
-        env.set_params(params)
-        mysql_service(daemon_name=params.daemon_name, action='start')
-
-    def stop(self, env, rolling_restart=False):
-        from params import params
-        env.set_params(params)
-        mysql_service(daemon_name=params.daemon_name, action='stop')
-
-    def status(self, env):
-        from params import status_params
-        env.set_params(status_params)
-
-        mysql_service(daemon_name=status_params.daemon_name, action='status')
-
-
-if __name__ == "__main__":
-    MysqlServer().execute()

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/mysql_service.py
----------------------------------------------------------------------
diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/mysql_service.py b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/mysql_service.py
deleted file mode 100755
index 2e0ce8b..0000000
--- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/mysql_service.py
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/env python
-"""
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-"""
-
-from resource_management.core.exceptions import ComponentIsNotRunning, Fail
-from resource_management.core.resources.system import Execute
-from resource_management.libraries.functions.format import format
-
-
-def mysql_service(daemon_name=None, action='start'):
-    status_cmd = format("pgrep -l '^{mysql_process_name}$'")
-    cmd = ('service', daemon_name, action)
-
-    if action == 'status':
-        try:
-            Execute(status_cmd)
-        except Fail:
-            raise ComponentIsNotRunning()
-    elif action == 'stop':
-        Execute(cmd,
-                logoutput=True,
-                only_if=status_cmd,
-                sudo=True,
-                )
-    elif action == 'start':
-        Execute(cmd,
-                logoutput=True,
-                not_if=status_cmd,
-                sudo=True,
-                )

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/mysql_users.py
----------------------------------------------------------------------
diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/mysql_users.py b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/mysql_users.py
deleted file mode 100755
index b778e85..0000000
--- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/mysql_users.py
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env python
-"""
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-"""
-
-from resource_management.core.resources.system import Execute, File
-from resource_management.core.source import StaticFile
-from resource_management.libraries.functions.format import format
-
-
-# Used to add metron access to the needed components
-def mysql_adduser():
-    from params import params
-
-    File(params.mysql_adduser_path,
-         mode=0755,
-         content=StaticFile('addMysqlUser.sh')
-         )
-
-    add_user_cmd = format("bash -x {mysql_adduser_path} {metron_user} {enrichment_metron_user_passwd!p} {mysql_host} {mysql_admin_password!p}")
-    Execute(add_user_cmd,
-            tries=3,
-            try_sleep=5,
-            logoutput=False,
-            path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'
-            )
-
-
-# Removes hive metron from components
-def mysql_deluser():
-    from params import params
-
-    File(params.mysql_deluser_path,
-         mode=0755,
-         content=StaticFile('removeMysqlUser.sh')
-         )
-
-    del_user_cmd = format("bash -x {mysql_deluser_path} {metron_user} {mysql_host} {mysql_admin_password!p}")
-    Execute(del_user_cmd,
-            tries=3,
-            try_sleep=5,
-            path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
-            )

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/mysql_utils.py
----------------------------------------------------------------------
diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/mysql_utils.py b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/mysql_utils.py
deleted file mode 100755
index 63cdb38..0000000
--- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/mysql_utils.py
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/env python
-"""
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-"""
-
-from resource_management.core.resources.system import Execute, File
-from resource_management.core.source import StaticFile
-from resource_management.libraries.functions.format import format
-from mysql_service import mysql_service
-
-import mysql_users
-
-
-def mysql_configure():
-    from params import params
-
-    if params.install_mysql == 'Yes':
-        mysql_service(daemon_name=params.daemon_name, action='start')
-
-    replace_bind_address = ('sed', '-i', 's|^bind-address[ \t]*=.*|bind-address = 0.0.0.0|', params.mysql_configname)
-    Execute(replace_bind_address,
-            sudo=True,
-            )
-
-    mysql_users.mysql_adduser()
-
-    File(params.mysql_create_geoip_path,
-         mode=0755,
-         content=StaticFile('createMysqlGeoIp.sh')
-         )
-
-    geoip_setup_cmd = format("bash -x {mysql_create_geoip_path} {geoip_ddl} {geoip_url} {mysql_admin_password!p}")
-
-    Execute(geoip_setup_cmd,
-            tries=3,
-            try_sleep=5,
-            path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
-            )
-
-    if params.install_mysql == 'Yes':
-        mysql_service(daemon_name=params.daemon_name, action='stop')

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/params/params_linux.py
----------------------------------------------------------------------
diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/params/params_linux.py b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/params/params_linux.py
index 6b3052d..4e00971 100755
--- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/params/params_linux.py
+++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/params/params_linux.py
@@ -42,9 +42,8 @@ hostname = config['hostname']
 user_group = config['configurations']['cluster-env']['user_group']
 metron_home = status_params.metron_home
 parsers = status_params.parsers
-metron_ddl_dir = metron_home + '/ddl'
-geoip_ddl = metron_ddl_dir + '/geoip_ddl.sql'
 geoip_url = config['configurations']['metron-env']['geoip_url']
+geoip_hdfs_dir = "/apps/metron/geo/default/"
 metron_indexing_topology = status_params.metron_indexing_topology
 metron_user = config['configurations']['metron-env']['metron_user']
 metron_group = config['configurations']['metron-env']['metron_group']
@@ -110,6 +109,7 @@ if has_kafka_host:
     kafka_brokers += ':' + kafka_broker_port
 
 metron_apps_hdfs_dir = config['configurations']['metron-env']['metron_apps_hdfs_dir']
+
 # the double "format" is not an error - we are pulling in a jinja-templated param. This is a bit of a hack, but works
 # well enough until we find a better way via Ambari
 metron_apps_indexed_hdfs_dir = format(format(config['configurations']['metron-env']['metron_apps_indexed_hdfs_dir']))
@@ -129,32 +129,6 @@ hdfs_site = config['configurations']['hdfs-site']
 default_fs = config['configurations']['core-site']['fs.defaultFS']
 dfs_type = default("/commandParams/dfs_type", "")
 
-# MYSQL
-if OSCheck.is_ubuntu_family():
-    mysql_configname = '/etc/mysql/my.cnf'
-else:
-    mysql_configname = '/etc/my.cnf'
-
-daemon_name = status_params.daemon_name
-
-install_mysql = config['configurations']['metron-env']['install_mysql']
-mysql_admin_password = config['configurations']['metron-env']['mysql_admin_password']
-
-# There will always be exactly one mysql_host
-mysql_host = config['clusterHostInfo']['metron_enrichment_mysql_server_hosts'][0]
-
-mysql_port = config['configurations']['metron-env']['metron_enrichment_db_port']
-
-mysql_adduser_path = tmp_dir + "/addMysqlUser.sh"
-mysql_deluser_path = tmp_dir + "/removeMysqlUser.sh"
-mysql_create_geoip_path = tmp_dir + "/createMysqlGeoIp.sh"
-
-enrichment_metron_user = config['configurations']['metron-env']['metron_enrichment_db_user']
-enrichment_metron_user_passwd = config['configurations']['metron-env']['metron_enrichment_db_password']
-enrichment_metron_user_passwd = unicode(enrichment_metron_user_passwd) if not is_empty(
-    enrichment_metron_user_passwd) else enrichment_metron_user_passwd
-mysql_process_name = status_params.mysql_process_name
-
 # create partial functions with common arguments for every HdfsResource call
 # to create/delete hdfs directory/file/copyfromlocal we need to call params.HdfsResource in code
 HdfsResource = functools.partial(

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/params/status_params.py
----------------------------------------------------------------------
diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/params/status_params.py b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/params/status_params.py
index 92c9d06..4880247 100644
--- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/params/status_params.py
+++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/params/status_params.py
@@ -42,13 +42,7 @@ enrichment_cf = 't'
 threatintel_table = 'threatintel'
 threatintel_cf = 't'
 
-mysql_process_name = 'mysqld'
-if OSCheck.is_suse_family() or OSCheck.is_ubuntu_family():
-    daemon_name = 'mysql'
-else:
-    daemon_name = 'mysqld'
-
-# ing
+# Indexing
 metron_indexing_topology = config['configurations']['metron-env']['metron_indexing_topology']
 indexing_configured_flag_file = metron_zookeeper_config_path + '/../metron_indexing_configured'
 

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/templates/enrichment.properties.j2
----------------------------------------------------------------------
diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/templates/enrichment.properties.j2 b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/templates/enrichment.properties.j2
index 14403de..dc108f7 100755
--- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/templates/enrichment.properties.j2
+++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/templates/enrichment.properties.j2
@@ -23,13 +23,6 @@ enrichment.output.topic=indexing
 enrichment.error.topic=enrichments_error
 threat.intel.error.topic=threatintel_error
 
-##### MySQL #####
-
-mysql.ip={{mysql_host}}
-mysql.port={{mysql_port}}
-mysql.username={{enrichment_metron_user}}
-mysql.password={{enrichment_metron_user_passwd}}
-
 ##### Metrics #####
 
 #reporters

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/service_advisor.py
----------------------------------------------------------------------
diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/service_advisor.py b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/service_advisor.py
index 72e349b..4c492ab 100644
--- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/service_advisor.py
+++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/service_advisor.py
@@ -44,7 +44,6 @@ class METRON${metron.short.version}ServiceAdvisor(service_advisor.ServiceAdvisor
         metronParsersHost = self.getHosts(componentsList, "METRON_PARSERS")[0]
         metronEnrichmentMaster = self.getHosts(componentsList, "METRON_ENRICHMENT_MASTER")[0]
         metronIndexingHost = self.getHosts(componentsList, "METRON_INDEXING")[0]
-        metronEnrichmentMysqlServer = self.getHosts(componentsList, "METRON_ENRICHMENT_MYSQL_SERVER")[0]
 
         hbaseClientHosts = self.getHosts(componentsList, "HBASE_CLIENT")
         hdfsClientHosts = self.getHosts(componentsList, "HDFS_CLIENT")
@@ -72,10 +71,6 @@ class METRON${metron.short.version}ServiceAdvisor(service_advisor.ServiceAdvisor
             message = "Metron Indexing must be co-located with Metron Parsers on {0}".format(metronParsersHost)
             items.append({ "type": 'host-component', "level": 'ERROR', "message": message, "component-name": 'METRON_INDEXING', "host": metronIndexingHost })
 
-        if metronParsersHost != metronEnrichmentMysqlServer:
-            message = "Metron MySQL Server must be co-located with Metron Parsers on {0}".format(metronParsersHost)
-            items.append({ "type": 'host-component', "level": 'ERROR', "message": message, "component-name": 'METRON_ENRICHMENT_MYSQL_SERVER', "host": metronEnrichmentMysqlServer })
-
         # Enrichment Master also needs ZK Client, but this is already guaranteed by being colocated with Parsers Master
         if metronParsersHost not in zookeeperClientHosts:
             message = "Metron must be co-located with an instance of Zookeeper Client"
@@ -102,11 +97,6 @@ class METRON${metron.short.version}ServiceAdvisor(service_advisor.ServiceAdvisor
         return items
 
     def getServiceConfigurationRecommendations(self, configurations, clusterData, services, hosts):
-        #Suggest mysql server hostname
-        mySQLServerHost = self.getComponentHostNames(services, "METRON", "METRON_ENRICHMENT_MYSQL_SERVER")[0]
-        putMetronEnvProperty = self.putProperty(configurations, "metron-env", services)
-        putMetronEnvProperty("mysql_host",mySQLServerHost)
-
         #Suggest Storm Rest URL
         if "storm-site" in services["configurations"]:
             stormUIServerHost = self.getComponentHostNames(services, "STORM", "STORM_UI_SERVER")[0]

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/themes/metron_theme.json
----------------------------------------------------------------------
diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/themes/metron_theme.json b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/themes/metron_theme.json
index b939182..1f56070 100644
--- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/themes/metron_theme.json
+++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/themes/metron_theme.json
@@ -6,7 +6,7 @@
         "tabs": [
           {
             "name": "metron_general",
-            "display-name": "Settings",
+            "display-name": "Index Settings",
             "layout": {
               "tab-columns": "1",
               "tab-rows": "1",
@@ -17,22 +17,13 @@
                   "column-index": "0",
                   "row-span": "1",
                   "column-span": "1",
-                  "section-columns": "2",
+                  "section-columns": "1",
                   "section-rows": "1",
                   "subsections": [
                     {
-                      "name": "subsection-general-database",
-                      "display-name" : "Database Settings",
-                      "row-index": "0",
-                      "column-index": "0",
-                      "row-span": "1",
-                      "column-span": "1"
-                    },
-                    {
                       "name": "subsection-general-indexing",
-                      "display-name": "Index Settings",
                       "row-index": "0",
-                      "column-index": "1",
+                      "column-index": "0",
                       "row-span": "1",
                       "column-span": "1"
                     }
@@ -76,36 +67,6 @@
       "configuration-layout": "default",
       "configs": [
         {
-          "config": "metron-env/install_mysql",
-          "subsection-name": "subsection-general-database"
-        },
-        {
-          "config": "metron-env/mysql_admin_password",
-          "subsection-name": "subsection-general-database",
-          "depends-on": [
-            {
-              "configs":[
-                "metron-env/install_mysql"
-              ],
-              "if": "${metron-env/install_mysql} === No",
-              "then": {
-                "property_value_attributes": {
-                  "visible": true
-                }
-              },
-              "else": {
-                "property_value_attributes": {
-                  "visible": false
-                }
-              }
-            }
-          ]
-        },
-        {
-          "config": "metron-env/metron_enrichment_db_password",
-          "subsection-name": "subsection-general-database"
-        },
-        {
           "config": "metron-env/metron_enrichment_db_port",
           "subsection-name": "subsection-general-database"
         },
@@ -155,30 +116,6 @@
     },
     "widgets": [
       {
-        "config": "metron-env/install_mysql",
-        "widget": {
-          "type": "toggle"
-        }
-      },
-      {
-        "config": "metron-env/mysql_admin_password",
-        "widget": {
-          "type": "password"
-        }
-      },
-      {
-        "config": "metron-env/metron_enrichment_db_password",
-        "widget": {
-          "type": "password"
-        }
-      },
-      {
-        "config": "metron-env/metron_enrichment_db_port",
-        "widget": {
-          "type": "text-field"
-        }
-      },
-      {
         "config": "metron-env/es_hosts",
         "widget": {
           "type": "text-field"

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/packaging/docker/rpm-docker/SPECS/metron.spec
----------------------------------------------------------------------
diff --git a/metron-deployment/packaging/docker/rpm-docker/SPECS/metron.spec b/metron-deployment/packaging/docker/rpm-docker/SPECS/metron.spec
index 0d56d7a..8a6607b 100644
--- a/metron-deployment/packaging/docker/rpm-docker/SPECS/metron.spec
+++ b/metron-deployment/packaging/docker/rpm-docker/SPECS/metron.spec
@@ -177,6 +177,7 @@ This package installs the Metron Parser files
 %dir %{metron_home}/bin
 %dir %{metron_home}/lib
 %{metron_home}/bin/Whois_CSV_to_JSON.py
+%{metron_home}/bin/geo_enrichment_load.sh
 %{metron_home}/bin/flatfile_loader.sh
 %{metron_home}/bin/prune_elasticsearch_indices.sh
 %{metron_home}/bin/prune_hdfs_files.sh
@@ -224,7 +225,6 @@ This package installs the Metron Enrichment files
 %dir %{metron_home}/config
 %dir %{metron_home}/config/zookeeper
 %dir %{metron_home}/config/zookeeper/enrichments
-%dir %{metron_home}/ddl
 %dir %{metron_home}/flux
 %dir %{metron_home}/flux/enrichment
 %{metron_home}/bin/latency_summarizer.sh
@@ -235,7 +235,6 @@ This package installs the Metron Enrichment files
 %{metron_home}/config/zookeeper/enrichments/websphere.json
 %{metron_home}/config/zookeeper/enrichments/yaf.json
 %{metron_home}/config/zookeeper/enrichments/asa.json
-%{metron_home}/ddl/geoip_ddl.sql
 %{metron_home}/flux/enrichment/remote.yaml
 %exclude %{metron_home}/flux/enrichment/test.yaml
 %attr(0644,root,root) %{metron_home}/lib/metron-enrichment-%{full_version}-uber.jar
@@ -317,6 +316,8 @@ This package installs the Metron Profiler %{metron_home}
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 %changelog
+* Thu Jan 19 2017 Justin Leet <ju...@gmail.com> - 0.3.0
+- Replace GeoIP files with new implementation
 * Thu Nov 03 2016 David Lyle <dl...@gmail.com> - 0.2.1
 - Add ASA parser/enrichment configuration files 
 * Thu Jul 21 2016 Michael Miklavcic <mi...@gmail.com> - 0.2.1

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/packer-build/metron-centos-6.7.json
----------------------------------------------------------------------
diff --git a/metron-deployment/packer-build/metron-centos-6.7.json b/metron-deployment/packer-build/metron-centos-6.7.json
index e6de665..a4cf625 100644
--- a/metron-deployment/packer-build/metron-centos-6.7.json
+++ b/metron-deployment/packer-build/metron-centos-6.7.json
@@ -89,7 +89,7 @@
       "sftp_command": "/usr/libexec/openssh/sftp-server",
       "user" : "vagrant",
       "host_alias" : "node1",
-      "groups" : ["packer","ambari_master","ambari_slave","metron_kafka_topics","metron_hbase_tables","enrichment","search","web","sensors","mysql","pcap_server","metron"]
+      "groups" : ["packer","ambari_master","ambari_slave","metron_kafka_topics","metron_hbase_tables","enrichment","search","web","sensors","pcap_server","metron"]
     },
     {
       "type": "shell",

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/playbooks/metron_install.yml
----------------------------------------------------------------------
diff --git a/metron-deployment/playbooks/metron_install.yml b/metron-deployment/playbooks/metron_install.yml
index 9f2d231..359808a 100644
--- a/metron-deployment/playbooks/metron_install.yml
+++ b/metron-deployment/playbooks/metron_install.yml
@@ -60,23 +60,6 @@
     - solr
 
 #
-# mysql
-#
-- hosts: mysql
-  become: true
-  roles:
-    - role: mysql_server
-  tags:
-    - mysql-server
-
-- hosts: ambari_slave
-  become: true
-  roles:
-    - role: mysql_client
-  tags:
-    - mysql-client
-
-#
 # parsers, enrichment, and indexing topologies
 #
 - hosts: metron_hbase_tables

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/roles/metron_streaming/defaults/main.yml
----------------------------------------------------------------------
diff --git a/metron-deployment/roles/metron_streaming/defaults/main.yml b/metron-deployment/roles/metron_streaming/defaults/main.yml
index ff9ab39..5cab9e4 100644
--- a/metron-deployment/roles/metron_streaming/defaults/main.yml
+++ b/metron-deployment/roles/metron_streaming/defaults/main.yml
@@ -64,6 +64,7 @@ metron_profiler_properties_config_path: "{{ metron_directory }}/config/profiler.
 hbase_config_path: "/etc/hbase/conf"
 hdfs_config_path: "/etc/hadoop/conf"
 pcap_hdfs_path: "/apps/metron/pcap"
+geo_hdfs_path: "/apps/metron/geo/default"
 
 threat_intel_bulk_load: True
 threat_intel_bin: "{{ metron_directory }}/bin/threatintel_bulk_load.sh"

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/roles/metron_streaming/tasks/geoip.yml
----------------------------------------------------------------------
diff --git a/metron-deployment/roles/metron_streaming/tasks/geoip.yml b/metron-deployment/roles/metron_streaming/tasks/geoip.yml
new file mode 100644
index 0000000..b26f889
--- /dev/null
+++ b/metron-deployment/roles/metron_streaming/tasks/geoip.yml
@@ -0,0 +1,22 @@
+#
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#
+---
+
+- name: Load Geo DB
+  shell: "{{ metron_directory }}/bin/geo_enrichment_load.sh -z {{ zookeeper_url }}"
+  become: yes
+  become_user: hdfs

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/roles/metron_streaming/tasks/hdfs_filesystem.yml
----------------------------------------------------------------------
diff --git a/metron-deployment/roles/metron_streaming/tasks/hdfs_filesystem.yml b/metron-deployment/roles/metron_streaming/tasks/hdfs_filesystem.yml
index 252e671..125d41d 100644
--- a/metron-deployment/roles/metron_streaming/tasks/hdfs_filesystem.yml
+++ b/metron-deployment/roles/metron_streaming/tasks/hdfs_filesystem.yml
@@ -30,12 +30,27 @@
   become: yes
   become_user: hdfs
 
+- name: Create Metron HDFS geo directory
+  command: hdfs dfs -mkdir -p {{ geo_hdfs_path }}
+  become: yes
+  become_user: hdfs
+
 - name: Assign hdfs as owner of HDFS output directory
   command: hdfs dfs -chown hdfs:hadoop {{ metron_hdfs_output_dir }}
   become: yes
   become_user: hdfs
 
+- name: Assign hdfs as owner of HDFS Geo directory
+  command: hdfs dfs -chown hdfs:hadoop {{ geo_hdfs_path }}
+  become: yes
+  become_user: hdfs
+
 - name: Assign permissions of HDFS output directory
   command: hdfs dfs -chmod 775 {{ metron_hdfs_output_dir }}
   become: yes
+  become_user: hdfs
+
+- name: Assign permissions of HDFS geo directory
+  command: hdfs dfs -chmod 775 {{ geo_hdfs_path }}
+  become: yes
   become_user: hdfs
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/roles/metron_streaming/tasks/main.yml
----------------------------------------------------------------------
diff --git a/metron-deployment/roles/metron_streaming/tasks/main.yml b/metron-deployment/roles/metron_streaming/tasks/main.yml
index 0945e3d..498b8dd 100644
--- a/metron-deployment/roles/metron_streaming/tasks/main.yml
+++ b/metron-deployment/roles/metron_streaming/tasks/main.yml
@@ -41,6 +41,9 @@
 - include: source_config.yml
   run_once: true
 
+- include: geoip.yml
+  run_once: true
+
 - include: threat_intel.yml
   run_once: true
   when: threat_intel_bulk_load == True

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/roles/metron_streaming/tasks/topologies.yml
----------------------------------------------------------------------
diff --git a/metron-deployment/roles/metron_streaming/tasks/topologies.yml b/metron-deployment/roles/metron_streaming/tasks/topologies.yml
index a09904d..827e861 100644
--- a/metron-deployment/roles/metron_streaming/tasks/topologies.yml
+++ b/metron-deployment/roles/metron_streaming/tasks/topologies.yml
@@ -15,10 +15,6 @@
 #  limitations under the License.
 #
 ---
-- name: Get Default mysql password
-  include_vars: "../roles/mysql_server/defaults/main.yml"
-  when: mysql_root_password is undefined
-  
 - name: Configure Metron Pcap Topology
   lineinfile: >
     dest={{ metron_pcap_properties_config_path }}
@@ -44,8 +40,6 @@
     - { regexp: "threat.intel.simple.hbase.cf=", line: "threat.intel.simple.hbase.cf=t" }
     - { regexp: "enrichment.simple.hbase.table=", line: "enrichment.simple.hbase.table={{ enrichment_hbase_table }}" }
     - { regexp: "enrichment.simple.hbase.cf=", line: "enrichment.simple.hbase.cf=t" }
-    - { regexp: "mysql.ip=", line: "mysql.ip={{ groups.mysql[0] }}" }
-    - { regexp: "mysql.password=", line: "mysql.password={{ mysql_root_password }}" }
 
 
 - name: Configure Metron Solr topology

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/roles/monit/defaults/main.yml
----------------------------------------------------------------------
diff --git a/metron-deployment/roles/monit/defaults/main.yml b/metron-deployment/roles/monit/defaults/main.yml
index 608be38..c1c7583 100644
--- a/metron-deployment/roles/monit/defaults/main.yml
+++ b/metron-deployment/roles/monit/defaults/main.yml
@@ -24,5 +24,4 @@ topology_stop_timeout: 120
 
 bro_pid_file: /usr/local/bro/spool/bro/.pid
 elasticsearch_pid_file: /var/run/elasticsearch/elasticsearch.pid
-mysql_pid_file: /var/run/mysqld/mysqld.pid
 snort_alert_csv_path: /var/log/snort/alert.csv

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/roles/monit/tasks/monit-definitions.yml
----------------------------------------------------------------------
diff --git a/metron-deployment/roles/monit/tasks/monit-definitions.yml b/metron-deployment/roles/monit/tasks/monit-definitions.yml
index 1d29795..b6ea821 100644
--- a/metron-deployment/roles/monit/tasks/monit-definitions.yml
+++ b/metron-deployment/roles/monit/tasks/monit-definitions.yml
@@ -32,10 +32,6 @@
   template: src=monit/kibana.monit dest={{ monit_config_home }}/kibana.monit
   when: ("web" in group_names) and (install_elasticsearch | default(True))
 
-- name: Create monit definition for mysql
-  template: src=monit/mysql.monit dest={{ monit_config_home }}/mysql.monit
-  when: ("mysql" in group_names)
-
 - name: Create monit definition for parsers
   template: src=monit/parsers.monit dest={{ monit_config_home }}/parsers.monit
   when: ("enrichment" in group_names)

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/roles/monit/templates/monit/mysql.monit
----------------------------------------------------------------------
diff --git a/metron-deployment/roles/monit/templates/monit/mysql.monit b/metron-deployment/roles/monit/templates/monit/mysql.monit
deleted file mode 100644
index 555b444..0000000
--- a/metron-deployment/roles/monit/templates/monit/mysql.monit
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-#  Licensed to the Apache Software Foundation (ASF) under one or more
-#  contributor license agreements.  See the NOTICE file distributed with
-#  this work for additional information regarding copyright ownership.
-#  The ASF licenses this file to You under the Apache License, Version 2.0
-#  (the "License"); you may not use this file except in compliance with
-#  the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-#
-check process mysql with pidfile {{ mysql_pid_file }}
-  start program = "/etc/init.d/mysqld start"
-  stop program = "/etc/init.d/mysqld stop"
-  if does not exist then restart
-  group metron

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/roles/mysql_client/tasks/main.yml
----------------------------------------------------------------------
diff --git a/metron-deployment/roles/mysql_client/tasks/main.yml b/metron-deployment/roles/mysql_client/tasks/main.yml
deleted file mode 100644
index 82d57b8..0000000
--- a/metron-deployment/roles/mysql_client/tasks/main.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-#  Licensed to the Apache Software Foundation (ASF) under one or more
-#  contributor license agreements.  See the NOTICE file distributed with
-#  this work for additional information regarding copyright ownership.
-#  The ASF licenses this file to You under the Apache License, Version 2.0
-#  (the "License"); you may not use this file except in compliance with
-#  the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-#
----
-
-- name: Get Default mysql password
-  include_vars: "../roles/mysql_server/defaults/main.yml"
-  when: mysql_root_password is undefined
-
-- name: Allow remote login to mysql
-  template:
-    src: "../roles/mysql_client/templates/db_config.sql"
-    dest: "/tmp/{{ansible_fqdn}}.sql"
-  delegate_to: "{{ groups.mysql[0] }}"
-
-- name: Import DB_Config
-  mysql_db:
-    name: "all"
-    state: "import"
-    target: "/tmp/{{ansible_fqdn}}.sql"
-  ignore_errors: True
-  delegate_to: "{{ groups.mysql[0] }}"

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/roles/mysql_client/templates/db_config.sql
----------------------------------------------------------------------
diff --git a/metron-deployment/roles/mysql_client/templates/db_config.sql b/metron-deployment/roles/mysql_client/templates/db_config.sql
deleted file mode 100644
index c407a13..0000000
--- a/metron-deployment/roles/mysql_client/templates/db_config.sql
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- */
-
-CREATE USER 'root'@'{{ ansible_fqdn }}' IDENTIFIED BY '{{ mysql_root_password }}';
-SET PASSWORD FOR 'root'@'{{ ansible_fqdn }}' = PASSWORD('{{ mysql_root_password }}');
-GRANT ALL PRIVILEGES ON *.* to 'root'@'{{ ansible_fqdn }}' WITH GRANT OPTION;
-FLUSH PRIVILEGES;

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/roles/mysql_server/defaults/main.yml
----------------------------------------------------------------------
diff --git a/metron-deployment/roles/mysql_server/defaults/main.yml b/metron-deployment/roles/mysql_server/defaults/main.yml
deleted file mode 100644
index 08a69a5..0000000
--- a/metron-deployment/roles/mysql_server/defaults/main.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-#  Licensed to the Apache Software Foundation (ASF) under one or more
-#  contributor license agreements.  See the NOTICE file distributed with
-#  this work for additional information regarding copyright ownership.
-#  The ASF licenses this file to You under the Apache License, Version 2.0
-#  (the "License"); you may not use this file except in compliance with
-#  the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-#
----
-mysql_rpm_version: mysql57-community-release-el6-7.noarch
-mysql_yum_repo_url: https://dev.mysql.com/get/{{ mysql_rpm_version }}.rpm
-mysql_root_password: P@ssw0rd
-geodata_file: http://geolite.maxmind.com/download/geoip/database/GeoLiteCity_CSV/GeoLiteCity-latest.tar.xz

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/roles/mysql_server/files/geoip_ddl.sql
----------------------------------------------------------------------
diff --git a/metron-deployment/roles/mysql_server/files/geoip_ddl.sql b/metron-deployment/roles/mysql_server/files/geoip_ddl.sql
deleted file mode 100644
index 02616c6..0000000
--- a/metron-deployment/roles/mysql_server/files/geoip_ddl.sql
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- */
-CREATE DATABASE IF NOT EXISTS GEO;
-
-USE GEO;
-
-DROP TABLE IF EXISTS `blocks`;
-CREATE TABLE  `blocks` ( `startIPNum` int(10) unsigned NOT NULL,`endIPNum` int(10) unsigned NOT NULL,`locID`
-int(10) unsigned NOT NULL, PRIMARY KEY  (`startIPNum`,`endIPNum`) )
-ENGINE=MyISAM DEFAULT CHARSET=latin1 PACK_KEYS=1 DELAY_KEY_WRITE=1;
-
-DROP TABLE IF EXISTS `location`;
-CREATE TABLE  `location` (`locID` int(10) unsigned NOT NULL,`country` char(2) default NULL,`region` char(2)
- default NULL,`city` varchar(45) default NULL,`postalCode` char(7) default NULL,`latitude` double default
-NULL,`longitude` double default NULL,`dmaCode` char(3) default NULL,`areaCode` char(3) default NULL,PRIMARY KEY
-  (`locID`),KEY `Index_Country` (`country`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED;
-
-load data infile '/var/lib/mysql-files/GeoLiteCity-Blocks.csv'  into table `blocks`  fields terminated by ',' optionally enclosed by '"'  lines terminated by '\n' ignore 2 lines;
-load data infile '/var/lib/mysql-files/GeoLiteCity-Location.csv'  into table `location`  fields terminated by ',' optionally enclosed by '"'  lines terminated by '\n' ignore 2 lines;
-
-
-DELIMITER $$
-DROP FUNCTION IF EXISTS `IPTOLOCID` $$
-CREATE FUNCTION `IPTOLOCID`( ip VARCHAR(15)) RETURNS int(10) unsigned
-  BEGIN
-    DECLARE ipn INTEGER UNSIGNED;
-    DECLARE locID_var INTEGER;
-    IF ip LIKE '192.168.%' OR ip LIKE '10.%' THEN RETURN 0;
-    END IF;
-    SET ipn = INET_ATON(ip);
-    SELECT locID INTO locID_var FROM `blocks` INNER JOIN (SELECT MAX(startIPNum) AS start FROM `blocks` WHERE startIPNum <= ipn) AS s ON (startIPNum = s.start) WHERE endIPNum >= ipn;
-    RETURN locID_var;
-  END
-$$
-DELIMITER ;

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/roles/mysql_server/handlers/main.yml
----------------------------------------------------------------------
diff --git a/metron-deployment/roles/mysql_server/handlers/main.yml b/metron-deployment/roles/mysql_server/handlers/main.yml
deleted file mode 100644
index 112c5ca..0000000
--- a/metron-deployment/roles/mysql_server/handlers/main.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-#  Licensed to the Apache Software Foundation (ASF) under one or more
-#  contributor license agreements.  See the NOTICE file distributed with
-#  this work for additional information regarding copyright ownership.
-#  The ASF licenses this file to You under the Apache License, Version 2.0
-#  (the "License"); you may not use this file except in compliance with
-#  the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-#
----
-- name: restart elasticsearch
-  service: name=elasticsearch state=restarted

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/roles/mysql_server/meta/main.yml
----------------------------------------------------------------------
diff --git a/metron-deployment/roles/mysql_server/meta/main.yml b/metron-deployment/roles/mysql_server/meta/main.yml
deleted file mode 100644
index 6f97a14..0000000
--- a/metron-deployment/roles/mysql_server/meta/main.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-#  Licensed to the Apache Software Foundation (ASF) under one or more
-#  contributor license agreements.  See the NOTICE file distributed with
-#  this work for additional information regarding copyright ownership.
-#  The ASF licenses this file to You under the Apache License, Version 2.0
-#  (the "License"); you may not use this file except in compliance with
-#  the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-#
----
-dependencies:
-  - python-pip
-  - libselinux-python
-

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/roles/mysql_server/tasks/geoip.yml
----------------------------------------------------------------------
diff --git a/metron-deployment/roles/mysql_server/tasks/geoip.yml b/metron-deployment/roles/mysql_server/tasks/geoip.yml
deleted file mode 100644
index 407042e..0000000
--- a/metron-deployment/roles/mysql_server/tasks/geoip.yml
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-#  Licensed to the Apache Software Foundation (ASF) under one or more
-#  contributor license agreements.  See the NOTICE file distributed with
-#  this work for additional information regarding copyright ownership.
-#  The ASF licenses this file to You under the Apache License, Version 2.0
-#  (the "License"); you may not use this file except in compliance with
-#  the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-#
----
-- name: Download GeoIP databases from specified URL
-  unarchive:
-    src: "{{ geodata_file }}"
-    dest: /tmp/geoip
-    copy: no
-    creates: /tmp/geoip/*/GeoLiteCity-Blocks.csv
-
-- name: Copy to MySQL import directory
-  shell: "cp /tmp/geoip/*/*.csv /var/lib/mysql-files/"
-
-- name: Copy DDL
-  copy:
-    src: geoip_ddl.sql
-    dest: /tmp/geoip_ddl.sql
-
-- name: Import GeoIP DDL
-  mysql_db:
-    name: all
-    state: import
-    target: /tmp/geoip_ddl.sql



[2/3] incubator-metron git commit: METRON-283 Migrate Geo Enrichment outside of MySQL (justinleet) closes apache/incubator-metron#421

Posted by le...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/roles/mysql_server/tasks/main.yml
----------------------------------------------------------------------
diff --git a/metron-deployment/roles/mysql_server/tasks/main.yml b/metron-deployment/roles/mysql_server/tasks/main.yml
deleted file mode 100644
index 159e5a6..0000000
--- a/metron-deployment/roles/mysql_server/tasks/main.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-#  Licensed to the Apache Software Foundation (ASF) under one or more
-#  contributor license agreements.  See the NOTICE file distributed with
-#  this work for additional information regarding copyright ownership.
-#  The ASF licenses this file to You under the Apache License, Version 2.0
-#  (the "License"); you may not use this file except in compliance with
-#  the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-#
----
-- include: mysql.yml
-- include: mysql-password.yml
-- include: geoip.yml

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/roles/mysql_server/tasks/mysql-password.yml
----------------------------------------------------------------------
diff --git a/metron-deployment/roles/mysql_server/tasks/mysql-password.yml b/metron-deployment/roles/mysql_server/tasks/mysql-password.yml
deleted file mode 100644
index a4f0d0b..0000000
--- a/metron-deployment/roles/mysql_server/tasks/mysql-password.yml
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-#  Licensed to the Apache Software Foundation (ASF) under one or more
-#  contributor license agreements.  See the NOTICE file distributed with
-#  this work for additional information regarding copyright ownership.
-#  The ASF licenses this file to You under the Apache License, Version 2.0
-#  (the "License"); you may not use this file except in compliance with
-#  the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-#
----
-- name: Retrieve temporary root password
-  shell: "grep 'temporary password' /var/log/mysqld.log | sed 's/.*root@localhost: //'"
-  args:
-    creates: ~/.my.cnf
-  register: temp_root_password
-
-- name: Update mysql root password
-  command: "mysqladmin --user=root --password='{{ temp_root_password.stdout }}' password '{{ mysql_root_password }}'"
-  ignore_errors: yes
-  args:
-    creates: ~/.my.cnf
-
-- name: Create .my.cnf
-  template:
-    src: "../roles/mysql_server/templates/.my.cnf"
-    dest: ~/.my.cnf

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/roles/mysql_server/tasks/mysql.yml
----------------------------------------------------------------------
diff --git a/metron-deployment/roles/mysql_server/tasks/mysql.yml b/metron-deployment/roles/mysql_server/tasks/mysql.yml
deleted file mode 100644
index e48ad5c..0000000
--- a/metron-deployment/roles/mysql_server/tasks/mysql.yml
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-#  Licensed to the Apache Software Foundation (ASF) under one or more
-#  contributor license agreements.  See the NOTICE file distributed with
-#  this work for additional information regarding copyright ownership.
-#  The ASF licenses this file to You under the Apache License, Version 2.0
-#  (the "License"); you may not use this file except in compliance with
-#  the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-#
----
-- name: Create temporary directories
-  file:
-    path: "/tmp/geoip"
-    state: directory
-    mode: 0755
-
-- name: Install Mysql Community Release Repo Def
-  get_url:
-    dest: /tmp/{{ mysql_rpm_version }}.rpm
-    url: "{{ mysql_yum_repo_url }}"
-
-- name: Install Mysql Community Release Repo
-  yum:
-    pkg: /tmp/{{ mysql_rpm_version }}.rpm
-    state: installed
-  register: result
-  until: result.rc == 0
-  retries: 5
-  delay: 10
-
-- name: Install MySQL
-  yum:
-    name: "{{ item }}"
-    state: latest
-  with_items:
-    - "mysql-community-server"
-    - "MySQL-python"
-  register: result
-  until: result.rc == 0
-  retries: 5
-  delay: 10
-
-#
-# mysql must be running for the 'mysql_client' role to function properly.  that
-# role grants access to mysql clients connecting from external hosts (think
-# storm topologies doing geoip enrichment).
-#
-# ideally the logic in 'mysql_client' would be moved to 'mysql_server' so that
-# mysql could be started, access granted, and then shutdown after this is
-# complete.
-#
-- name: Start MySQL
-  service: name=mysqld state=started

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/roles/mysql_server/templates/.my.cnf
----------------------------------------------------------------------
diff --git a/metron-deployment/roles/mysql_server/templates/.my.cnf b/metron-deployment/roles/mysql_server/templates/.my.cnf
deleted file mode 100644
index d5c0825..0000000
--- a/metron-deployment/roles/mysql_server/templates/.my.cnf
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-#  Licensed to the Apache Software Foundation (ASF) under one or more
-#  contributor license agreements.  See the NOTICE file distributed with
-#  this work for additional information regarding copyright ownership.
-#  The ASF licenses this file to You under the Apache License, Version 2.0
-#  (the "License"); you may not use this file except in compliance with
-#  the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-#
-[client]
-user=root
-password={{ mysql_root_password }}
-host=localhost
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-deployment/roles/snort/files/snort.conf
----------------------------------------------------------------------
diff --git a/metron-deployment/roles/snort/files/snort.conf b/metron-deployment/roles/snort/files/snort.conf
index 141b23b..a6edb09 100644
--- a/metron-deployment/roles/snort/files/snort.conf
+++ b/metron-deployment/roles/snort/files/snort.conf
@@ -632,7 +632,6 @@ include $RULE_PATH/community.rules
 # include $RULE_PATH/server-iis.rules
 # include $RULE_PATH/server-mail.rules
 # include $RULE_PATH/server-mssql.rules
-# include $RULE_PATH/server-mysql.rules
 # include $RULE_PATH/server-oracle.rules
 # include $RULE_PATH/server-other.rules
 # include $RULE_PATH/server-samba.rules
@@ -701,7 +700,6 @@ include $RULE_PATH/community.rules
 # include $SO_RULE_PATH/server-apache.rules
 # include $SO_RULE_PATH/server-iis.rules
 # include $SO_RULE_PATH/server-mail.rules
-# include $SO_RULE_PATH/server-mysql.rules
 # include $SO_RULE_PATH/server-oracle.rules
 # include $SO_RULE_PATH/server-other.rules
 # include $SO_RULE_PATH/server-webapp.rules

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-docker/.gitignore
----------------------------------------------------------------------
diff --git a/metron-docker/.gitignore b/metron-docker/.gitignore
index 01cfaca..6444af5 100644
--- a/metron-docker/.gitignore
+++ b/metron-docker/.gitignore
@@ -2,7 +2,6 @@
 /compose/kafkazk/common
 /compose/kafkazk/parser
 /compose/kafkazk/enrichment
-/compose/mysql/enrichment
 /compose/hbase/data-management
 /compose/storm/elasticsearch
 /compose/storm/enrichment

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-docker/README.md
----------------------------------------------------------------------
diff --git a/metron-docker/README.md b/metron-docker/README.md
index 6026124..25f8f82 100644
--- a/metron-docker/README.md
+++ b/metron-docker/README.md
@@ -11,7 +11,6 @@ Metron Docker includes these images that have been customized for Metron:
   - Kafka (with Zookeeper)
   - HBase
   - Storm (with all topologies deployed)
-  - MySQL
   - Elasticsearch
   - Kibana
 
@@ -65,7 +64,6 @@ metron_storm_1           Up 5 minutes
 metron_hbase_1           Up 5 minutes
 metron_kibana_1          Up 5 minutes
 metron_kafkazk_1         Up 5 minutes
-metron_mysql_1           Up 5 minutes
 metron_elasticsearch_1   Up 5 minutes
 ```
 

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-docker/compose/docker-compose.yml
----------------------------------------------------------------------
diff --git a/metron-docker/compose/docker-compose.yml b/metron-docker/compose/docker-compose.yml
index d60a5dd..8ec5573 100644
--- a/metron-docker/compose/docker-compose.yml
+++ b/metron-docker/compose/docker-compose.yml
@@ -16,15 +16,6 @@
 #
 version: '2'
 services:
-  mysql:
-    build:
-      context: ./mysql
-      args:
-        METRON_VERSION: $METRON_VERSION
-    ports:
-      - "3306:3306"
-    environment:
-      MYSQL_ROOT_PASSWORD: root
   kafkazk:
     build:
       context: ./kafkazk
@@ -61,7 +52,6 @@ services:
     volumes_from:
       - hbase
     depends_on:
-      - mysql
       - kafkazk
       - hbase
       - elasticsearch

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-docker/compose/mysql/Dockerfile
----------------------------------------------------------------------
diff --git a/metron-docker/compose/mysql/Dockerfile b/metron-docker/compose/mysql/Dockerfile
deleted file mode 100644
index 4634998..0000000
--- a/metron-docker/compose/mysql/Dockerfile
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-#  Licensed to the Apache Software Foundation (ASF) under one or more
-#  contributor license agreements.  See the NOTICE file distributed with
-#  this work for additional information regarding copyright ownership.
-#  The ASF licenses this file to You under the Apache License, Version 2.0
-#  (the "License"); you may not use this file except in compliance with
-#  the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-#
-FROM mysql:5.7
-
-ARG METRON_VERSION
-
-ENV METRON_VERSION $METRON_VERSION
-ENV METRON_HOME /usr/metron/$METRON_VERSION/
-
-ADD http://geolite.maxmind.com/download/geoip/database/GeoLiteCity_CSV/GeoLiteCity-latest.tar.xz /tmp/geoip/GeoLiteCity-latest.tar.xz
-ADD ./bin /usr/local/bin
-RUN chmod 755 /usr/local/bin/wait-for-it.sh
-ADD ./enrichment /enrichment
-
-RUN apt-get update
-RUN apt-get install xz-utils
-RUN tar xf /tmp/geoip/GeoLiteCity-latest.tar.xz -C /tmp/geoip/
-RUN cp /tmp/geoip/GeoLiteCity_*/* /var/lib/mysql-files
-RUN mkdir -p $METRON_HOME
-RUN tar -xzf /enrichment/metron-enrichment-$METRON_VERSION-archive.tar.gz -C /usr/metron/$METRON_VERSION/
-
-WORKDIR /usr/local
-CMD ./bin/start.sh

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-docker/compose/mysql/bin/init-mysql.sh
----------------------------------------------------------------------
diff --git a/metron-docker/compose/mysql/bin/init-mysql.sh b/metron-docker/compose/mysql/bin/init-mysql.sh
deleted file mode 100755
index 40f085c..0000000
--- a/metron-docker/compose/mysql/bin/init-mysql.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-#
-#  Licensed to the Apache Software Foundation (ASF) under one or more
-#  contributor license agreements.  See the NOTICE file distributed with
-#  this work for additional information regarding copyright ownership.
-#  The ASF licenses this file to You under the Apache License, Version 2.0
-#  (the "License"); you may not use this file except in compliance with
-#  the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-#
-mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS metronrest"
-mysql -uroot -proot < /usr/metron/$METRON_VERSION/ddl/geoip_ddl.sql

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-docker/compose/mysql/bin/start.sh
----------------------------------------------------------------------
diff --git a/metron-docker/compose/mysql/bin/start.sh b/metron-docker/compose/mysql/bin/start.sh
deleted file mode 100755
index e007ed0..0000000
--- a/metron-docker/compose/mysql/bin/start.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-#
-#  Licensed to the Apache Software Foundation (ASF) under one or more
-#  contributor license agreements.  See the NOTICE file distributed with
-#  this work for additional information regarding copyright ownership.
-#  The ASF licenses this file to You under the Apache License, Version 2.0
-#  (the "License"); you may not use this file except in compliance with
-#  the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-#
-./bin/docker-entrypoint.sh mysqld &
-./bin/wait-for-it.sh localhost:3306
-./bin/init-mysql.sh
-tail -f /dev/null

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-docker/compose/storm/Dockerfile
----------------------------------------------------------------------
diff --git a/metron-docker/compose/storm/Dockerfile b/metron-docker/compose/storm/Dockerfile
index 75191db..4d80479 100644
--- a/metron-docker/compose/storm/Dockerfile
+++ b/metron-docker/compose/storm/Dockerfile
@@ -20,6 +20,7 @@ ARG METRON_VERSION
 
 ENV METRON_VERSION $METRON_VERSION
 ENV METRON_HOME /usr/metron/$METRON_VERSION/
+ENV GEO_DIR /apps/metron/geo/default/
 
 ADD ./bin $METRON_HOME/bin
 ADD ./parser /parser
@@ -27,13 +28,12 @@ ADD ./enrichment /enrichment
 ADD ./indexing /indexing
 ADD ./elasticsearch /elasticsearch
 RUN mkdir -p $METRON_HOME
+RUN mkdir -p $GEO_DIR
 RUN tar -xzf /parser/metron-parsers-$METRON_VERSION-archive.tar.gz -C /usr/metron/$METRON_VERSION/
 
 RUN tar -xzf /enrichment/metron-enrichment-$METRON_VERSION-archive.tar.gz -C /usr/metron/$METRON_VERSION/
 RUN sed -i -e "s/kafka.zk=.*:/kafka.zk=kafkazk:/g" /usr/metron/$METRON_VERSION/config/enrichment.properties
 RUN sed -i -e "s/kafka.broker=.*/kafka.broker=kafkazk:9092/g" /usr/metron/$METRON_VERSION/config/enrichment.properties
-RUN sed -i -e "s/mysql.ip=.*/mysql.ip=mysql/g" /usr/metron/$METRON_VERSION/config/enrichment.properties
-RUN sed -i -e "s/mysql.password=.*/mysql.password=root/g" /usr/metron/$METRON_VERSION/config/enrichment.properties
 RUN sed -i -e "s/threat.intel.tracker.table=.*/threat.intel.tracker.table=access_tracker/g" /usr/metron/$METRON_VERSION/config/enrichment.properties
 RUN sed -i -e "s/threat.intel.tracker.cf=.*/threat.intel.tracker.cf=cf/g" /usr/metron/$METRON_VERSION/config/enrichment.properties
 RUN sed -i -e "s/threat.intel.ip.table=.*/threat.intel.ip.table=ip/g" /usr/metron/$METRON_VERSION/config/enrichment.properties
@@ -55,3 +55,4 @@ EXPOSE 8080 8000
 EXPOSE 8081 8081
 
 WORKDIR $METRON_HOME
+RUN cd $GEO_DIR && wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-docker/install-metron.sh
----------------------------------------------------------------------
diff --git a/metron-docker/install-metron.sh b/metron-docker/install-metron.sh
index 7aa7e7a..adc95a0 100755
--- a/metron-docker/install-metron.sh
+++ b/metron-docker/install-metron.sh
@@ -21,14 +21,11 @@ METRON_PLATFORM_ROOT=$METRON_DOCKER_ROOT/../metron-platform
 if [ $# -gt 0 ] && [ $1 == "-b" ]
     then cd $METRON_PLATFORM_ROOT && mvn clean package -DskipTests
 fi
-mkdir -p $METRON_DOCKER_ROOT/mysql/enrichment/
 mkdir -p $METRON_DOCKER_ROOT/hbase/data-management
 mkdir -p $METRON_DOCKER_ROOT/storm/parser/
 mkdir -p $METRON_DOCKER_ROOT/storm/enrichment/
 mkdir -p $METRON_DOCKER_ROOT/storm/indexing/
 mkdir -p $METRON_DOCKER_ROOT/storm/elasticsearch/
-echo Installing MySQL dependencies
-cp $METRON_PLATFORM_ROOT/metron-enrichment/target/metron-enrichment-$METRON_VERSION-archive.tar.gz $METRON_DOCKER_ROOT/mysql/enrichment/
 echo Installing HBase dependencies
 cp $METRON_PLATFORM_ROOT/metron-data-management/target/metron-data-management-$METRON_VERSION-archive.tar.gz $METRON_DOCKER_ROOT/hbase/data-management
 echo Installing Storm dependencies

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-docker/pom.xml
----------------------------------------------------------------------
diff --git a/metron-docker/pom.xml b/metron-docker/pom.xml
index 4c30035..5709ba1 100644
--- a/metron-docker/pom.xml
+++ b/metron-docker/pom.xml
@@ -107,24 +107,6 @@
                         </configuration>
                     </execution>
                     <execution>
-                        <id>copy-enrichment-to-mysql</id>
-                        <phase>prepare-package</phase>
-                        <goals>
-                            <goal>copy-resources</goal>
-                        </goals>
-                        <configuration>
-                            <outputDirectory>${project.basedir}/compose/mysql/enrichment</outputDirectory>
-                            <resources>
-                                <resource>
-                                    <directory>../metron-platform/metron-enrichment/target/</directory>
-                                    <includes>
-                                        <include>*.tar.gz</include>
-                                    </includes>
-                                </resource>
-                            </resources>
-                        </configuration>
-                    </execution>
-                    <execution>
                         <id>copy-parsers-to-storm</id>
                         <phase>prepare-package</phase>
                         <goals>
@@ -251,24 +233,6 @@
                             </resources>
                         </configuration>
                     </execution>
-                    <execution>
-                        <id>copy-wait-for-it-to-mysql</id>
-                        <phase>prepare-package</phase>
-                        <goals>
-                            <goal>copy-resources</goal>
-                        </goals>
-                        <configuration>
-                            <outputDirectory>${project.basedir}/compose/mysql/bin</outputDirectory>
-                            <resources>
-                                <resource>
-                                    <directory>./scripts</directory>
-                                    <includes>
-                                        <include>wait-for-it.sh</include>
-                                    </includes>
-                                </resource>
-                            </resources>
-                        </configuration>
-                    </execution>
                 </executions>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-common/README.md
----------------------------------------------------------------------
diff --git a/metron-platform/metron-common/README.md b/metron-platform/metron-common/README.md
index 21e82fb..56932f3 100644
--- a/metron-platform/metron-common/README.md
+++ b/metron-platform/metron-common/README.md
@@ -96,6 +96,7 @@ The `!=` operator is the negation of the above.
 | [ `ENRICHMENT_GET`](#enrichment_get)                                                               |
 | [ `FILL_LEFT`](#fill_left)                                                                         |
 | [ `FILL_RIGHT`](#fill_right)                                                                       |
+| [ `GEO_GET`](#geo_get)                                                                          |
 | [ `GET`](#get)                                                                                     |
 | [ `GET_FIRST`](#get_first)                                                                         |
 | [ `GET_LAST`](#get_last)                                                                           |
@@ -249,6 +250,13 @@ The `!=` operator is the negation of the above.
     * column_family - The Column Family to use
   * Returns: A Map associated with the indicator and enrichment type.  Empty otherwise.
 
+### `GEO_GET`
+  * Description: Look up an IPV4 address and returns geographic information about it
+  * Input:
+    * ip - The IPV4 address to lookup
+    * fields - Optional list of GeoIP fields to grab. Options are locID, country, city postalCode, dmaCode, latitude, longitude, location_point
+  * Returns: If a Single field is requested a string of the field, If multiple fields a map of string of the fields, and null otherwise
+
 ### `GET`
   * Description: Returns the i'th element of the list 
   * Input:

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-common/src/main/java/org/apache/metron/common/bolt/ConfiguredParserBolt.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-common/src/main/java/org/apache/metron/common/bolt/ConfiguredParserBolt.java b/metron-platform/metron-common/src/main/java/org/apache/metron/common/bolt/ConfiguredParserBolt.java
index cd379e7..15d573f 100644
--- a/metron-platform/metron-common/src/main/java/org/apache/metron/common/bolt/ConfiguredParserBolt.java
+++ b/metron-platform/metron-common/src/main/java/org/apache/metron/common/bolt/ConfiguredParserBolt.java
@@ -28,7 +28,7 @@ import java.io.IOException;
 
 public abstract class ConfiguredParserBolt extends ConfiguredBolt<ParserConfigurations> {
 
-  private static final Logger LOG = Logger.getLogger(ConfiguredEnrichmentBolt.class);
+  private static final Logger LOG = Logger.getLogger(ConfiguredParserBolt.class);
 
 
   protected final ParserConfigurations configurations = new ParserConfigurations();

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-common/src/main/java/org/apache/metron/common/configuration/Configurations.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-common/src/main/java/org/apache/metron/common/configuration/Configurations.java b/metron-platform/metron-common/src/main/java/org/apache/metron/common/configuration/Configurations.java
index 8c39fab..f97e88b 100644
--- a/metron-platform/metron-common/src/main/java/org/apache/metron/common/configuration/Configurations.java
+++ b/metron-platform/metron-common/src/main/java/org/apache/metron/common/configuration/Configurations.java
@@ -27,6 +27,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.Serializable;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
@@ -40,7 +41,7 @@ public class Configurations implements Serializable {
 
   @SuppressWarnings("unchecked")
   public Map<String, Object> getGlobalConfig() {
-    return (Map<String, Object>) configurations.get(ConfigurationType.GLOBAL.getName());
+    return (Map<String, Object>) configurations.getOrDefault(ConfigurationType.GLOBAL.getName(), new HashMap());
   }
 
   public List<FieldValidator> getFieldValidations() {

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-common/src/main/java/org/apache/metron/common/dsl/Context.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-common/src/main/java/org/apache/metron/common/dsl/Context.java b/metron-platform/metron-common/src/main/java/org/apache/metron/common/dsl/Context.java
index 6195ec2..51a3f8f 100644
--- a/metron-platform/metron-common/src/main/java/org/apache/metron/common/dsl/Context.java
+++ b/metron-platform/metron-common/src/main/java/org/apache/metron/common/dsl/Context.java
@@ -34,7 +34,8 @@ public class Context implements Serializable {
     , GLOBAL_CONFIG
     , ZOOKEEPER_CLIENT
     , SERVICE_DISCOVERER
-    , STELLAR_CONFIG;
+    , STELLAR_CONFIG
+    , GEO_IP
   }
 
   public static class Builder {
@@ -98,8 +99,8 @@ public class Context implements Serializable {
     if(c == null && errorIfNotThere) {
       throw new IllegalStateException("Unable to find capability " + capability + "; it may not be available in your context.");
     }
-    else if(c == null && !errorIfNotThere) {
-      return Optional.ofNullable(null);
+    else if(c == null) {
+      return Optional.empty();
     }
     return Optional.ofNullable(c.get());
   }

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-data-management/README.md
----------------------------------------------------------------------
diff --git a/metron-platform/metron-data-management/README.md b/metron-platform/metron-data-management/README.md
index a123cc3..a0c0164 100644
--- a/metron-platform/metron-data-management/README.md
+++ b/metron-platform/metron-data-management/README.md
@@ -250,3 +250,18 @@ The parameters for the utility are as follows:
 | -l         | --log4j             | No           | The log4j properties file to load                                                                                                                                                    |
 | -n         | --enrichment_config | No           | The JSON document describing the enrichments to configure.  Unlike other loaders, this is run first if specified.                                                                    |
 
+### GeoLite2 Loader
+
+The shell script `$METRON_HOME/bin/geo_enrichment_load.sh` will retrieve MaxMind GeoLite2 data and load data into HDFS, and update the configuration.
+
+THIS SCRIPT WILL NOT UPDATE AMBARI'S GLOBAL.JSON, JUST THE ZK CONFIGS.  CHANGES WILL GO INTO EFFECT, BUT WILL NOT PERSIST PAST AN AMBARI RESTART UNTIL UPDATED THERE.
+
+The parameters for the utility are as follows:
+
+| Short Code | Long Code           | Is Required? | Description                                                                                                                                                                          |
+|------------|---------------------|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| -h         |                     | No           | Generate the help screen/set of options                                                                                                                                              |
+| -g         | --geo_url           | No           | GeoIP URL - defaults to http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz
+| -r         | --remote_dir        | No           | HDFS directory to land formatted GeoIP file - defaults to /apps/metron/geo/<epoch millis>/
+| -t         | --tmp_dir           | No           | Directory for landing the temporary GeoIP data - defaults to /tmp
+| -z         | --zk_quorum         | Yes          | Zookeeper Quorum URL (zk1:port,zk2:port,...)

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-data-management/pom.xml
----------------------------------------------------------------------
diff --git a/metron-platform/metron-data-management/pom.xml b/metron-platform/metron-data-management/pom.xml
index 3b85e61..be7fe33 100644
--- a/metron-platform/metron-data-management/pom.xml
+++ b/metron-platform/metron-data-management/pom.xml
@@ -395,7 +395,7 @@
                                     <shadedPattern>org.apache.metron.httpcore.dataload</shadedPattern>
                                 </relocation>
                              </relocations>
-                             <transformers> 
+                             <transformers>
                                 <transformer
                                   implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
                                      <resources>

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-data-management/src/main/java/org/apache/metron/dataloads/nonbulk/geo/GeoEnrichmentLoader.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-data-management/src/main/java/org/apache/metron/dataloads/nonbulk/geo/GeoEnrichmentLoader.java b/metron-platform/metron-data-management/src/main/java/org/apache/metron/dataloads/nonbulk/geo/GeoEnrichmentLoader.java
new file mode 100644
index 0000000..322edec
--- /dev/null
+++ b/metron-platform/metron-data-management/src/main/java/org/apache/metron/dataloads/nonbulk/geo/GeoEnrichmentLoader.java
@@ -0,0 +1,233 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.metron.dataloads.nonbulk.geo;
+
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.google.common.base.Function;
+import com.google.common.base.Joiner;
+import org.apache.commons.cli.*;
+import org.apache.commons.io.FileUtils;
+import org.apache.curator.framework.CuratorFramework;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.util.GenericOptionsParser;
+import org.apache.metron.common.configuration.ConfigurationsUtils;
+import org.apache.metron.common.utils.JSONUtils;
+import org.apache.metron.enrichment.adapters.geo.GeoLiteDatabase;
+
+import javax.annotation.Nullable;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.time.LocalDateTime;
+import java.time.ZoneOffset;
+import java.util.Map;
+
+public class GeoEnrichmentLoader {
+  private static abstract class OptionHandler implements Function<String, Option> {
+  }
+
+  public enum GeoEnrichmentOptions {
+    HELP("h", new GeoEnrichmentLoader.OptionHandler() {
+      @Nullable
+      @Override
+      public Option apply(@Nullable String s) {
+        return new Option(s, "help", false, "Generate Help screen");
+      }
+    }), GEO_URL("g", new GeoEnrichmentLoader.OptionHandler() {
+      @Nullable
+      @Override
+      public Option apply(@Nullable String s) {
+        Option o = new Option(s, "geo_url", true, "GeoIP URL - defaults to http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz");
+        o.setArgName("GEO_URL");
+        o.setRequired(false);
+        return o;
+      }
+    }), REMOTE_DIR("r", new GeoEnrichmentLoader.OptionHandler() {
+      @Nullable
+      @Override
+      public Option apply(@Nullable String s) {
+        Option o = new Option(s, "remote_dir", true, "HDFS directory to land formatted GeoIP file - defaults to /apps/metron/geo/<epoch millis>/");
+        o.setArgName("REMOTE_DIR");
+        o.setRequired(false);
+        return o;
+      }
+    }), TMP_DIR("t", new GeoEnrichmentLoader.OptionHandler() {
+      @Nullable
+      @Override
+      public Option apply(@Nullable String s) {
+        Option o = new Option(s, "tmp_dir", true, "Directory for landing the temporary GeoIP data - defaults to /tmp");
+        o.setArgName("TMP_DIR");
+        o.setRequired(false);
+        return o;
+      }
+    }), ZK_QUORUM("z", new GeoEnrichmentLoader.OptionHandler() {
+      @Nullable
+      @Override
+      public Option apply(@Nullable String s) {
+        Option o = new Option(s, "zk_quorum", true, "Zookeeper Quorum URL (zk1:port,zk2:port,...)");
+        o.setArgName("ZK_QUORUM");
+        o.setRequired(true);
+        return o;
+      }
+    });
+    Option option;
+    String shortCode;
+
+    GeoEnrichmentOptions(String shortCode, GeoEnrichmentLoader.OptionHandler optionHandler) {
+      this.shortCode = shortCode;
+      this.option = optionHandler.apply(shortCode);
+    }
+
+    public boolean has(CommandLine cli) {
+      return cli.hasOption(shortCode);
+    }
+
+    public String get(CommandLine cli) {
+      return cli.getOptionValue(shortCode);
+    }
+
+    public String get(CommandLine cli, String defaultValue) {
+      return cli.getOptionValue(shortCode, defaultValue);
+    }
+
+    public static CommandLine parse(CommandLineParser parser, String[] args) {
+      try {
+        CommandLine cli = parser.parse(getOptions(), args);
+
+        if (GeoEnrichmentLoader.GeoEnrichmentOptions.HELP.has(cli)) {
+          printHelp();
+          System.exit(0);
+        }
+        return cli;
+      } catch (ParseException e) {
+        System.err.println("Unable to parse args: " + Joiner.on(' ').join(args));
+        e.printStackTrace(System.err);
+        printHelp();
+        System.exit(-1);
+        return null;
+      }
+    }
+
+    public static void printHelp() {
+      HelpFormatter formatter = new HelpFormatter();
+      formatter.printHelp("GeoEnrichmentLoader", getOptions());
+    }
+
+    public static Options getOptions() {
+      Options ret = new Options();
+      for (GeoEnrichmentLoader.GeoEnrichmentOptions o : GeoEnrichmentLoader.GeoEnrichmentOptions.values()) {
+        ret.addOption(o.option);
+      }
+      return ret;
+    }
+  }
+
+  protected void loadGeoIpDatabase(CommandLine cli) throws IOException {
+    // Retrieve the database file
+    System.out.println("Retrieving GeoLite2 archive");
+    String url = GeoEnrichmentOptions.GEO_URL.get(cli, "http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz");
+    String tmpDir = GeoEnrichmentOptions.TMP_DIR.get(cli, "/tmp") + "/"; // Make sure there's a file separator at the end
+    File localGeoFile = downloadGeoFile(url, tmpDir);
+    // Want to delete the tar in event of failure
+    localGeoFile.deleteOnExit();
+    System.out.println("GeoIP files downloaded successfully");
+
+    // Push the file to HDFS and update Configs to ensure clients get new view
+    String zookeeper = GeoEnrichmentOptions.ZK_QUORUM.get(cli);
+    long millis = LocalDateTime.now().toInstant(ZoneOffset.UTC).toEpochMilli();
+    String hdfsLoc = GeoEnrichmentOptions.REMOTE_DIR.get(cli, "/apps/metron/geo/" + millis);
+    System.out.println("Putting GeoLite2 file into HDFS at: " + hdfsLoc);
+
+    // Put into HDFS
+    Path srcPath = new Path(localGeoFile.getAbsolutePath());
+    Path dstPath = new Path(hdfsLoc);
+    putDbFile(srcPath, dstPath);
+    pushConfig(srcPath, dstPath, zookeeper);
+
+    System.out.println("GeoLite2 file placement complete");
+    System.out.println("Successfully created and updated new GeoIP information");
+  }
+
+  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;
+  }
+
+  protected void pushConfig(Path srcPath, Path dstPath, String zookeeper) {
+    System.out.println("Beginning update of global configs");
+    try (CuratorFramework client = ConfigurationsUtils.getClient(zookeeper)) {
+      client.start();
+      // Use the parent and place a new file.  Has to be a new file so we can update the configs and trigger updates.
+      // Fetch the global configuration
+      Map<String, Object> global = JSONUtils.INSTANCE.load(
+              new ByteArrayInputStream(ConfigurationsUtils.readGlobalConfigBytesFromZookeeper(client)),
+              new TypeReference<Map<String, Object>>() {
+              });
+
+      // Update the global config and push it back
+      global.put(GeoLiteDatabase.GEO_HDFS_FILE, dstPath.toString() + "/" + srcPath.getName());
+      ConfigurationsUtils.writeGlobalConfigToZookeeper(global, client);
+    } catch (Exception e) {
+      System.err.println("Unable to load new GeoIP info into HDFS: " + e);
+      e.printStackTrace();
+      System.exit(2);
+    }
+    System.out.println("Finished update of global configs");
+  }
+
+  protected void putDbFile(Path src, Path dst) throws IOException {
+    Configuration conf = new Configuration();
+    FileSystem fileSystem = FileSystem.get(conf);
+    System.out.println("Putting: " + src + " onto HDFS at: " + dst);
+    fileSystem.mkdirs(dst);
+    fileSystem.copyFromLocalFile(true, true, src, dst);
+    System.out.println("Done putting GeoLite file into HDFS");
+  }
+
+  public static void main(String... argv) throws IOException {
+    String[] otherArgs = new GenericOptionsParser(argv).getRemainingArgs();
+    CommandLine cli = GeoEnrichmentOptions.parse(new PosixParser(), otherArgs);
+
+    GeoEnrichmentLoader loader = new GeoEnrichmentLoader();
+    loader.loadGeoIpDatabase(cli);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-data-management/src/main/scripts/geo_enrichment_load.sh
----------------------------------------------------------------------
diff --git a/metron-platform/metron-data-management/src/main/scripts/geo_enrichment_load.sh b/metron-platform/metron-data-management/src/main/scripts/geo_enrichment_load.sh
new file mode 100644
index 0000000..3b6ab37
--- /dev/null
+++ b/metron-platform/metron-data-management/src/main/scripts/geo_enrichment_load.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+BIGTOP_DEFAULTS_DIR=${BIGTOP_DEFAULTS_DIR-/etc/default}
+[ -n "${BIGTOP_DEFAULTS_DIR}" -a -r ${BIGTOP_DEFAULTS_DIR}/hbase ] && . ${BIGTOP_DEFAULTS_DIR}/hbase
+
+# Autodetect JAVA_HOME if not defined
+if [ -e /usr/libexec/bigtop-detect-javahome ]; then
+  . /usr/libexec/bigtop-detect-javahome
+elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
+  . /usr/lib/bigtop-utils/bigtop-detect-javahome
+fi
+
+export HBASE_HOME=${HBASE_HOME:-/usr/hdp/current/hbase-client}
+HADOOP_CLASSPATH=${HBASE_HOME}/lib/hbase-server.jar:`${HBASE_HOME}/bin/hbase classpath`
+for jar in $(echo $HADOOP_CLASSPATH | sed 's/:/ /g');do
+  if [ -f $jar ];then
+    LIBJARS="$jar,$LIBJARS"
+  fi
+done
+export HADOOP_CLASSPATH
+export METRON_VERSION=${project.version}
+export METRON_HOME=/usr/metron/$METRON_VERSION
+export DM_JAR=${project.artifactId}-$METRON_VERSION.jar
+hadoop jar $METRON_HOME/lib/$DM_JAR org.apache.metron.dataloads.nonbulk.geo.GeoEnrichmentLoader "$@"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-data-management/src/test/java/org/apache/metron/dataloads/nonbulk/geo/GeoEnrichmentLoaderTest.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-data-management/src/test/java/org/apache/metron/dataloads/nonbulk/geo/GeoEnrichmentLoaderTest.java b/metron-platform/metron-data-management/src/test/java/org/apache/metron/dataloads/nonbulk/geo/GeoEnrichmentLoaderTest.java
new file mode 100644
index 0000000..3fa0270
--- /dev/null
+++ b/metron-platform/metron-data-management/src/test/java/org/apache/metron/dataloads/nonbulk/geo/GeoEnrichmentLoaderTest.java
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.metron.dataloads.nonbulk.geo;
+
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.PosixParser;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.util.GenericOptionsParser;
+import org.junit.*;
+import org.junit.rules.TemporaryFolder;
+
+import java.io.File;
+
+import static org.junit.Assert.assertTrue;
+
+public class GeoEnrichmentLoaderTest {
+  private class MockGeoEnrichmentLoader extends GeoEnrichmentLoader {
+    @Override
+    protected void pushConfig(Path srcPath, Path dstPath, String zookeeper) {
+    }
+  }
+
+  @Rule
+  public TemporaryFolder testFolder = new TemporaryFolder();
+
+  private File remoteDir;
+  private File tmpDir;
+
+    @Before
+  public void setup() throws Exception {
+      testFolder.create();
+      remoteDir = testFolder.newFolder("remoteDir");
+      tmpDir = testFolder.newFolder("tmpDir");
+  }
+
+  @Test
+  public void testCommandLineShortOpts() throws Exception {
+    String[] argv = {"-g testGeoUrl", "-r /test/remoteDir", "-t /test/tmpDir", "-z test:2181"};
+    String[] otherArgs = new GenericOptionsParser(argv).getRemainingArgs();
+
+    CommandLine cli = GeoEnrichmentLoader.GeoEnrichmentOptions.parse(new PosixParser(), otherArgs);
+    Assert.assertEquals("testGeoUrl", GeoEnrichmentLoader.GeoEnrichmentOptions.GEO_URL.get(cli).trim());
+    Assert.assertEquals("/test/remoteDir", GeoEnrichmentLoader.GeoEnrichmentOptions.REMOTE_DIR.get(cli).trim());
+    Assert.assertEquals("/test/tmpDir", GeoEnrichmentLoader.GeoEnrichmentOptions.TMP_DIR.get(cli).trim());
+    Assert.assertEquals("test:2181", GeoEnrichmentLoader.GeoEnrichmentOptions.ZK_QUORUM.get(cli).trim());
+  }
+
+  @Test
+  public void testCommandLineLongOpts() throws Exception {
+    String[] argv = {"--geo_url", "testGeoUrl", "--remote_dir", "/test/remoteDir", "--tmp_dir", "/test/tmpDir", "--zk_quorum", "test:2181"};
+    String[] otherArgs = new GenericOptionsParser(argv).getRemainingArgs();
+
+    CommandLine cli = GeoEnrichmentLoader.GeoEnrichmentOptions.parse(new PosixParser(), otherArgs);
+    Assert.assertEquals("testGeoUrl", GeoEnrichmentLoader.GeoEnrichmentOptions.GEO_URL.get(cli).trim());
+    Assert.assertEquals("/test/remoteDir", GeoEnrichmentLoader.GeoEnrichmentOptions.REMOTE_DIR.get(cli).trim());
+    Assert.assertEquals("/test/tmpDir", GeoEnrichmentLoader.GeoEnrichmentOptions.TMP_DIR.get(cli).trim());
+    Assert.assertEquals("test:2181", GeoEnrichmentLoader.GeoEnrichmentOptions.ZK_QUORUM.get(cli).trim());
+  }
+
+  @Test
+  public void testLoadGeoIpDatabase() throws Exception {
+    File dbFile = new File(remoteDir.getAbsolutePath() + "/GeoEnrichmentLoaderTest.mmdb");
+    dbFile.createNewFile();
+    String[] argv = {"--geo_url", "file://" + dbFile.getAbsolutePath(), "--remote_dir", remoteDir.getAbsolutePath(), "--tmp_dir", tmpDir.getAbsolutePath(), "--zk_quorum", "test:2181"};
+    String[] otherArgs = new GenericOptionsParser(argv).getRemainingArgs();
+    CommandLine cli = GeoEnrichmentLoader.GeoEnrichmentOptions.parse(new PosixParser(), otherArgs);
+
+    GeoEnrichmentLoader loader = new MockGeoEnrichmentLoader();
+    loader.loadGeoIpDatabase(cli);
+    Configuration config = new Configuration();
+    FileSystem fs = FileSystem.get(config);
+    assertTrue(fs.exists(new Path(remoteDir + "/" + dbFile.getName())));
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/pom.xml
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/pom.xml b/metron-platform/metron-enrichment/pom.xml
index 0802f47..e46ee95 100644
--- a/metron-platform/metron-enrichment/pom.xml
+++ b/metron-platform/metron-enrichment/pom.xml
@@ -24,9 +24,10 @@
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-        <mysql.version>5.1.31</mysql.version>
         <slf4j.version>1.7.7</slf4j.version>
         <storm.hdfs.version>0.1.2</storm.hdfs.version>
+        <commons-compress.version>1.13</commons-compress.version>
+        <geoip.version>2.8.0</geoip.version>
         <guava.version>${global_hbase_guava_version}</guava.version>
     </properties>
     <dependencies>
@@ -72,9 +73,9 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-            <version>${mysql.version}</version>
+            <groupId>com.maxmind.geoip2</groupId>
+            <artifactId>geoip2</artifactId>
+            <version>${geoip.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.hbase</groupId>
@@ -240,6 +241,11 @@
             <version>${project.parent.version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-compress</artifactId>
+            <version>${commons-compress.version}</version>
+        </dependency>
     </dependencies>
     <reporting>
         <plugins>
@@ -322,6 +328,10 @@
                                     <pattern>com.fasterxml.jackson</pattern>
                                     <shadedPattern>org.apache.metron.jackson</shadedPattern>
                                 </relocation>
+                                <relocation>
+                                    <pattern>com.google.common</pattern>
+                                    <shadedPattern>org.apache.metron.guava.enrichment</shadedPattern>
+                                </relocation>
                             </relocations>
                             <artifactSet>
                                 <excludes>

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/main/config/enrichment.properties
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/main/config/enrichment.properties b/metron-platform/metron-enrichment/src/main/config/enrichment.properties
index 10206ea..84d8461 100644
--- a/metron-platform/metron-enrichment/src/main/config/enrichment.properties
+++ b/metron-platform/metron-enrichment/src/main/config/enrichment.properties
@@ -23,13 +23,6 @@ enrichment.output.topic=indexing
 enrichment.error.topic=enrichments_error
 threat.intel.error.topic=threatintel_error
 
-##### MySQL #####
-
-mysql.ip=10.22.0.214
-mysql.port=3306
-mysql.username=root
-mysql.password=hadoop123
-
 ##### Metrics #####
 
 #reporters

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/main/flux/enrichment/remote.yaml
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/main/flux/enrichment/remote.yaml b/metron-platform/metron-enrichment/src/main/flux/enrichment/remote.yaml
index 510bf18..054710f 100644
--- a/metron-platform/metron-enrichment/src/main/flux/enrichment/remote.yaml
+++ b/metron-platform/metron-enrichment/src/main/flux/enrichment/remote.yaml
@@ -34,25 +34,8 @@ components:
             -   "stellar"
             -   ref: "stellarEnrichmentAdapter"
 
-    -   id: "jdbcConfig"
-        className: "org.apache.metron.enrichment.adapters.jdbc.MySqlConfig"
-        properties:
-            -   name: "host"
-                value: "${mysql.ip}"
-            -   name: "port"
-                value: ${mysql.port}
-            -   name: "username"
-                value: "${mysql.username}"
-            -   name: "password"
-                value: "${mysql.password}"
-            -   name: "table"
-                value: "GEO"
     -   id: "geoEnrichmentAdapter"
         className: "org.apache.metron.enrichment.adapters.geo.GeoAdapter"
-        configMethods:
-            -   name: "withJdbcConfig"
-                args:
-                    - ref: "jdbcConfig"
     -   id: "geoEnrichment"
         className: "org.apache.metron.enrichment.configuration.Enrichment"
         constructorArgs:

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/main/flux/enrichment/test.yaml
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/main/flux/enrichment/test.yaml b/metron-platform/metron-enrichment/src/main/flux/enrichment/test.yaml
index f3ce2bc..077fedb 100644
--- a/metron-platform/metron-enrichment/src/main/flux/enrichment/test.yaml
+++ b/metron-platform/metron-enrichment/src/main/flux/enrichment/test.yaml
@@ -34,7 +34,7 @@ components:
             -   ref: "stellarEnrichmentAdapter"
 
     -   id: "geoEnrichmentAdapter"
-        className: "org.apache.metron.enrichment.integration.mock.MockGeoAdapter"
+        className: "org.apache.metron.enrichment.adapters.geo.GeoAdapter"
     -   id: "geoEnrichment"
         className: "org.apache.metron.enrichment.configuration.Enrichment"
         constructorArgs:

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/cif/AbstractCIFAdapter.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/cif/AbstractCIFAdapter.java b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/cif/AbstractCIFAdapter.java
index 60ccc5e..e300e59 100644
--- a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/cif/AbstractCIFAdapter.java
+++ b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/cif/AbstractCIFAdapter.java
@@ -19,6 +19,7 @@
 package org.apache.metron.enrichment.adapters.cif;
 
 import java.io.Serializable;
+import java.util.Map;
 
 import org.apache.metron.enrichment.bolt.CacheKey;
 import org.slf4j.Logger;
@@ -36,7 +37,7 @@ public abstract class AbstractCIFAdapter implements EnrichmentAdapter<CacheKey>,
 			.getLogger(AbstractCIFAdapter.class);
 	
 	@Override
-	abstract public boolean initializeAdapter();
+	abstract public boolean initializeAdapter(Map<String, Object> config);
 	abstract public String enrichByIP(String metadata);
 	abstract public String enrichByDomain(String metadata);
 	abstract public String enrichByEmail(String metadata);

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/cif/CIFHbaseAdapter.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/cif/CIFHbaseAdapter.java b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/cif/CIFHbaseAdapter.java
index 4f81149..48b95da 100644
--- a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/cif/CIFHbaseAdapter.java
+++ b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/cif/CIFHbaseAdapter.java
@@ -93,7 +93,7 @@ public class CIFHbaseAdapter implements EnrichmentAdapter<CacheKey>,Serializable
 	}
 
 	@Override
-	public boolean initializeAdapter() {
+	public boolean initializeAdapter(Map<String, Object> config) {
 
 		// Initialize HBase Table
 		Configuration conf = null;
@@ -117,6 +117,10 @@ public class CIFHbaseAdapter implements EnrichmentAdapter<CacheKey>,Serializable
 		return false;
 	}
 
+	@Override
+	public void updateAdapter(Map<String, Object> config) {
+	}
+
 
 	public String enrichByIP(String metadata) {
 		return null;

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/geo/GeoAdapter.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/geo/GeoAdapter.java b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/geo/GeoAdapter.java
index 9fd5d4d..afd5f97 100644
--- a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/geo/GeoAdapter.java
+++ b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/geo/GeoAdapter.java
@@ -17,71 +17,56 @@
  */
 package org.apache.metron.enrichment.adapters.geo;
 
-import org.apache.commons.validator.routines.InetAddressValidator;
-import org.apache.metron.enrichment.adapters.jdbc.JdbcAdapter;
 import org.apache.metron.enrichment.bolt.CacheKey;
+import org.apache.metron.enrichment.interfaces.EnrichmentAdapter;
 import org.json.simple.JSONObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
-import java.net.InetAddress;
-import java.sql.ResultSet;
-import java.sql.SQLException;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
 
-public class GeoAdapter extends JdbcAdapter {
-
-  private InetAddressValidator ipvalidator = new InetAddressValidator();
+public class GeoAdapter implements EnrichmentAdapter<CacheKey>, Serializable {
+  protected static final Logger _LOG = LoggerFactory.getLogger(GeoAdapter.class);
 
   @Override
   public void logAccess(CacheKey value) {
-
   }
 
   @Override
-	public String getOutputPrefix(CacheKey value) {
-		return value.getField();
-	}
+  public String getOutputPrefix(CacheKey value) {
+    return value.getField();
+  }
 
   @SuppressWarnings("unchecked")
   @Override
   public JSONObject enrich(CacheKey value) {
     JSONObject enriched = new JSONObject();
-    if(!resetConnectionIfNecessary()) {
-      _LOG.error("GEO Enrichment failure, cannot maintain a connection to JDBC.  Please check connection.  In the meantime, I'm not enriching.");
-      return enriched;
-    }
-    try {
-      InetAddress addr = InetAddress.getByName(value.coerceValue(String.class));
-      if (addr.isAnyLocalAddress() || addr.isLoopbackAddress()
-              || addr.isSiteLocalAddress() || addr.isMulticastAddress()
-              || !ipvalidator.isValidInet4Address(value.coerceValue(String.class))) {
-        return new JSONObject();
-      }
-      String locidQuery = "select IPTOLOCID(\"" + value.getValue()
-              + "\") as ANS";
-      ResultSet resultSet = statement.executeQuery(locidQuery);
-      String locid = null;
-      if (resultSet.next()) {
-        locid = resultSet.getString("ANS");
-      }
-      resultSet.close();
-      if (locid == null) return new JSONObject();
-      String geoQuery = "select * from location where locID = " + locid;
-      resultSet = statement.executeQuery(geoQuery);
-      if (resultSet.next()) {
-        enriched.put("locID", resultSet.getString("locID"));
-        enriched.put("country", resultSet.getString("country"));
-        enriched.put("city", resultSet.getString("city"));
-        enriched.put("postalCode", resultSet.getString("postalCode"));
-        enriched.put("latitude", resultSet.getString("latitude"));
-        enriched.put("longitude", resultSet.getString("longitude"));
-        enriched.put("dmaCode", resultSet.getString("dmaCode"));
-        enriched.put("location_point", enriched.get("latitude") + "," + enriched.get("longitude"));
-      }
-      resultSet.close();
-    } catch (Exception e) {
-      _LOG.error("GEO Enrichment failure: " + e.getMessage(), e);
+    Optional<HashMap<String, String>> result = GeoLiteDatabase.INSTANCE.get(value.coerceValue(String.class));
+    if(!result.isPresent()) {
+      _LOG.error("GEO Enrichment failure: {}", value.coerceValue(String.class));
       return new JSONObject();
     }
-    _LOG.trace("GEO Enrichment success: ", enriched);
+
+    enriched = new JSONObject(result.get());
+    _LOG.trace("GEO Enrichment success: {}", enriched);
     return enriched;
   }
+
+  @Override
+  public boolean initializeAdapter(Map<String, Object> config) {
+    GeoLiteDatabase.INSTANCE.update((String)config.get(GeoLiteDatabase.GEO_HDFS_FILE));
+    return true;
+  }
+
+  @Override
+  public void updateAdapter(Map<String, Object> config) {
+    GeoLiteDatabase.INSTANCE.updateIfNecessary(config);
+  }
+
+  @Override
+  public void cleanup() {
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/geo/GeoLiteDatabase.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/geo/GeoLiteDatabase.java b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/geo/GeoLiteDatabase.java
new file mode 100644
index 0000000..aa4731b
--- /dev/null
+++ b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/geo/GeoLiteDatabase.java
@@ -0,0 +1,184 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.metron.enrichment.adapters.geo;
+
+import com.maxmind.db.CHMCache;
+import com.maxmind.geoip2.DatabaseReader;
+import com.maxmind.geoip2.exception.GeoIp2Exception;
+import com.maxmind.geoip2.model.CityResponse;
+import com.maxmind.geoip2.record.City;
+import com.maxmind.geoip2.record.Country;
+import com.maxmind.geoip2.record.Location;
+import com.maxmind.geoip2.record.Postal;
+import org.apache.commons.validator.routines.InetAddressValidator;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+import java.util.zip.GZIPInputStream;
+
+public enum GeoLiteDatabase {
+  INSTANCE;
+
+  protected static final Logger LOG = LoggerFactory.getLogger(GeoLiteDatabase.class);
+  public static final String GEO_HDFS_FILE = "geo.hdfs.file";
+  public static final String GEO_HDFS_FILE_DEFAULT = "/apps/metron/geo/default/GeoLite2-City.mmdb.gz";
+
+  private static ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
+  private static final Lock readLock = lock.readLock();
+  private static final Lock writeLock = lock.writeLock();
+  private static InetAddressValidator ipvalidator = new InetAddressValidator();
+  private static volatile String hdfsLoc = GEO_HDFS_FILE_DEFAULT;
+  private static DatabaseReader reader = null;
+
+  public synchronized void updateIfNecessary(Map<String, Object> globalConfig) {
+    // Reload database if necessary (file changes on HDFS)
+    LOG.trace("[Metron] Determining if GeoIpDatabase update required");
+    String hdfsFile = GEO_HDFS_FILE_DEFAULT;
+    if (globalConfig != null) {
+      hdfsFile = (String) globalConfig.getOrDefault(GEO_HDFS_FILE, GEO_HDFS_FILE_DEFAULT);
+    }
+
+    // Always update if we don't have a DatabaseReader
+    if (reader == null || !hdfsLoc.equals(hdfsFile)) {
+      // Update
+      hdfsLoc = hdfsFile;
+      update(hdfsFile);
+    } else {
+      LOG.trace("[Metron] Update to GeoIpDatabase unnecessary");
+    }
+  }
+
+  @SuppressWarnings("unchecked")
+  public void update(String hdfsFile) {
+    // If nothing is set (or it's been unset, use the defaults)
+    if (hdfsFile == null || hdfsFile.isEmpty()) {
+      LOG.debug("[Metron] Using default for {}: {}", GEO_HDFS_FILE, GEO_HDFS_FILE_DEFAULT);
+      hdfsFile = GEO_HDFS_FILE_DEFAULT;
+    }
+
+    FileSystem fs;
+    try {
+      fs = FileSystem.get(new Configuration());
+    } catch (IOException e) {
+      LOG.error("[Metron] Unable to retrieve get HDFS FileSystem");
+      throw new IllegalStateException("[Metron] Unable to get HDFS FileSystem");
+    }
+
+    try (GZIPInputStream gis = new GZIPInputStream(fs.open(new Path(hdfsFile)))) {
+      writeLock.lock();
+      LOG.info("[Metron] Update to GeoIP data started with {}", hdfsFile);
+      // InputStream based DatabaseReaders are always in memory.
+      DatabaseReader newReader = new DatabaseReader.Builder(gis).withCache(new CHMCache()).build();
+      DatabaseReader oldReader = reader;
+      reader = newReader;
+      // If we've never set a reader, don't close the old one
+      if (oldReader != null) {
+        oldReader.close();
+      }
+      LOG.info("[Metron] Finished update to GeoIP data started with {}", hdfsFile);
+    } catch (IOException e) {
+      LOG.error("[Metron] Unable to open new database file {}", hdfsFile, e);
+      throw new IllegalStateException("[Metron] Unable to update MaxMind database");
+    } finally {
+      // Don't unlock if the try failed
+      if (lock.isWriteLocked()) {
+        writeLock.unlock();
+      }
+    }
+  }
+
+  // Optional.empty means that we don't have any geo location in database.
+  // Optional exists, but empty means local IP (valid, but no info will be in the DB)
+  @SuppressWarnings("unchecked")
+  public Optional<HashMap<String, String>> get(String ip) {
+    // Call get every single time, returns current version. Updates behind the scenes.
+    LOG.trace("[Metron] Called GeoIpDatabase.get({})", ip);
+    InetAddress addr = null;
+    try {
+      addr = InetAddress.getByName(ip);
+    } catch (UnknownHostException e) {
+      LOG.warn("[Metron] No result found for IP {}", ip, e);
+      return Optional.empty();
+    }
+    if (isIneligibleAddress(ip, addr)) {
+      return Optional.of(new HashMap());
+    }
+
+    try {
+      readLock.lock();
+      addr = InetAddress.getByName(ip);
+      CityResponse cityResponse = reader.city(addr);
+      HashMap<String, String> geoInfo = new HashMap<>();
+
+      Country country = cityResponse.getCountry();
+      City city = cityResponse.getCity();
+      Postal postal = cityResponse.getPostal();
+      Location location = cityResponse.getLocation();
+
+      geoInfo.put("locID", convertNullToEmptyString(country.getGeoNameId()));
+      geoInfo.put("country", convertNullToEmptyString(country.getIsoCode()));
+      geoInfo.put("city", convertNullToEmptyString(city.getName()));
+      geoInfo.put("postalCode", convertNullToEmptyString(postal.getCode()));
+      geoInfo.put("dmaCode", convertNullToEmptyString(location.getMetroCode()));
+
+      Double latitudeRaw = location.getLatitude();
+      String latitude = convertNullToEmptyString(latitudeRaw);
+      geoInfo.put("latitude", latitude);
+
+      Double longitudeRaw = location.getLongitude();
+      String longitude = convertNullToEmptyString(longitudeRaw);
+      geoInfo.put("longitude", longitude);
+
+      if (latitudeRaw == null || longitudeRaw == null) {
+        geoInfo.put("location_point", "");
+      } else {
+        geoInfo.put("location_point", latitude + "," + longitude);
+      }
+
+      return Optional.of(geoInfo);
+    } catch (UnknownHostException e) {
+      LOG.warn("[Metron] No result found for IP {}", ip);
+    } catch (GeoIp2Exception | IOException e) {
+      LOG.warn("[Metron] GeoLite2 DB encountered an error", e);
+    } finally {
+      readLock.unlock();
+    }
+    return Optional.empty();
+  }
+
+  protected String convertNullToEmptyString(Object raw) {
+    return raw == null ? "" : String.valueOf(raw);
+  }
+
+  private boolean isIneligibleAddress(String ipStr, InetAddress addr) {
+    return addr.isAnyLocalAddress() || addr.isLoopbackAddress()
+            || addr.isSiteLocalAddress() || addr.isMulticastAddress()
+            || !ipvalidator.isValidInet4Address(ipStr);
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/host/AbstractHostAdapter.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/host/AbstractHostAdapter.java b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/host/AbstractHostAdapter.java
index 9432613..2b076ee 100644
--- a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/host/AbstractHostAdapter.java
+++ b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/host/AbstractHostAdapter.java
@@ -19,6 +19,7 @@
 package org.apache.metron.enrichment.adapters.host;
 
 import java.io.Serializable;
+import java.util.Map;
 
 import org.apache.metron.enrichment.bolt.CacheKey;
 import org.json.simple.JSONObject;
@@ -38,7 +39,7 @@ public abstract class AbstractHostAdapter implements EnrichmentAdapter<CacheKey>
 			.getLogger(AbstractHostAdapter.class);
 	
 	@Override
-	abstract public boolean initializeAdapter();
+	abstract public boolean initializeAdapter(Map<String, Object> config);
 	@Override
 	abstract public JSONObject enrich(CacheKey metadata);
 

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/host/HostFromJSONListAdapter.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/host/HostFromJSONListAdapter.java b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/host/HostFromJSONListAdapter.java
index 8c8628a..779f66b 100644
--- a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/host/HostFromJSONListAdapter.java
+++ b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/host/HostFromJSONListAdapter.java
@@ -46,7 +46,7 @@ public class HostFromJSONListAdapter extends AbstractHostAdapter {
 	}
 
   @Override
-  public boolean initializeAdapter()
+  public boolean initializeAdapter(Map<String, Object> config)
   {
 
     if(_known_hosts.size() > 0)
@@ -56,6 +56,10 @@ public class HostFromJSONListAdapter extends AbstractHostAdapter {
   }
 
   @Override
+  public void updateAdapter(Map<String, Object> config) {
+  }
+
+  @Override
   public void logAccess(CacheKey value) {
 
   }

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/host/HostFromPropertiesFileAdapter.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/host/HostFromPropertiesFileAdapter.java b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/host/HostFromPropertiesFileAdapter.java
index 0555c1a..83d92e1 100644
--- a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/host/HostFromPropertiesFileAdapter.java
+++ b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/host/HostFromPropertiesFileAdapter.java
@@ -34,7 +34,7 @@ public class HostFromPropertiesFileAdapter extends AbstractHostAdapter {
 	}
 
 	@Override
-	public boolean initializeAdapter()
+	public boolean initializeAdapter(Map<String, Object> config)
 	{
 		
 		if(_known_hosts.size() > 0)
@@ -44,6 +44,10 @@ public class HostFromPropertiesFileAdapter extends AbstractHostAdapter {
 	}
 
 	@Override
+	public void updateAdapter(Map<String, Object> config) {
+	}
+
+	@Override
 	public String getOutputPrefix(CacheKey value) {
 		return value.getField();
 	}

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/jdbc/JdbcAdapter.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/jdbc/JdbcAdapter.java b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/jdbc/JdbcAdapter.java
index 708eb67..9eddc04 100644
--- a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/jdbc/JdbcAdapter.java
+++ b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/jdbc/JdbcAdapter.java
@@ -25,6 +25,7 @@ import org.slf4j.LoggerFactory;
 import java.io.Serializable;
 import java.net.InetAddress;
 import java.sql.*;
+import java.util.Map;
 
 public abstract class JdbcAdapter implements EnrichmentAdapter<CacheKey>, Serializable {
 
@@ -53,7 +54,7 @@ public abstract class JdbcAdapter implements EnrichmentAdapter<CacheKey>, Serial
   protected boolean resetConnectionIfNecessary() {
     if(isConnectionClosed()) {
       this.cleanup();
-      return this.initializeAdapter();
+      return this.initializeAdapter(null);
     }
     return true;
   }
@@ -69,7 +70,7 @@ public abstract class JdbcAdapter implements EnrichmentAdapter<CacheKey>, Serial
 
 
   @Override
-  public boolean initializeAdapter() {
+  public boolean initializeAdapter(Map<String, Object> config) {
     try {
       if (!InetAddress.getByName(host).isReachable(500)) {
         throw new Exception("Unable to reach host " + host);

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/simplehbase/SimpleHBaseAdapter.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/simplehbase/SimpleHBaseAdapter.java b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/simplehbase/SimpleHBaseAdapter.java
index eae2e85..0ef51f8 100644
--- a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/simplehbase/SimpleHBaseAdapter.java
+++ b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/simplehbase/SimpleHBaseAdapter.java
@@ -67,7 +67,7 @@ public class SimpleHBaseAdapter implements EnrichmentAdapter<CacheKey>,Serializa
   public JSONObject enrich(CacheKey value) {
     JSONObject enriched = new JSONObject();
     if(!isInitialized()) {
-      initializeAdapter();
+      initializeAdapter(null);
     }
     List<String> enrichmentTypes = value.getConfig()
                                         .getEnrichment().getFieldToTypeMap()
@@ -95,7 +95,7 @@ public class SimpleHBaseAdapter implements EnrichmentAdapter<CacheKey>,Serializa
       }
       catch (IOException e) {
         _LOG.error("Unable to retrieve value: " + e.getMessage(), e);
-        initializeAdapter();
+        initializeAdapter(null);
         throw new RuntimeException("Unable to retrieve value: " + e.getMessage(), e);
       }
     }
@@ -104,7 +104,7 @@ public class SimpleHBaseAdapter implements EnrichmentAdapter<CacheKey>,Serializa
   }
 
   @Override
-  public boolean initializeAdapter() {
+  public boolean initializeAdapter(Map<String, Object> configuration) {
     String hbaseTable = config.getHBaseTable();
     Configuration hbaseConfig = HBaseConfiguration.create();
     try {
@@ -120,6 +120,10 @@ public class SimpleHBaseAdapter implements EnrichmentAdapter<CacheKey>,Serializa
   }
 
   @Override
+  public void updateAdapter(Map<String, Object> config) {
+  }
+
+  @Override
   public void cleanup() {
     try {
       lookup.close();

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/stellar/StellarAdapter.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/stellar/StellarAdapter.java b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/stellar/StellarAdapter.java
index 4950ddb..bc5f2b6 100644
--- a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/stellar/StellarAdapter.java
+++ b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/stellar/StellarAdapter.java
@@ -112,12 +112,16 @@ public class StellarAdapter implements EnrichmentAdapter<CacheKey>,Serializable
   }
 
   @Override
-  public boolean initializeAdapter() {
+  public boolean initializeAdapter(Map<String, Object> config) {
     getHandler = EnrichmentType.valueOf(enrichmentType);
     return true;
   }
 
   @Override
+  public void updateAdapter(Map<String, Object> config) {
+  }
+
+  @Override
   public void cleanup() {
 
   }

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/threatintel/ThreatIntelAdapter.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/threatintel/ThreatIntelAdapter.java b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/threatintel/ThreatIntelAdapter.java
index 05ac038..e4ab7b1 100644
--- a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/threatintel/ThreatIntelAdapter.java
+++ b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/threatintel/ThreatIntelAdapter.java
@@ -34,6 +34,7 @@ import org.slf4j.LoggerFactory;
 import java.io.IOException;
 import java.io.Serializable;
 import java.util.List;
+import java.util.Map;
 import java.util.UUID;
 
 public class ThreatIntelAdapter implements EnrichmentAdapter<CacheKey>,Serializable {
@@ -66,7 +67,7 @@ public class ThreatIntelAdapter implements EnrichmentAdapter<CacheKey>,Serializa
   @Override
   public JSONObject enrich(CacheKey value) {
     if(!isInitialized()) {
-      initializeAdapter();
+      initializeAdapter(null);
     }
     JSONObject enriched = new JSONObject();
     List<String> enrichmentTypes = value.getConfig()
@@ -95,7 +96,7 @@ public class ThreatIntelAdapter implements EnrichmentAdapter<CacheKey>,Serializa
       }
       catch(IOException e) {
         _LOG.error("Unable to retrieve value: " + e.getMessage(), e);
-        initializeAdapter();
+        initializeAdapter(null);
         throw new RuntimeException("Theat Intel Unable to retrieve value", e);
       }
     }
@@ -108,7 +109,7 @@ public class ThreatIntelAdapter implements EnrichmentAdapter<CacheKey>,Serializa
   }
 
   @Override
-  public boolean initializeAdapter() {
+  public boolean initializeAdapter(Map<String, Object> configuration) {
     PersistentAccessTracker accessTracker;
     String hbaseTable = config.getHBaseTable();
     int expectedInsertions = config.getExpectedInsertions();
@@ -136,6 +137,10 @@ public class ThreatIntelAdapter implements EnrichmentAdapter<CacheKey>,Serializa
   }
 
   @Override
+  public void updateAdapter(Map<String, Object> config) {
+  }
+
+  @Override
   public void cleanup() {
     try {
       lookup.close();

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/bolt/GenericEnrichmentBolt.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/bolt/GenericEnrichmentBolt.java b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/bolt/GenericEnrichmentBolt.java
index 0ecc6b4..f3ed5b4 100644
--- a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/bolt/GenericEnrichmentBolt.java
+++ b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/bolt/GenericEnrichmentBolt.java
@@ -118,6 +118,7 @@ public class GenericEnrichmentBolt extends ConfiguredEnrichmentBolt {
     return this;
   }
 
+
   @Override
   public void reloadCallback(String name, ConfigurationType type) {
     if(invalidateCacheOnReload) {
@@ -125,6 +126,9 @@ public class GenericEnrichmentBolt extends ConfiguredEnrichmentBolt {
         cache.invalidateAll();
       }
     }
+    if(type == ConfigurationType.GLOBAL) {
+      adapter.updateAdapter(getConfigurations().getGlobalConfig());
+    }
   }
 
   @Override
@@ -147,9 +151,9 @@ public class GenericEnrichmentBolt extends ConfiguredEnrichmentBolt {
     cache = CacheBuilder.newBuilder().maximumSize(maxCacheSize)
             .expireAfterWrite(maxTimeRetain, TimeUnit.MINUTES)
             .build(loader);
-    boolean success = adapter.initializeAdapter();
+    boolean success = adapter.initializeAdapter(getConfigurations().getGlobalConfig());
     if (!success) {
-      LOG.error("[Metron] EnrichmentSplitterBolt could not initialize adapter");
+      LOG.error("[Metron] GenericEnrichmentBolt could not initialize adapter");
       throw new IllegalStateException("Could not initialize adapter...");
     }
     initializeStellar();
@@ -238,7 +242,7 @@ public class GenericEnrichmentBolt extends ConfiguredEnrichmentBolt {
 
       enrichedMessage.put("adapter." + adapter.getClass().getSimpleName().toLowerCase() + ".end.ts", "" + System.currentTimeMillis());
       if(error) {
-        throw new Exception("Unable to enrich " + enrichedMessage + " check logs for specifics.");
+        throw new Exception("Unable to enrich " + rawMessage + " check logs for specifics.");
       }
       if (!enrichedMessage.isEmpty()) {
         collector.emit(enrichmentType, new Values(key, enrichedMessage, subGroup));
@@ -259,10 +263,6 @@ public class GenericEnrichmentBolt extends ConfiguredEnrichmentBolt {
     collector.emit(ERROR_STREAM, new Values(error));
   }
 
-  protected void handleError() {
-
-  }
-
   @Override
   public void cleanup() {
     adapter.cleanup();

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/bolt/ThreatIntelJoinBolt.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/bolt/ThreatIntelJoinBolt.java b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/bolt/ThreatIntelJoinBolt.java
index ee67f83..6d0ea44 100644
--- a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/bolt/ThreatIntelJoinBolt.java
+++ b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/bolt/ThreatIntelJoinBolt.java
@@ -17,6 +17,8 @@
  */
 package org.apache.metron.enrichment.bolt;
 
+import org.apache.metron.common.configuration.ConfigurationType;
+import org.apache.metron.enrichment.adapters.geo.GeoLiteDatabase;
 import org.apache.storm.task.TopologyContext;
 import com.google.common.base.Joiner;
 import org.apache.metron.common.configuration.enrichment.SensorEnrichmentConfig;
@@ -63,12 +65,14 @@ public class ThreatIntelJoinBolt extends EnrichmentJoinBolt {
   @Override
   public void prepare(Map map, TopologyContext topologyContext) {
     super.prepare(map, topologyContext);
+    GeoLiteDatabase.INSTANCE.update((String)getConfigurations().getGlobalConfig().get(GeoLiteDatabase.GEO_HDFS_FILE));
     initializeStellar();
   }
 
   protected void initializeStellar() {
     this.stellarContext = new Context.Builder()
                                 .with(Context.Capabilities.ZOOKEEPER_CLIENT, () -> client)
+                                .with(Context.Capabilities.GLOBAL_CONFIG, () -> getConfigurations().getGlobalConfig())
                                 .build();
     StellarFunctions.initialize(stellarContext);
     this.functionResolver = StellarFunctions.FUNCTION_RESOLVER();
@@ -147,4 +151,12 @@ public class ThreatIntelJoinBolt extends EnrichmentJoinBolt {
 
     return ret;
   }
+
+  @Override
+  public void reloadCallback(String name, ConfigurationType type) {
+    super.reloadCallback(name, type);
+    if(type == ConfigurationType.GLOBAL) {
+      GeoLiteDatabase.INSTANCE.updateIfNecessary(getConfigurations().getGlobalConfig());
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/fa6f3df5/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/interfaces/EnrichmentAdapter.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/interfaces/EnrichmentAdapter.java b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/interfaces/EnrichmentAdapter.java
index c2682bc..1ee6ade 100644
--- a/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/interfaces/EnrichmentAdapter.java
+++ b/metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/interfaces/EnrichmentAdapter.java
@@ -18,14 +18,16 @@
 
 package org.apache.metron.enrichment.interfaces;
 
-import org.apache.metron.common.configuration.enrichment.SensorEnrichmentConfig;
 import org.json.simple.JSONObject;
 
+import java.util.Map;
+
 public interface EnrichmentAdapter<T>
 {
 	void logAccess(T value);
 	JSONObject enrich(T value);
-	boolean initializeAdapter();
+	boolean initializeAdapter(Map<String, Object> config);
+	void updateAdapter(Map<String, Object> config);
 	void cleanup();
 	String getOutputPrefix(T value);
 	default String getStreamSubGroup(String enrichmentType, String field) {