Amazon ec2 我应该将AWS访问密钥添加到哪个core-site.xml?

Amazon ec2 我应该将AWS访问密钥添加到哪个core-site.xml?,amazon-ec2,amazon-s3,apache-spark,Amazon Ec2,Amazon S3,Apache Spark,我想在EC2上对存储在S3存储桶中的数据运行Spark代码。根据和,我必须将我的AWS_ACCESS_KEY_ID和AWS_SECRET_ACCESS_KEY添加到core-site.xml文件中。然而,当我将shell放入主EC2节点时,我看到几个core-site.xml文件 $ find . -name core-site.xml ./mapreduce/conf/core-site.xml ./persistent-hdfs/share/hadoop/templates/conf/cor

我想在EC2上对存储在S3存储桶中的数据运行Spark代码。根据和,我必须将我的AWS_ACCESS_KEY_ID和AWS_SECRET_ACCESS_KEY添加到core-site.xml文件中。然而,当我将shell放入主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 url,如
s3n://mcneill scratch/GR.txt

我觉得这是不对的。事实并非如此,而且我在文档中找不到任何说明您必须将凭据添加到多个文件的内容


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

/code>/spark/conf/core site.xml应该是正确的位置