Ejemplo n.º 1
0
    def start(self, env, upgrade_type=None):
        import params
        env.set_params(params)
        install_solr()
        self.configure(env)

        if params.security_enabled:
            solr_kinit_cmd = format(
                "{kinit_path_local} -kt {solr_kerberos_keytab} {solr_kerberos_principal}; "
            )
            Execute(solr_kinit_cmd, user=params.solr_user)

        if params.is_supported_solr_ranger:
            setup_ranger_solr()  # Ranger Solr Plugin related call

        if params.restart_during_downgrade:
            solr_env = {'SOLR_INCLUDE': format('{solr_conf}/solr.in.sh')}
        else:
            solr_env = {'SOLR_INCLUDE': format('{solr_conf}/solr-env.sh')}
        Execute(format(
            '{solr_bindir}/solr start -cloud -noprompt -s {solr_datadir} >> {solr_log} 2>&1'
        ),
                environment=solr_env,
                user=params.solr_user)

        if 'ranger-env' in params.config[
                'configurations'] and params.audit_solr_enabled:
            solr_cloud_util.upload_configuration_to_zk(
                zookeeper_quorum=params.zookeeper_quorum,
                solr_znode=params.solr_znode,
                config_set=params.ranger_solr_config_set,
                config_set_dir=params.ranger_solr_conf,
                tmp_dir=params.tmp_dir,
                java64_home=params.java64_home,
                jaas_file=params.solr_jaas_file,
                retry=30,
                interval=5)

            solr_cloud_util.create_collection(
                zookeeper_quorum=params.zookeeper_quorum,
                solr_znode=params.solr_znode,
                collection=params.ranger_solr_collection_name,
                config_set=params.ranger_solr_config_set,
                java64_home=params.java64_home,
                shards=params.ranger_solr_shards,
                replication_factor=int(params.replication_factor),
                jaas_file=params.solr_jaas_file)
Ejemplo n.º 2
0
 def install(self, env):
     import params
     env.set_params(params)
     install_solr()
     self.configure(env)
Ejemplo n.º 3
0
 def install(self, env):
     import params
     env.set_params(params)
     install_solr()
Ejemplo n.º 4
0
 def start(self, env, upgrade_type=None):
     import params
     env.set_params(params)
     install_solr()
     self.configure(env)