Specifying Index Parameters Using the CLI
To specify the parameters for the writers rather than using the default values, you
can use the following syntax in the Indexing Configuration file, located at
$METRON_HOME/config/zookeeper/indexing
.
Important | |
---|---|
Any property that is managed by Ambari should only be modified via Ambari. Otherwise, when you restart a service, Ambari might overwrite your updates. For more information about properties managed by Ambari, see Updating Properties. |
Create the Indexing Configuration file at
$METRON_HOME/config/zookeeper/indexing
.touch /$METRON_HOME/config/zookeeper/indexing/$sensor_name.json
Populate the
$sensor_name.json
file with index configuration information for each of your sensors, using syntax similar to the following:{ "elasticsearch": { "index": "foo", "batchSize" : 100, "enabled" : true }, "hdfs": { "index": "foo", "batchSize": 1, "enabled" : true }, "alert": { "type": "nested" }
This syntax specifies the following parameter values:
Elasticsearch writer or index
index name of "foo"
batch size of 100
enabled
HDFS writer or index
index name of "foo"
batch size of 1
enabled
alert
This field must be set to
"type": "nested"
. If this field is not set, Elasticsearch can throw an error and the field will not be queryable.
Push the configuration to ZooKeeper:
/usr/metron/$METRON_VERSION/bin/zk_load_configs.sh --mode PUSH -i /usr/metron/$METRON_VERSION/config/zookeeper -z $ZOOKEEPER_HOST:2181