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

Databricks Runtime 16.4中spark.scheduler.allocation.file配置问题

解决Databricks Runtime 16.4中spark.scheduler.allocation.file配置报错问题

问题原因

直接使用file:/Workspace/...路径访问工作区文件时,Spark调度器进程没有Workspace文件系统(WSFS)的认证令牌,导致权限验证失败,抛出Missing token错误。

两种可行解决方案

方案1:使用DBFS路径(推荐)

DBFS是Databricks集群默认有权限访问的分布式文件系统,无需额外令牌配置:

  1. 将fairscheduler.xml上传到DBFS(可通过Databricks UI的"数据"页面上传,或用dbutils.fs.cp从Workspace复制:dbutils.fs.cp("file:/Workspace/init/fairscheduler.xml", "dbfs:/init/fairscheduler.xml"))
  2. 修改Spark配置为:
    config("spark.scheduler.allocation.file", "dbfs:/init/fairscheduler.xml")
    

方案2:通过初始化脚本同步到本地文件系统

如果必须使用Workspace中的原文件,可通过集群初始化脚本将文件复制到节点本地路径:

  1. 创建初始化脚本(比如dbfs:/scripts/copy_fairscheduler.sh),内容如下:
    #!/bin/bash
    # 从Workspace复制文件到节点本地临时目录
    databricks fs cp "file:/Workspace/init/fairscheduler.xml" "/tmp/fairscheduler.xml"
    
  2. 在集群配置中添加初始化脚本路径("高级选项"->"初始化脚本")
  3. 修改Spark配置为:
    config("spark.scheduler.allocation.file", "file:/tmp/fairscheduler.xml")
    

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.12 03:13:10