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

如何通过CLI配置Databricks任务集群的无隔离共享访问模式?

在Databricks Jobs CLI中配置Unity Catalog访问模式

当使用databricks jobs create --json-file命令创建任务时,需在JSON配置文件的集群定义部分添加access_mode字段,以此指定Unity Catalog的访问模式。

具体配置示例

如果任务使用新建集群(new_cluster),JSON文件结构可参考如下:

{
  "name": "UC-enabled Task Job",
  "tasks": [
    {
      "task_key": "uc_task",
      "spark_python_task": {
        "python_file": "/Workspace/Repos/user@example.com/uc_demo/script.py"
      },
      "new_cluster": {
        "spark_version": "13.3.x-scala2.12",
        "node_type_id": "Standard_DS3_v2",
        "num_workers": 1,
        "access_mode": "SHARED",  // 此处指定访问模式
        "spark_conf": {
          "spark.databricks.delta.formatCheck.enabled": "false"
        }
      }
    }
  ]
}

可选的访问模式取值

  • SINGLE_USER:单用户模式,集群仅对任务所有者或指定用户可用
  • SHARED:共享模式,支持多用户访问并遵循Unity Catalog权限规则
  • NO_ISOLATION_SHARED:无隔离共享模式,适合非生产环境下的多用户协作

注意事项

  • 若任务使用现有集群(existing_cluster_id),访问模式由该集群本身的配置决定,无需在任务JSON中重复设置
  • 需确保指定的Spark版本支持Unity Catalog访问模式,建议使用Databricks Runtime 11.3及以上版本

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.20 14:54:31