def service_check(self, env): from params import params # check the parsers Logger.info("Performing Parser service check") parser_cmds = ParserCommands(params) parser_cmds.service_check(env) # check enrichment Logger.info("Performing Enrichment service check") enrichment_cmds = EnrichmentCommands(params) enrichment_cmds.service_check(env) # check indexing Logger.info("Performing Indexing service check") indexing_cmds = IndexingCommands(params) indexing_cmds.service_check(env) # check the profiler Logger.info("Performing Profiler service check") profiler_cmds = ProfilerCommands(params) profiler_cmds.service_check(env) # check the rest api Logger.info("Performing REST application service check") rest_cmds = RestCommands(params) rest_cmds.service_check(env) # check the management UI Logger.info("Performing Management UI service check") mgmt_cmds = ManagementUICommands(params) mgmt_cmds.service_check(env) # check the alerts UI Logger.info("Performing Alerts UI service check") alerts_cmds = AlertsUICommands(params) alerts_cmds.service_check(env) Logger.info("Metron service check completed successfully") exit(0)
def status(self, env): from params import status_params env.set_params(status_params) commands = ProfilerCommands(status_params) if not commands.is_topology_active(env): raise ComponentIsNotRunning()
def stop(self, env, upgrade_type=None): from params import params env.set_params(params) commands = ProfilerCommands(params) commands.stop_profiler_topology(env)
def start(self, env, upgrade_type=None): from params import params env.set_params(params) self.configure(env) commands = ProfilerCommands(params) if params.security_enabled: metron_security.kinit(params.kinit_path_local, params.metron_keytab_path, params.metron_principal_name, execute_user=params.metron_user) if params.security_enabled and not commands.is_hbase_acl_configured(): commands.set_hbase_acls() if params.security_enabled and not commands.is_acl_configured(): commands.init_kafka_acls() commands.set_acl_configured() commands.start_profiler_topology(env)
def configure(self, env, upgrade_type=None, config_dir=None): from params import params env.set_params(params) Logger.info("Running profiler configure") File(format("{metron_config_path}/profiler.properties"), content=Template("profiler.properties.j2"), owner=params.metron_user, group=params.metron_group ) if not metron_service.is_zk_configured(params): metron_service.init_zk_config(params) metron_service.set_zk_configured(params) metron_service.refresh_configs(params) commands = ProfilerCommands(params) if not commands.is_hbase_configured(): commands.create_hbase_tables() if params.security_enabled and not commands.is_hbase_acl_configured(): commands.set_hbase_acls() if params.security_enabled and not commands.is_acl_configured(): commands.init_kafka_acls() commands.set_acl_configured() Logger.info("Calling security setup") storm_security_setup(params) if not commands.is_configured(): commands.set_configured()
def restart(self, env): from params import params env.set_params(params) self.configure(env) commands = ProfilerCommands(params) commands.restart_profiler_topology(env)