获得 azure blob 存储的最佳方法是什么

编程入门 行业动态 更新时间:2024-10-14 14:14:07
本文介绍了获得 azure blob 存储的最佳方法是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在使用 scala 和 spark,需要访问 azure blob 存储并获取其文件列表.知道 Spark 版本是 2.11 的最佳方法是什么.

I'm working with scala and spark and need to access azure blob storage and get its list of files. What is the best way to do that knowing spark version is 2.11.

推荐答案

对于在本地运行的 Spark,有一个官方的 博客 介绍了如何从 Spark 访问 Azure Blob 存储.关键是你需要在core-site.xml文件中将Azure Storage account配置为HDFS兼容的存储,并添加两个jars hadoop-azure &azure-storage 到您的类路径,以便通过 wasb[s] 协议访问 HDFS.可以参考官方教程 了解与 wasb 兼容的 HDFS 存储,以及 博客 有关 HDInsight 配置的更多详细信息.对于在Azure上运行的Spark,区别只是只用wasb访问HDFS,其他的准备工作都由Azure在使用 Spark 创建 HDInsight 集群.列出文件的方法是 listFiles 或 WholeTextFiles of SparkContext For Spark running on local, there is an official blog which introduces how to access Azure Blob Storage from Spark. The key is that you need to configure Azure Storage account as HDFS-compatible storage in core-site.xml file and add two jars hadoop-azure & azure-storage to your classpath for accessing HDFS via the protocol wasb[s]. You can refer to the official tutorial to know HDFS-compatible storage with wasb, and the blog about configuration for HDInsight more details. For Spark running on Azure, the difference is just only access HDFS with wasb, the other preparations has been done by Azure when creating HDInsight cluster with Spark. The method for listing files is listFiles or wholeTextFiles of SparkContext

这篇关于获得 azure blob 存储的最佳方法是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-18 19:19:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/947168.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:方法   azure   blob

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!