Example #1
0
 def Atlas_get_host(cls, logoutput=True):
     try:
         # TODO: change it to get the atlas host from beaver atlas
         from beaver.component.ambari import Ambari
         return Ambari.getServiceHosts("ATLAS", "ATLAS_SERVER")
     except Exception:
         if logoutput:
             logger.error("Exception occured during Atlas_get_host() call")
             logger.error(traceback.format_exc())
         return None
Example #2
0
 def Ambari_infra_solrclient_get_hosts(cls, logoutput=True):
     try:
         from beaver.component.ambari import Ambari
         return Ambari.getServiceHosts("AMBARI_INFRA", "INFRA_SOLR_CLIENT")
     except Exception:
         if logoutput:
             logger.error(
                 "Exception occured during get Ambari_infra_solrclient_get_hosts call"
             )
             logger.error(traceback.format_exc())
             return None
Example #3
0
 def getKafkaBrokers(cls):
     '''
     Return the hosts where kafka is running
     :return: Array
     '''
     cls.kafka_hosts = Ambari.getServiceHosts(
         "KAFKA", cls.kafka_broker, cluster=cls.get_ambari_cluster_name())
     if not cls.kafka_hosts:
         logger.error(
             'Kafka is not installed on any of hosts in the cluster')
     return cls.kafka_hosts
Example #4
0
 def getStormHost(cls):
     '''
     Return the host where Storm Nimbus service is running
     :return: String
     '''
     cls._storm_host = Ambari.getServiceHosts(
         "STORM", cls.storm_nimbus, cluster=cls.get_ambari_cluster_name())
     if not cls._storm_host:
         logger.error(
             'Storm Nimbus instance is not installed on any of hosts in the cluster'
         )
     return cls._storm_host
Example #5
0
 def getNameNode2Host(cls):
     '''
     Return the host where Secondary Name Node is running
     :return: String
     '''
     cls._host = Ambari.getServiceHosts(
         "HDFS",
         cls.namenode2_component,
         cluster=cls.get_ambari_cluster_name())
     if not cls._host:
         logger.error('Secondary Namenode is not installed on the cluster')
     return cls._host
Example #6
0
 def getZeppelinHost(cls):
     '''
     Return the host where Zeppelin is running
     :return: String
     '''
     cls._host = Ambari.getServiceHosts(
         "ZEPPELIN",
         cls.zeppelin_component,
         cluster=cls.get_ambari_cluster_name())
     if not cls._host:
         logger.error(
             'Zeppelin is not installed on any of hosts in the cluster')
     return cls._host
Example #7
0
 def getESHost(cls):
     '''
     Return the host where Elasticsearch is running
     :return: String
     '''
     cls._es_host = Ambari.getServiceHosts(
         "ELASTICSEARCH",
         cls.es_master,
         cluster=cls.get_ambari_cluster_name())
     if not cls._es_host:
         logger.error(
             'Elasticsearch instance is not installed on any of hosts in the cluster'
         )
     return cls._es_host
Example #8
0
 def getMetronHost(cls):
     '''
     Return the host where metron is running
     :return: String
     '''
     cls._host = Ambari.getServiceHosts(
         "METRON",
         cls.metron_component,
         cluster=cls.get_ambari_cluster_name())
     if not cls._host:
         logger.error(
             'Metron instance is not installed on any of hosts in the cluster'
         )
     return cls._host
Example #9
0
    def get_ranger_admin_host(cls):
        '''
        Return the host where ranger admin is running.
        :return: List
        '''

        if not cls._ranger_admin_hosts:
            cls._ranger_admin_hosts = Ambari.getServiceHosts(
                "RANGER",
                "RANGER_ADMIN",
                cluster=cls.get_ambari_cluster_name(),
                is_hdp=False,
                is_enc=cls.get_ambari_server_ssl())

        return cls._ranger_admin_hosts
Example #10
0
 def get_hosts(cls):
     """
     Return the hosts where smm is running. Detection is done using ambari.
     :return: String
     """
     hosts = Ambari.getServiceHosts(
         "STREAMSMSGMGR",
         cls.smm_master,
         cluster=cls.get_ambari_cluster_name(),
         is_hdp=False,
         is_enc=Ambari.is_ambari_encrypted()
     )
     if not hosts:
         logger.error('SMM instance is not installed on any of hosts in the cluster')
     logger.info("SMM installed on: %s " % hosts)
     return hosts
Example #11
0
 def get_hosts(cls):
     """
     Return the hosts where streamline is running. Detection is done using ambari.
     :return: String
     """
     hosts = Ambari.getServiceHosts(
         "STREAMLINE",
         cls.streamline_master,
         cluster=cls.get_ambari_cluster_name(),
         is_hdp=False,
         is_enc=Nifi.get_ambari_server_ssl()
     )
     if not hosts:
         logger.error('Streamline instance is not installed on any of hosts in the cluster')
     logger.info("Streamline installed on: %s " % hosts)
     return hosts
Example #12
0
 def get_hosts(cls):
     """
     Return the hosts where registry is running. Detection is done using ambari.
     :return: String
     """
     cls._hosts = Ambari.getServiceHosts(
         "REGISTRY",
         cls.schema_registry_server,
         cluster=cls.get_ambari_cluster_name(),
         is_hdp=False,
         is_enc=cls.get_ambari_server_ssl())
     if not cls._hosts:
         logger.error(
             'Registry instance is not installed on any of hosts in the cluster'
         )
     logger.info("Registry installed on: %s ", cls._hosts)
     return cls._hosts
Example #13
0
 def get_hosts(cls):
     '''
     Return the host where atlas is running
     :return: String
     '''
     if Machine.isWindows():
         cls._hosts = ['localhost']
     else:
         cls._hosts = Ambari.getServiceHosts(
             "NIFI",
             cls.nifi_master,
             cluster=cls.get_ambari_cluster_name(),
             is_hdp=False,
             is_enc=cls.get_ambari_server_ssl())
     if not cls._hosts:
         logger.error(
             'NiFi instance is not installed on any of hosts in the cluster'
         )
     return cls._hosts
 def getComponentHosts(self, service, component):
     clust_name = Ambari.getClusterName()
     host_list = Ambari.getServiceHosts(service, component, cluster=clust_name, is_enc=Xa.isWireEncryptionOn())
     hostList = ','.join([str(i) for i in host_list])
     return hostList