EMR 主节点是否知道其集群 ID?

编程入门 行业动态 更新时间:2024-10-12 14:26:58
本文介绍了EMR 主节点是否知道其集群 ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我希望能够创建 EMR 集群,并让这些集群将消息发送回某个中央队列.为了使其工作,我需要在每个主节点上运行某种代理.这些代理中的每一个都必须在此消息中标识自己,以便接收者知道该消息是关于哪个集群的.

I want to be able to create EMR clusters, and for those clusters to send messages back to some central queue. In order for this to work, I need to have some sort of agent running on each master node. Each one of those agents will have to identify itself in this message so that the recipient knows which cluster the message is about.

主节点是否知道自己的ID(j-****************)?如果不是,那么是否还有其他一些识别信息可以让消息接收者推断出此 ID?

Does the master node know its ID (j-*************)? If not, then is there some other piece of identifying information that could allow the message recipient to infer this ID?

我查看了 /home/hadoop/conf 中的配置文件,但没有发现任何有用的信息.我在 /mnt/var/log/instance-controller/instance-controller.log 中找到了 ID,但它看起来很难 grep.我想知道实例控制器首先可以从哪里获得该 ID.

I've taken a look through the config files in /home/hadoop/conf, and I haven't found anything useful. I found the ID in /mnt/var/log/instance-controller/instance-controller.log, but it looks like it'll be difficult to grep for. I'm wondering where instance-controller might get that ID from in the first place.

推荐答案

您可以查看主节点上的 /mnt/var/lib/info/ 以查找有关 EMR 集群设置的大量信息.更具体地说,/mnt/var/lib/info/job-flow.json 包含 jobFlowId 或 ClusterID.

You may look at /mnt/var/lib/info/ on Master node to find lot of info about your EMR cluster setup. More specifically /mnt/var/lib/info/job-flow.json contains the jobFlowId or ClusterID.

您可以使用预先安装的 json 解析器 (jq) 来获取作业流 ID.

You can use the pre-installed json parser (jq) to get the jobflow id.

cat /mnt/var/lib/info/job-flow.json | jq -r ".jobFlowId"

(根据@Marboni 更新)

(updated as per @Marboni)

更多推荐

EMR 主节点是否知道其集群 ID?

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

发布评论

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

>www.elefans.com

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