Hortonworks Cybersecurity Platform
Also available as:
PDF

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.
    The Meta Alerts UI feature with Solr is technical preview in this release. We do not yet recommend this for production use, but please let us know about any bugs you might find. We appreciate your feedback.
    Important
    Important
    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/zk_load_configs.sh -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/zk_load_configs.sh -m PUSH -z $ZOOKEEPER -i $METRON_HOME/config/zookeeper
    
    The global.json file should look similar to:
    {
      "es.clustername" : "metron",
      "es.ip" : "blah:9300",
      "es.date.format" : "yyyy.MM.dd.HH",
      "parser.error.topic" : "indexing",
      "update.hbase.table" : "metron_update",
      "update.hbase.cf" : "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",
      "user.settings.hbase.cf" : "cf",
      "geo.hdfs.file" : "/apps/metron/geo/default/GeoLite2-City.mmdb.gz"
    }
  5. Push the configuration to ZooKeeper:
    $METRON_HOME/bin/zk_load_configs.sh -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.