在天蓝色斑点中保存火花ML模型

问题描述 投票:1回答:1

我尝试将pyspark中的机器学习模型保存到azure blob。但这是错误的。

lr.save('wasbs:///user/remoteuser/models/')

Illegal Argument Exception: Cannot initialize WASB file system, URI authority not recognized.'

也尝试过,

m = lr.save('wasbs://'+container_name+'@'+storage_account_name+'.blob.core.windows.net/models/')

但无法识别堆栈跟踪中的用户身份。附: :我没有使用Azure HDInsight。我只是使用Databricks和Azure blob存储

azure pyspark azure-storage-blobs databricks
1个回答
0
投票

要直接从Azure Databricks访问Azure Blob存储(未安装),您必须设置一个帐户访问密钥:

spark.conf.set(
  "fs.azure.account.key.<your-storage-account-name>.blob.core.windows.net",
  "<your-storage-account-access-key>")

或容器的SAS。然后你应该能够访问Blob存储:

val df = spark.read.parquet("wasbs://<your-container-name>@<your-storage-account-name>.blob.core.windows.net/<your-directory-name>")
© www.soinside.com 2019 - 2024. All rights reserved.