def stop(self, env): import params env.set_params(params) hbase_service( 'thrift2', action = 'stop' )
def post_upgrade(self, env): import params env.set_params(params) hbase_service( 'master', action = 'post_upgrade' )
def post_upgrade(self, env): import params env.set_params(params) hbase_service( 'regionserver', action = 'post_upgrade' )
def start(self, env, upgrade_type=None): import params env.set_params(params) self.configure(env) # for security hbase_service( 'master', action = 'start' )
def start(self, env): import params env.set_params(params) self.configure(env, action="start") # for security hbase_service("master", action="start")
def stop(self, env, rolling_restart=False): import params env.set_params(params) hbase_service( 'master', action = 'stop' )
def stop(self, env, rolling_restart=False): import params env.set_params(params) hbase_service( 'regionserver', action = 'stop' )
def stop(self, env): import params env.set_params(params) hbase_service( 'thrift', action = 'stop' )
def post_upgrade(self, env): import params env.set_params(params) hbase_service( 'thrift2', action = 'post_upgrade' )
def pre_upgrade(self, env): import params env.set_params(params) hbase_service( 'rest', action = 'pre_upgrade' )
def start(self, env, upgrade_type=None): import params env.set_params(params) self.configure(env) # for security setup_ranger_hbase(upgrade_type=upgrade_type, service_name="hbase-regionserver") hbase_service('regionserver', action='start')
def stop(self, env, upgrade_type=None): import params env.set_params(params) hbase_service( 'regionserver', action = 'stop' )
def stop(self, env): import params env.set_params(params) hbase_service( 'regionserver', action = 'stop' )
def start(self, env, rolling_restart=False): import params env.set_params(params) self.configure(env) # for security setup_ranger_hbase(rolling_upgrade=rolling_restart) hbase_service("master", action="start")
def start(self, env): import params env.set_params(params) self.configure(env) # for security hbase_service( 'regionserver', action = 'start' )
def start(self, env, rolling_restart=False): import params env.set_params(params) self.configure(env) # for security setup_ranger_hbase() hbase_service( 'regionserver', action = 'start' )
def start(self, env, upgrade_type=None): import params env.set_params(params) self.configure(env) # for security setup_ranger_hbase(upgrade_type=upgrade_type) hbase_service( 'regionserver', action = 'start' )
def start(self, env, rolling_restart=False): import params env.set_params(params) self.configure(env) # for security setup_ranger_hbase() hbase_service( 'master', action = 'start' ) Links(params.new_hbase_log_path, params.hbase_log_path)
def start(self, env, upgrade_type=None): import params env.set_params(params) self.configure(env) # for security setup_ranger_hbase(upgrade_type=upgrade_type, service_name="hbase-master") if params.enable_hbase_atlas_hook: Logger.info( "Hbase Atlas hook is enabled, configuring Atlas HBase Hook.") hbase_atlas_hook_file_path = os.path.join( params.hbase_conf_dir, params.atlas_hook_filename) setup_atlas_hook(SERVICE.HBASE, params.hbase_atlas_hook_properties, hbase_atlas_hook_file_path, params.hbase_user, params.user_group) else: Logger.info( "Hbase Atlas hook is disabled, skippking Atlas configurations." ) hbase_service('master', action='start')
def ams_service(name, action): import params if name == 'collector': cmd = format("{ams_collector_script} --config {ams_collector_conf_dir}") pid_file = format("{ams_collector_pid_dir}/ambari-metrics-collector.pid") #no_op_test should be much more complex to work with cumulative status of collector #removing as startup script handle it also #no_op_test = format("ls {pid_file} >/dev/null 2>&1 && ps `cat {pid_file}` >/dev/null 2>&1") if params.is_hbase_distributed: hbase_service('zookeeper', action=action) hbase_service('master', action=action) hbase_service('regionserver', action=action) cmd = format("{cmd} --distributed") if action == 'start': Execute(format("{sudo} rm -rf {hbase_tmp_dir}/*.tmp") ) if not params.is_hbase_distributed and os.path.exists(format("{zookeeper_data_dir}")): Execute(format("{sudo} rm -rf {zookeeper_data_dir}/*") ) daemon_cmd = format("{cmd} start") Execute(daemon_cmd, user=params.ams_user ) pass elif action == 'stop': daemon_cmd = format("{cmd} stop") Execute(daemon_cmd, user=params.ams_user ) pass pass elif name == 'monitor': cmd = format("{ams_monitor_script} --config {ams_monitor_conf_dir}") pid_file = format("{ams_monitor_pid_dir}/ambari-metrics-monitor.pid") no_op_test = format("ls {pid_file} >/dev/null 2>&1 && ps `cat {pid_file}` >/dev/null 2>&1") if action == 'start': daemon_cmd = format("{cmd} start") Execute(daemon_cmd, user=params.ams_user ) pass elif action == 'stop': daemon_cmd = format("{cmd} stop") Execute(daemon_cmd, user=params.ams_user ) pass pass pass
def stop(self, env, rolling_restart=False): import params env.set_params(params) hbase_service("master", action="stop")
def pre_upgrade(self, env): import params env.set_params(params) hbase_service('regionserver', action='pre_upgrade')
def pre_upgrade(self, env): import params env.set_params(params) hbase_service('thrift', action='pre_upgrade')
def ams_service(name, action): import params if name == 'collector': cmd = format("{ams_collector_script} --config {ams_collector_conf_dir}") pid_file = format("{ams_collector_pid_dir}/ambari-metrics-collector.pid") #no_op_test should be much more complex to work with cumulative status of collector #removing as startup script handle it also #no_op_test = format("ls {pid_file} >/dev/null 2>&1 && ps `cat {pid_file}` >/dev/null 2>&1") if params.is_hbase_distributed: if action == 'stop': hbase_service('regionserver', action=action) hbase_service('master', action=action) else: hbase_service('master', action=action) hbase_service('regionserver', action=action) cmd = format("{cmd} --distributed") if action == 'start': Execute(format("{sudo} rm -rf {hbase_tmp_dir}/*.tmp") ) if not params.is_hbase_distributed and os.path.exists(format("{zookeeper_data_dir}")): Directory(params.zookeeper_data_dir, action='delete' ) if not params.is_hbase_distributed: File(format("{ams_collector_conf_dir}/core-site.xml"), action='delete', owner=params.ams_user) File(format("{ams_collector_conf_dir}/hdfs-site.xml"), action='delete', owner=params.ams_user) if params.security_enabled: kinit_cmd = format("{kinit_path_local} -kt {ams_collector_keytab_path} {ams_collector_jaas_princ};") daemon_cmd = format("{kinit_cmd} {cmd} start") else: daemon_cmd = format("{cmd} start") Execute(daemon_cmd, user=params.ams_user ) pass elif action == 'stop': daemon_cmd = format("{cmd} stop") Execute(daemon_cmd, user=params.ams_user ) pass pass elif name == 'monitor': cmd = format("{ams_monitor_script} --config {ams_monitor_conf_dir}") pid_file = format("{ams_monitor_pid_dir}/ambari-metrics-monitor.pid") no_op_test = format("ls {pid_file} >/dev/null 2>&1 && ps `cat {pid_file}` >/dev/null 2>&1") if action == 'start': daemon_cmd = format("{cmd} start") Execute(daemon_cmd, user=params.ams_user ) pass elif action == 'stop': daemon_cmd = format("{cmd} stop") Execute(daemon_cmd, user=params.ams_user ) pass pass pass
def stop(self, env): import params env.set_params(params) hbase_service("master", action="stop")
def ams_service(name, action): import params if name == 'collector': cmd = format( "{ams_collector_script} --config {ams_collector_conf_dir}") pid_file = format( "{ams_collector_pid_dir}/ambari-metrics-collector.pid") #no_op_test should be much more complex to work with cumulative status of collector #removing as startup script handle it also #no_op_test = format("ls {pid_file} >/dev/null 2>&1 && ps `cat {pid_file}` >/dev/null 2>&1") if params.is_hbase_distributed: if action == 'stop': hbase_service('regionserver', action=action) hbase_service('master', action=action) else: hbase_service('master', action=action) hbase_service('regionserver', action=action) cmd = format("{cmd} --distributed") else: # make sure no residual region server process is running in embedded mode if action == 'stop': hbase_service('regionserver', action=action) if action == 'start': Execute(format("{sudo} rm -rf {hbase_tmp_dir}/*.tmp")) if not params.is_hbase_distributed: File(format("{ams_collector_conf_dir}/core-site.xml"), action='delete', owner=params.ams_user) File(format("{ams_collector_conf_dir}/hdfs-site.xml"), action='delete', owner=params.ams_user) if params.security_enabled: kinit_cmd = format( "{kinit_path_local} -kt {ams_collector_keytab_path} {ams_collector_jaas_princ};" ) daemon_cmd = format("{kinit_cmd} {cmd} start") else: daemon_cmd = format("{cmd} start") try: Execute(daemon_cmd, user=params.ams_user) except: show_logs(params.ams_collector_log_dir, params.ams_user) raise pass elif action == 'stop': daemon_cmd = format("{cmd} stop") Execute(daemon_cmd, user=params.ams_user) pass pass elif name == 'monitor': cmd = format("{ams_monitor_script} --config {ams_monitor_conf_dir}") pid_file = format("{ams_monitor_pid_dir}/ambari-metrics-monitor.pid") no_op_test = format( "ls {pid_file} >/dev/null 2>&1 && ps `cat {pid_file}` >/dev/null 2>&1" ) if action == 'start': daemon_cmd = format("{cmd} start") try: Execute(daemon_cmd, user=params.ams_user) except: show_logs(params.ams_monitor_log_dir, params.ams_user) raise pass elif action == 'stop': daemon_cmd = format("{cmd} stop") Execute(daemon_cmd, user=params.ams_user) pass pass pass
def ams_service(name, action): import params if name == 'collector': cmd = format( "{ams_collector_script} --config {ams_collector_conf_dir}") pid_file = format( "{ams_collector_pid_dir}/ambari-metrics-collector.pid") #no_op_test should be much more complex to work with cumulative status of collector #removing as startup script handle it also #no_op_test = format("ls {pid_file} >/dev/null 2>&1 && ps `cat {pid_file}` >/dev/null 2>&1") if params.is_hbase_distributed: if action == 'stop': hbase_service('regionserver', action=action) hbase_service('master', action=action) else: hbase_service('master', action=action) hbase_service('regionserver', action=action) cmd = format("{cmd} --distributed") if action == 'start': Execute(format("{sudo} rm -rf {hbase_tmp_dir}/*.tmp")) if not params.is_hbase_distributed and os.path.exists( format("{zookeeper_data_dir}")): Directory(params.zookeeper_data_dir, action='delete') if not params.is_hbase_distributed: File(format("{ams_collector_conf_dir}/core-site.xml"), action='delete', owner=params.ams_user) File(format("{ams_collector_conf_dir}/hdfs-site.xml"), action='delete', owner=params.ams_user) if params.security_enabled: kinit_cmd = format( "{kinit_path_local} -kt {ams_collector_keytab_path} {ams_collector_jaas_princ};" ) daemon_cmd = format("{kinit_cmd} {cmd} start") else: daemon_cmd = format("{cmd} start") Execute(daemon_cmd, user=params.ams_user) pass elif action == 'stop': daemon_cmd = format("{cmd} stop") Execute(daemon_cmd, user=params.ams_user) pass pass elif name == 'monitor': cmd = format("{ams_monitor_script} --config {ams_monitor_conf_dir}") pid_file = format("{ams_monitor_pid_dir}/ambari-metrics-monitor.pid") no_op_test = format( "ls {pid_file} >/dev/null 2>&1 && ps `cat {pid_file}` >/dev/null 2>&1" ) if action == 'start': daemon_cmd = format("{cmd} start") Execute(daemon_cmd, user=params.ams_user) pass elif action == 'stop': daemon_cmd = format("{cmd} stop") Execute(daemon_cmd, user=params.ams_user) pass pass Logger.info(format("Component {name} finished action={action}."))
def stop(self, env): import params env.set_params(params) hbase_service('zookeeper', action='stop')
def start(self, env): import params env.set_params(params) hbase_service('master', action='start')
def start(self, env): import params env.set_params(params) install_hbase() self.configure(env) hbase_service('zookeeper', action='start')