Github user nickwallen commented on a diff in the pull request:
https://github.com/apache/metron/pull/817#discussion_r147587373
--- Diff:
metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/indexing_master.py
---
@@ -82,6 +82,13 @@ def start(self, env, upgrade_type=None):
self.configure(env)
commands = IndexingCommands(params)
commands.start_indexing_topology(env)
+ # Install elasticsearch templates
+ try:
+ if not commands.is_elasticsearch_template_installed():
+ self.elasticsearch_template_install(env)
+ commands.set_elasticsearch_template_installed()
--- End diff --
> If the install fails the first time due to ES being down, then we WARN
and move on. If ES service comes up later, the admin needs to install the
templates subsequently by using 'Ambari -> Metron -> Service Actions ->
Elasticsearch Template Install' option
I am reading the code differently @anandsubbu . 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. Only if the
templates actually get installed will the flag file get set, which causes it to
stop attempting the install. This is good. That's what we want.
The only thing I would suggest is that we attempt the template install
BEFORE starting the indexing topology.
---