def start(self, env, upgrade_type=None): import params env.set_params(params) install_kafka() self.configure(env, upgrade_type=upgrade_type) if params.security_enabled: kafka_kinit_cmd = format( "{kinit_path_local} -kt {kafka_keytab_path} {kafka_jaas_principal};" ) Execute(kafka_kinit_cmd, user=params.kafka_user) if params.is_supported_kafka_ranger: setup_ranger_kafka() daemon_cmd = format( 'source {params.conf_dir}/kafka-env.sh ; {params.kafka_bin_dir}/kafka-server-start.sh -daemon {params.conf_dir}/server.properties' ) no_op_test = format( 'ls {params.kafka_pid_file} >/dev/null 2>&1 && ps -p `cat {params.kafka_pid_file}` >/dev/null 2>&1' ) try: Execute(daemon_cmd, user=params.kafka_user, not_if=no_op_test) except: show_logs(params.kafka_log_dir, params.kafka_user) raise
def pre_upgrade_restart(self, env): import params env.set_params(params) install_kafka()
def install(self, env): self.install_packages(env) install_kafka()
def install(self, env): install_kafka()