我们在Azure中运行HDInsight群集,但它不允许在群集创建时启动边缘/网关节点。所以我通过安装
创建了这个边缘/网关节点echo 'deb http://private-repo-1.hortonworks.com/HDP/ubuntu14/2.x/updates/2.4.2.0 HDP main' >> /etc/apt/sources.list.d/HDP.list
echo 'deb http://private-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/ubuntu14 HDP-UTILS main' >> /etc/apt/sources.list.d/HDP.list
echo 'deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/azurecore/ trusty main' >> /etc/apt/sources.list.d/azure-public-trusty.list
gpg --keyserver pgp.mit.edu --recv-keys B9733A7A07513CAD
gpg -a --export 07513CAD | apt-key add -
gpg --keyserver pgp.mit.edu --recv-keys B02C46DF417A0893
gpg -a --export 417A0893 | apt-key add -
apt-get -y install openjdk-7-jdk
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
apt-get -y install hadoop hadoop-hdfs hadoop-yarn hadoop-mapreduce hadoop-client openssl libhdfs0 liblzo2-2 liblzo2-dev hadoop-lzo phoenix hive hive-hcatalog tez mysql-connector-java* oozie oozie-client sqoop flume flume-agent spark spark-python spark-worker spark-yarn-shuffle
然后我复制了/usr/lib/python2.7/dist-packages/hdinsight_common/
/usr/share/java/
/usr/lib/hdinsight-datalake/
/etc/spark/conf/
/etc/hadoop/conf/
但是当我运行spark-shell
时出现以下错误
java.io.IOException: No FileSystem for scheme: wasb
这是完整堆栈https://gist.github.com/anonymous/ebb6c9d71865c9c8e125aadbbdd6a5bc
我不确定这里缺少哪个包/罐。
任何人都知道我做错了什么?
由于
答案 0 :(得分:3)
在spark-shell中设置Azure存储(wasb和wasbs文件)的另一种方法是:
使用参数-jars运行spark-shell [以逗号分隔的列表以及到这些jar的路由]示例:
$ bin/spark-shell --master "local[*]" --jars jars/hadoop-azure-2.7.0.jar,jars/azure-storage-2.0.0.jar
将以下行添加到Spark上下文:
sc.hadoopConfiguration.set("fs.azure", "org.apache.hadoop.fs.azure.NativeAzureFileSystem")
sc.hadoopConfiguration.set("fs.azure.account.key.my_account.blob.core.windows.net", "my_key")
运行简单查询:
sc.textFile("wasb://my_container@my_account_host/myfile.txt").count()
使用此设置,您可以轻松设置Spark应用程序,将参数传递给' hadoopConfiguration'在当前的Spark上下文
答案 1 :(得分:0)
来自微软的Hai Ning撰写了一篇关于在apache hadoop安装上设置wasb的优秀博客文章。
以下是摘要:
将hadoop-azure-*.jar
和azure-storage-*.jar
添加到hadoop classpath
1.1在本地安装中找到罐子。它位于HDInsight群集上的/ usr / hdp / current / hadoop-client文件夹中。
1.2 HADOOP_CLASSPATH
更新hadoop-env.sh
变量。使用精确的jar名称作为java classpath并不支持部分通配符。
更新core-site.xml
<property>
<name>fs.AbstractFileSystem.wasb.Impl</name>
<value>org.apache.hadoop.fs.azure.Wasb</value>
</property>
<property>
<name>fs.azure.account.key.my_blob_account_name.blob.core.windows.net</name>
<value>my_blob_account_key</value>
</property>
<!-- optionally set the default file system to a container -->
<property>
<name>fs.defaultFS</name>
<value>wasb://my_container_name@my_blob_account_name.blob.core.windows.net</value>
</property>
请参阅此处的确切步骤: https://github.com/hning86/articles/blob/master/hadoopAndWasb.md