如何使用Ambari检索名称节点主机名?

编程入门 行业动态 更新时间:2024-10-14 22:15:29
本文介绍了如何使用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_components

How 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_components

Which 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@master

Then run:

from ibm_analytics_engine import AmbariOperations ambari_ops = AmbariOperations(vcap_filename='./vcap.json') ambari_ops.get_namenode_hostname()

更多推荐

如何使用Ambari检索名称节点主机名?

本文发布于:2023-11-28 13:45:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1642650.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:节点   如何使用   主机名   名称   Ambari

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!