ottobackwards commented on a change in pull request #1305: METRON-1940:Check if 
not and install Elastic search templates / Solr collections when indexing 
server is restarted
URL: https://github.com/apache/metron/pull/1305#discussion_r250388842
 
 

 ##########
 File path: 
metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/indexing_master.py
 ##########
 @@ -138,6 +138,30 @@ def status(self, env):
     def restart(self, env):
         from params import params
         env.set_params(params)
+        commands = IndexingCommands(params)
+        if params.ra_indexing_writer == 'Solr':
+            # Install Solr schemas
+            try:
+                if not commands.is_solr_schema_installed():
+                    commands.solr_schema_install(env)
+                    commands.set_solr_schema_installed()
+
+            except Exception as e:
+                msg = "WARNING: Solr schemas could not be installed.  " \
+                      "Is Solr running?  Will reattempt install on next start. 
 error={0}"
+                Logger.warning(msg.format(e))
+        else:
 
 Review comment:
   Is there ever any danger of overwriting user changes in the schemas with 
this logic?
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to