有一个名为的运算符DataprocClusterCreateOperator将为您创建 Dataproc 集群。检查https://airflow.apache.org/_api/airflow/contrib/operators/dataproc_operator/index.html#module-airflow.contrib.operators.dataproc_operatorDataprocClusterCreateOperator的文档from airflow.contrib.operators import dataproc_operatorcreate_dataproc_cluster = dataproc_operator.DataprocClusterCreateOperator( task_id='create_dataproc_cluster', # Give the cluster a unique name by appending the date scheduled. # See https://airflow.apache.org/code.html#default-variables cluster_name='hadoop-cluster', num_workers=2, zone='europe-west1-b', master_machine_type='n1-standard-1', worker_machine_type='n1-standard-1', dag=dag)