Installing HCP with Ambari
Also available as:

Install Solr

If you are using Apache Solr, install it using the Ambari HDP Search management pack.

  1. From Ambari, stop the following:
    • Metron
    • Kibana
    • Elasticsearch
  2. Install the Ambari HDP Search Management pack.
    For instructions on downloading and using the Ambari HDP Search management pack, see Apache Solr Search Installation.
    Ensure the Java threat stack size parameter is set to greater than 320kb. The default setting for SOLR_JAVA_STACK_SIZE is not sufficient to start the Solr service.
    Ambari automatically creates collections for the following:
    • bro
    • snort
    • yaf
    • metaalert
    • error
  3. If you want to create a collection for a schema not supplied by HCP, perform the following steps:
    1. Set Solr environmental variables in ZooKeeper.
      # Path to the zookeeper node used by Solr
      export ZOOKEEPER=node1:2181/solr
      # Define SOLR_HOME
      export SOLR_HOME=/opt/lucidworks-hdpsearch/solr/
      # Set to true if Kerberos is enabled
      export SECURITY_ENABLED=true 
    2. Create a collection.
      For example:
      su $SOLR_USER -c "$SOLR_HOME/bin/solr create -c bro -d $METRON_HOME/config/schema/bro/"
    3. Pull all configurations from ZooKeeper to the Metron config directory:
      $METRON_HOME/bin/ -m PULL -z $ZOOKEEPER -o $METRON_HOME/config/zookeeper -f
  4. Add "source.type.field" : "source.type" and threat.triage.score.field" : "threat.triage.score" to the global.json file located at$METRON_HOME/config/zookeeper/global.json:
    $METRON_HOME/bin/ -m PUSH -z $ZOOKEEPER -i $METRON_HOME/config/zookeeper
    The global.json file should look similar to:
      "es.clustername" : "metron",
      "es.ip" : "blah:9300",
      "" : "yyyy.MM.dd.HH",
      "parser.error.topic" : "indexing",
      "update.hbase.table" : "metron_update",
      "" : "t",
      "es.client.settings" : {
        "client.transport.ping_timeout" : "500s"
      "profiler.client.period.duration" : "15",
      "profiler.client.period.duration.units" : "MINUTES",
      "source.type.field" : "source.type",
      "threat.triage.score.field" : "threat:triage:score", 
      "user.settings.hbase.table" : "user_settings",
      "" : "cf",
      "geo.hdfs.file" : "/apps/metron/geo/default/GeoLite2-City.mmdb.gz"
  5. Push the configuration to ZooKeeper:
    $METRON_HOME/bin/ -m PUSH -z $ZOOKEEPER -i $METRON_HOME/config/zookeeper
  6. Restart Metron.
  7. Start Solr.
  8. From Ambari, select Metron in the components panel.
  9. Click the Configs tab, then click the Indexing tab.
  10. Choose Solr in the Index Writer - Random Access pull down menu.
  11. Click Save.
  12. From Ambari, stop and restart the Metron Alerts user interface.
  13. From Ambari, stop and restart Metron REST.
You can access Solr by choosing Solr UI from the Quick Links pull down menu in Ambari.