METRON-1283: Install Elasticsearch template as a part of the mpack startup scripts #817
Changes from all commits
f6f0b97
1bf25a9
93bf31f
290e442
f52c91b
51de707
c0b7a88
a266fb5
8ae0370
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
## Introduction | ||
|
||
Elasticsearch can be used as the real-time portion of the datastore resulting from [metron-indexing](../metron-indexing.README.md). | ||
Elasticsearch can be used as the real-time portion of the datastore resulting from [metron-indexing](../metron-indexing/README.md). | ||
|
||
## Properties | ||
|
||
|
@@ -81,3 +81,18 @@ curl -XPUT "http://${ELASTICSEARCH}:9200/${SENSOR}_index*/_mapping/${SENSOR}_doc | |
' | ||
rm ${SENSOR}.template | ||
``` | ||
|
||
## Installing Elasticsearch Templates | ||
|
||
The stock set of Elasticsearch templates for bro, snort, yaf, error index and meta index are installed automatically during the first time install and startup of Metron Indexing service. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of saying 'in the rare case', it might be better to say: "It is possible that Elasticsearch is not available when the Metron Indexing Service starts the Elasticsearch topology, in that case the Elasticsearch templates will not be installed." Also, this doesn't document the scenarios you have been describing fully. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reworded per your suggestion. I believe the README section covers the current behavior with my change. If you are talking about the scenarios noted in the PR description, then these are captured in the existing ES README under the section Using Metron with Elasticsearch 2.x. Please let me know which specific scenario you are referring to and I would be happy to include them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My impression from these comments is that automatic installation could still possibly happen. That is what I'm referring to as being missing. I may be confused though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah okay, this comment and review is the same scenario described in the README as:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So I am def. confused. I don't see how "It will try again next time X happens" as the same as Go and do it manually in ambari There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, let me try to explain more using examples: Scenario 1 - Happy Path
Scenario 2 - ES service down
Now, from a documentation perspective, point 2 above is counter intuitive IMHO, since it would not make sense to ask the Admin to stop/start Indexing service in order to have the ES template installed. I have hence documented only the first option--which is also the same way it is done presently. Let me know if this helps clarify. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But, if that is the way it works, and is what will happen, you should documented it. If it doesn't make sense enough to document, then change the behavior. We have people all over the user's list with issues understanding what is going on with things. "Oh, the doc doesn't say it but we do try to install automatically next time or if you .... " isn't right. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair enough, added both methods in the latest doc change. |
||
It is possible that Elasticsearch service is not available when the Metron Indexing Service startup, in that case the Elasticsearch template will not be installed. | ||
|
||
For such a scenario, an Admin can have the template installed in two ways: | ||
|
||
_Method 1_ - Manually from the Ambari UI by following the flow: | ||
Ambari UI -> Services -> Metron -> Service Actions -> Elasticsearch Template Install | ||
|
||
_Method 2_ - Stop the Metron Indexing service, and start it again from Ambari UI. Note that the Metron Indexing service tracks if it has successfully installed the Elasticsearch templates, and will attempt to do so each time it is Started until successful. | ||
|
||
> Note: If you have made any customization to your index templates, then installing Elasticsearch templates afresh will lead to overwriting your existing changes. Please exercise caution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anandsubbu said...
I am reading the code differently. If we attempt to install the templates, but it fails because ES is down, then an exception is thrown and we never set the flag file. This is good because the next time we start indexing, it will again attempt to install the index templates. It will continue to attempt the index template install until that flag file is set. Only if the templates actually get installed will the flag file get set, which causes it to stop attempting the install. This is exactly what we want.
The only thing I would suggest is that we attempt the template install BEFORE starting the indexing topology.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @nickwallen . Sure, done!