标签: apache-spark pyspark google-cloud-dataproc
假设我使用dataproc工作流模板和临时集群来运行pyspark作业...如何获取在pyspark作业中创建的集群的名称
答案 0 :(得分:2)
一种方法是派出并运行以下命令:
/usr/share/google/get_metadata_value attributes/dataproc-cluster-name
唯一的输出将是集群名称,没有任何换行符或其他要清除的内容。参见Running shell command and capturing the output