本文介绍了如何使用Ambari检索名称节点主机名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
python-ambariclient 库具有用于检索host_components的api:
ambari.services(service_name)ponents(component_name).host_components如何为IBM Analytics Engine集群提取name_node?
我想打个电话:
GET xxxx.bi.services.us-south.bluemix:9443/api/v1/clusters/AnalyticsEngine/services/HDFS/components/NAMENODE?fields=host_components检索以下信息:
{ "href" : "xxxx.bi.services.us-south.bluemix:9443/api/v1/clusters/AnalyticsEngine/services/HDFS/components/NAMENODE?fields=host_components", "ServiceComponentInfo" : { "cluster_name" : "AnalyticsEngine", "component_name" : "NAMENODE", "service_name" : "HDFS" }, "host_components" : [ { "href" : "xxxx.bi.services.us-south.bluemix:9443/api/v1/clusters/AnalyticsEngine/hosts/xxxx.bi.services.us-south.bluemix/host_components/NAMENODE", "HostRoles" : { "cluster_name" : "AnalyticsEngine", "component_name" : "NAMENODE", "host_name" : "xxxx.bi.services.us-south.bluemix" } } ] }解决方案
我创建了一个库来提取此信息.安装方式:
pip install --quiet --upgrade git+github/snowch/ibm-analytics-engine-python@master然后运行:
from ibm_analytics_engine import AmbariOperations ambari_ops = AmbariOperations(vcap_filename='./vcap.json') ambari_ops.get_namenode_hostname()The python-ambariclient library has an api for retrieving the host_components:
ambari.services(service_name)ponents(component_name).host_componentsHow can I extract the name_node for an IBM Analytics Engine cluster?
I think I need to make the call:
GET xxxx.bi.services.us-south.bluemix:9443/api/v1/clusters/AnalyticsEngine/services/HDFS/components/NAMENODE?fields=host_componentsWhich retrieves the following information:
{ "href" : "xxxx.bi.services.us-south.bluemix:9443/api/v1/clusters/AnalyticsEngine/services/HDFS/components/NAMENODE?fields=host_components", "ServiceComponentInfo" : { "cluster_name" : "AnalyticsEngine", "component_name" : "NAMENODE", "service_name" : "HDFS" }, "host_components" : [ { "href" : "xxxx.bi.services.us-south.bluemix:9443/api/v1/clusters/AnalyticsEngine/hosts/xxxx.bi.services.us-south.bluemix/host_components/NAMENODE", "HostRoles" : { "cluster_name" : "AnalyticsEngine", "component_name" : "NAMENODE", "host_name" : "xxxx.bi.services.us-south.bluemix" } } ] }解决方案
I have created a library to extract this information. Install with:
pip install --quiet --upgrade git+github/snowch/ibm-analytics-engine-python@masterThen run:
from ibm_analytics_engine import AmbariOperations ambari_ops = AmbariOperations(vcap_filename='./vcap.json') ambari_ops.get_namenode_hostname()
更多推荐
如何使用Ambari检索名称节点主机名?
发布评论