Esempio n. 1
0
    def start(self, env, upgrade_type=None):
        from params import params
        env.set_params(params)
        self.configure(env)
        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:
            # Install elasticsearch templates
            try:
                if not commands.is_elasticsearch_template_installed():
                    self.elasticsearch_template_install(env)
                    commands.set_elasticsearch_template_installed()

            except Exception as e:
                msg = "WARNING: Elasticsearch index templates could not be installed.  " \
                      "Is Elasticsearch running?  Will reattempt install on next start.  error={0}"
                Logger.warning(msg.format(e))

        commands.start_indexing_topology(env)
Esempio n. 2
0
    def start(self, env, upgrade_type=None):
        from params import params
        env.set_params(params)
        self.configure(env)
        commands = IndexingCommands(params)
        if params.ra_indexing_writer == 'Solr':
            # Install Solr schemas
            if not commands.is_solr_schema_installed():
                if commands.solr_schema_install(env):
                    commands.set_solr_schema_installed()

        elif params.ra_indexing_writer == 'Elasticsearch':
            # Install elasticsearch templates
            if not commands.is_elasticsearch_template_installed():
                if self.elasticsearch_template_install(env):
                    commands.set_elasticsearch_template_installed()

        else :
            msg = "WARNING:  index schemas/templates could not be installed.  " \
                  "Is Indexing server configured properly ?  Will reattempt install on next start.  index server configured={0}"
            Logger.warning(msg.format(params.ra_indexing_writer))

        commands.start_indexing_topology(env)