微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何从基于Linux的Hadoop客户端使用Azure blob存储?

这是我的设置:

带有wasb://mybucket HDInsights Hadoop集群设置为认的FS。

安装有HDP 2.2 RPM软件包的CentOS虚拟机。 (让我们称之为client1)

我想要做的是:

local1 > ssh client1 client1> hadoop fs -ls / #list contents of blob storage bucket.

我已将以下密钥从hdinsights头节点上的core-site.xml复制到/etc/hadoop/conf/core-site.xml :

fs.defaultFs – wasb:// …

fs.azure.account.key.mybucket.blob.core.windows.net – 随机string

fs.azure.account.keyprovider.mybucket.blob.core.windows.net – ...ShellDecryptionKeyProvider

不幸的是,这需要一个ShellDecryptionKeyProvider来呼叫。 在Windows上,这是一个命令行可执行文件。 我不知道如何为Linux提供。

Windows Azure Node.jsdebugging

如何使用Azure CLI资源pipe理部署模式创build端点(入站安全规则)?

Windows Azure平台如何扩展我的应用程序?

Azure Powershell模块 – Linux(.NET核心)支持

具有多个实例的Node.js Azure WorkerRole不能使用相同的端口?

这是输出

[rathboma@client1 yum.repos.d]$ hadoop fs -ls / 15/03/04 23:02:12 INFO impl.MetricsConfig: loaded properties from hadoop-metrics2.properties 15/03/04 23:02:13 INFO impl.MetricsSystemImpl: Scheduled snapshot period at 10 second(s). 15/03/04 23:02:13 INFO impl.MetricsSystemImpl: azure-file-system metrics system started ls: org.apache.hadoop.fs.azure.KeyProviderException: Script path is not specified via fs.azure.shellkeyprovider.script

有没有人设法从Azure上的Linux机器上谈blob存储? 我如何需要configuration它?

Windows Azure虚拟机在缩放时访问networking速度很慢

如何保护在Windows Azure上运行的odata服务

在Windows Azure Web上获取反馈无法部署的angular色?

ClientPerfCountersInstaller.exe停止工作,现在无法运行Azure解决scheme

将文本追加到Azure中的Blob

它不是试图使用Hadoop fs命令,而是直接访问存储? 如果你看https://www.npmjs.com/package/azure-storage,你会发现你可以通过Node直接访问blob存储,而不是依赖于Hadoop类。 以下示例应列出存储容器中的所有文件/ blob:

var account = 'storaccount' // This is just the first part of the storage account name (the part before the first '.'') var key = 'BASE64KEYGOESHERE==' // Retrieve the key from the Storage section of the Azure Portal var container = 'clustercontainer' // this is the container name associated with the cluster var azure = require('azure-storage'); var blobService = azure.createBlobService(account,key); var i = 0; var ct=null; do { blobService.listBlobsSegmented(container,ct,function(error,result,response){ if(!error){ i++; console.log("Result set",i,":") for(var blob in result.entries) { console.log(result.entries[blob].name); } console.log("Continuation? : ",result.continuationToken); ct = result.continuationToken; } else { ct = null; console.log("Error:"); console.log(error); } }); } while(ct);

还有其他几个可用的API( Java , Python )或跨平台的CLI( https://github.com/Azure/azure-xplat-cli ),可能更适合您的交互方式与存储。

如果你真的想尝试使用client1的Hadoop fs函数,你可以尝试从client1的设置文件删除fs.azure.account.keyprovider.mybucket.blob.core.windows.net属性,然后把未加密的存储访问键入fs.azure.account.key.mybucket.blob.core.windows.net 。 如果没有指定密钥提供者,则访问密钥应该原样使用。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐