【问题标题】:Which core-site.xml do I add my AWS access keys to?我应该将 AWS 访问密钥添加到哪个 core-site.xml?
【发布时间】:2014-12-05 22:32:15
【问题描述】:

我想针对存储在我的 S3 存储桶中的数据在 EC2 上运行 Spark 代码。根据Spark EC2 documentationAmazon S3 documentation,我必须将我的 AWS_ACCESS_KEY_ID 和 AWS_SECRET_ACCESS_KEY 添加到 core-site.xml 文件中。但是,当我进入我的主 EC2 节点时,我看到了几个 core-site.xml 文件。

$ find . -name core-site.xml
./mapreduce/conf/core-site.xml
./persistent-hdfs/share/hadoop/templates/conf/core-site.xml
./persistent-hdfs/src/packages/templates/conf/core-site.xml
./persistent-hdfs/src/contrib/test/core-site.xml
./persistent-hdfs/src/test/core-site.xml
./persistent-hdfs/src/c++/libhdfs/tests/conf/core-site.xml
./persistent-hdfs/conf/core-site.xml
./ephemeral-hdfs/share/hadoop/templates/conf/core-site.xml
./ephemeral-hdfs/src/packages/templates/conf/core-site.xml
./ephemeral-hdfs/src/contrib/test/core-site.xml
./ephemeral-hdfs/src/test/core-site.xml
./ephemeral-hdfs/src/c++/libhdfs/tests/conf/core-site.xml
./ephemeral-hdfs/conf/core-site.xml
./spark-ec2/templates/root/mapreduce/conf/core-site.xml
./spark-ec2/templates/root/persistent-hdfs/conf/core-site.xml
./spark-ec2/templates/root/ephemeral-hdfs/conf/core-site.xml
./spark-ec2/templates/root/spark/conf/core-site.xml
./spark/conf/core-site.xml

经过一些实验,我确定只有将我的凭据添加到 mapreduce/conf/core-site.xml 和 spark/conf/core-site.xml 才能从 Spark 访问像 s3n://mcneill-scratch/GR.txt 这样的 s3n url。

这对我来说似乎是错误的。这不是DRY,我在文档中找不到任何说明您必须将凭据添加到多个文件的内容。

修改多个文件是否是通过 core-site.xml 设置 s3 凭据的正确方法?是否有文档可以解释这一点?

【问题讨论】:

    标签: amazon-ec2 amazon-s3 apache-spark


    【解决方案1】:

    ./spark/conf/core-site.xml 应该是正确的地方

    【讨论】:

      猜你喜欢
      • 2017-03-03
      • 1970-01-01
      • 2020-07-24
      • 1970-01-01
      • 2017-08-12
      • 1970-01-01
      • 2015-08-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多