将关闭脚本添加到 Dataproc 实例
Add shutdown script to Dataproc instance
我正在通过 REST API(ZEPPELIN 类型)创建 Dataproc 集群。在关闭之前,我想将一些设置复制到 GS(例如 Interpreter 实例),然后在启动后加载它。初始化部分使用 initializationActions
选项很容易,但我找不到任何选项来设置一些将在关闭前在其中一个节点上执行的脚本。计算实例本身包含这样的选项 (https://cloud.google.com/compute/docs/shutdownscript) 但如何通过 REST API?
将其与集群创建集成
我是否应该在创建集群后执行额外的 REST 调用,例如 https://cloud.google.com/compute/docs/startupscript#startupscriptrunninginstances?
Dataproc 创建 API 也可以获取 GCE 元数据。您通过设置元数据
ClusterConfig.GceClusterConfig
在您的情况下,它将是键:"shutdown-script",值:"content of the script"。
我正在通过 REST API(ZEPPELIN 类型)创建 Dataproc 集群。在关闭之前,我想将一些设置复制到 GS(例如 Interpreter 实例),然后在启动后加载它。初始化部分使用 initializationActions
选项很容易,但我找不到任何选项来设置一些将在关闭前在其中一个节点上执行的脚本。计算实例本身包含这样的选项 (https://cloud.google.com/compute/docs/shutdownscript) 但如何通过 REST API?
我是否应该在创建集群后执行额外的 REST 调用,例如 https://cloud.google.com/compute/docs/startupscript#startupscriptrunninginstances?
Dataproc 创建 API 也可以获取 GCE 元数据。您通过设置元数据 ClusterConfig.GceClusterConfig
在您的情况下,它将是键:"shutdown-script",值:"content of the script"。