如何通过 Cloud Composer 为 Google Cloud Dataproc 设置 CPUS 配额?
how to set CPUS quota for Google Cloud Dataproc via Cloud Composer?
在免费试用帐户中试用 Google Cloud Composer Quickstart,示例工作流 DAG 的第一个任务运行此运算符:
create_dataproc_cluster = dataproc_operator.DataprocClusterCreateOperator(
task_id='create_dataproc_cluster',
cluster_name='quickstart-cluster-{{ ds_nodash }}',
num_workers=2,
zone=models.Variable.get('gce_zone'),
master_machine_type='n1-standard-1',
worker_machine_type='n1-standard-1')
失败并显示此错误消息:
- Insufficient 'CPUS' quota. Requested 6.0, available 2.0
- This request exceeds CPU quota. Some things to try: request fewer workers (a minimum of 2 is required), use smaller master and/or worker machine types (such as n1-standard-2).
2
已经是最小的worker节点数,n1-standard-1
已经是最小的机器类型。
Q.有没有办法让DataprocClusterCreateOperator()
分配更高的'CPUS'配额?
Airflow website and Cloud Dataproc Quotas doc 不会出现。
问。这是免费试用帐户的硬性限制吗?
IAM Quotas console page 显示 Current Usage 为 6、75%,在 4 个条中的第 3 个,暗示配额为 8。
Dataproc 工作机器实际上是 Compute Engine VM,因此 CPU 配额适用于 Compute Engine API。
CPU 配额与 Airflow/Google Cloud Composer 无关,无法从那里进行配置。 DataprocClusterCreateOperator
只需调用 Dataproc APIs,后者会依次在 Compute Engine 上启动虚拟机。
对于免费试用帐户,CPU的配额似乎是 8,如您所见。根据您在评论部分提供的详细信息,您的 Composer 环境使用了这 8 个 CPU 中的 6 个 (3 * n1-standard-2
)。请注意,您可以为 Composer 使用较小的机器 (1 CPU),但您始终至少需要 3 个节点。因此,最小的 Composer 环境将使用 1 * 3 = 3
CPUs。如果需要,您可以在此处保存 3 CPUs,但气流稳定性可能会受到影响。
您还可以为 Dataproc 工作器(或更少的 Dataproc 工作器)请求更小的 VM(CPUs)。同样,我不推荐它,因为 Dataproc worker 的 n1-standard-1
(或更少)太小了。
另请注意,使用 non-free 个试用帐户,您可以 request higher quotas。但是,在免费试用帐户中,我认为这是不可能的。
在免费试用帐户中试用 Google Cloud Composer Quickstart,示例工作流 DAG 的第一个任务运行此运算符:
create_dataproc_cluster = dataproc_operator.DataprocClusterCreateOperator(
task_id='create_dataproc_cluster',
cluster_name='quickstart-cluster-{{ ds_nodash }}',
num_workers=2,
zone=models.Variable.get('gce_zone'),
master_machine_type='n1-standard-1',
worker_machine_type='n1-standard-1')
失败并显示此错误消息:
- Insufficient 'CPUS' quota. Requested 6.0, available 2.0
- This request exceeds CPU quota. Some things to try: request fewer workers (a minimum of 2 is required), use smaller master and/or worker machine types (such as n1-standard-2).
2
已经是最小的worker节点数,n1-standard-1
已经是最小的机器类型。
Q.有没有办法让DataprocClusterCreateOperator()
分配更高的'CPUS'配额?
Airflow website and Cloud Dataproc Quotas doc 不会出现。
问。这是免费试用帐户的硬性限制吗?
IAM Quotas console page 显示 Current Usage 为 6、75%,在 4 个条中的第 3 个,暗示配额为 8。
Dataproc 工作机器实际上是 Compute Engine VM,因此 CPU 配额适用于 Compute Engine API。
CPU 配额与 Airflow/Google Cloud Composer 无关,无法从那里进行配置。 DataprocClusterCreateOperator
只需调用 Dataproc APIs,后者会依次在 Compute Engine 上启动虚拟机。
对于免费试用帐户,CPU的配额似乎是 8,如您所见。根据您在评论部分提供的详细信息,您的 Composer 环境使用了这 8 个 CPU 中的 6 个 (3 * n1-standard-2
)。请注意,您可以为 Composer 使用较小的机器 (1 CPU),但您始终至少需要 3 个节点。因此,最小的 Composer 环境将使用 1 * 3 = 3
CPUs。如果需要,您可以在此处保存 3 CPUs,但气流稳定性可能会受到影响。
您还可以为 Dataproc 工作器(或更少的 Dataproc 工作器)请求更小的 VM(CPUs)。同样,我不推荐它,因为 Dataproc worker 的 n1-standard-1
(或更少)太小了。
另请注意,使用 non-free 个试用帐户,您可以 request higher quotas。但是,在免费试用帐户中,我认为这是不可能的。