You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Google Cloud Dataproc Serverless 2.1 Spark批处理--ttl参数不识别报错求助

解决Dataproc Serverless Spark批处理作业--ttl参数不识别问题

你遇到的--ttl=6h参数不识别问题,是因为该参数并非gcloud dataproc batches submit spark的直接顶层命令参数,需通过正确的配置方式传递TTL设置。以下是两种可行的解决方法:

方法1:使用--batch参数指定TTL

将原命令中的--ttl=6h替换为--batch ttl=6h,完整命令如下:

gcloud dataproc batches submit spark --version=2.1 --region=us-east4 --subnet=$subnet --service-account=$service_account --jars=file:///usr/lib/spark/examples/jars/spark-examples.jar --class=org.apache.spark.examples.SparkPi --batch ttl=6h -- 1000

方法2:通过--properties传递TTL配置

使用--properties参数传递dataproc.batch.ttl配置项来设置生命周期,命令如下:

gcloud dataproc batches submit spark --version=2.1 --region=us-east4 --subnet=$subnet --service-account=$service_account --jars=file:///usr/lib/spark/examples/jars/spark-examples.jar --class=org.apache.spark.examples.SparkPi --properties dataproc.batch.ttl=6h -- 1000

额外检查

确保你的gcloud CLI是最新版本,旧版本可能不支持上述配置方式。运行以下命令更新CLI:

gcloud components update

内容的提问来源于stack exchange,提问作者Adithya

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.04 16:15:18