gpt4 book ai didi

hadoop - 如何在 EMR 集群的所有节点上执行 shell 脚本?

转载 作者:可可西里 更新时间:2023-11-01 14:57:23 26 4
gpt4 key购买 nike

是否有合适的方法在正在运行的 EMR hadoop 集群中的每个节点上执行 shell 脚本?

我寻找的一切都会带来引导操作,但这只适用于集群启动时,不适用于正在运行的集群。

我的应用程序使用的是 python,所以我目前的猜测是使用 boto 列出集群中每个节点的 IP,然后遍历每个节点并通过 ssh 执行 shell 脚本。

有没有更好的办法?

最佳答案

如果您的集群已经启动,您应该使用步骤

这些步骤是在集群启动后执行的,因此从技术上讲它似乎就是您要查找的内容。

注意,步骤仅在主节点上执行,您应该以某种方式连接到其余节点以修改它们。

Steps are scripts as well, but they run only on machines in the Master-Instance group of the cluster. This mechanism allows applications like Zookeeper to configure the master instances and allows applications like Hbase and Apache Drill to configure themselves.

Reference

参见 this还有。

关于hadoop - 如何在 EMR 集群的所有节点上执行 shell 脚本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36102316/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com