运行 在 EMR 上安装应用程序后所有节点上的脚本
Run script on all nodes after application installed on EMR
Bootstrap actions run before Amazon EMR installs the applications that
you specify when you create the cluster and before cluster nodes begin
processing data. If you add nodes to a running cluster, bootstrap
actions also run on those nodes in the same way. You can create custom
bootstrap actions and specify them when you create your cluster.
https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-bootstrap.html
我需要在所有节点上安装应用程序后对其进行修补 (presto)。一些可能的解决方案是
- 无密码 ssh,但出于某些安全考虑,我们禁用了它。
- 在 bootstrap 中安排一个 cron 作业并检查是否已安装该应用程序然后对其进行操作。
- 使用ssm。但还没有真正尝试过。
有什么想法吗?
[更新]
在我们的案例中实际完成的是在 bootstrap 脚本中安排后台脚本 (&
),它不会阻塞 bootstrap。在作业中,它会定期检查软件包是否已安装,如果已安装(例如rpm -q presto
),然后对其进行修补。
我相信你可以使用EMR steps to do this. Here is a somewhat relevant 说明如何使用它。
更新:
- 您不能使用 EMR 步骤,因为只有步骤 run on the master。
Bootstrap actions run before Amazon EMR installs the applications that you specify when you create the cluster and before cluster nodes begin processing data. If you add nodes to a running cluster, bootstrap actions also run on those nodes in the same way. You can create custom bootstrap actions and specify them when you create your cluster.
https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-bootstrap.html
我需要在所有节点上安装应用程序后对其进行修补 (presto)。一些可能的解决方案是
- 无密码 ssh,但出于某些安全考虑,我们禁用了它。
- 在 bootstrap 中安排一个 cron 作业并检查是否已安装该应用程序然后对其进行操作。
- 使用ssm。但还没有真正尝试过。
有什么想法吗?
[更新]
在我们的案例中实际完成的是在 bootstrap 脚本中安排后台脚本 (&
),它不会阻塞 bootstrap。在作业中,它会定期检查软件包是否已安装,如果已安装(例如rpm -q presto
),然后对其进行修补。
我相信你可以使用EMR steps to do this. Here is a somewhat relevant
更新:
- 您不能使用 EMR 步骤,因为只有步骤 run on the master。