根据我的研究,霍顿工厂和将HDFS从本地磁盘替换为s3获取错误的指导方针告诉我,我需要在$hadoop_home/etc/hadoop下修改core-site.xml。
我的修改如下:
<property>
<name>fs.s3a.access.key</name>
<value>xxxxxxxxxxxxxx</value>
</property>
<property>
<name>fs.s3a.secret.key</name>
<value>xxxxxxxxxxxxx</value>
</property>
<property>
<name>fs.default.name</name>
<value>s3a://bucket_name</value>
</property>
<property>
<name>fs.defaultFS</name>
<value>s3a://bucket_name</value>
</property>
<property>
<name>fs.s3a.endpoint</name>
<value>http://x.x.x.x:xxxx</value>
</property>
<property>
<name>fs.AbstractFileSystem.s3a.imp</name>
<value>org.apache.hadoop.fs.s3a.S3A</value>
</property>然而,当我试图通过sbin/start-all.sh启动hadoop时,我发现了如下所示的错误,
java.lang.IllegalArgumentException: Invalid URI for NameNode address (check fs.defaultFS): s3a://bucket_name is not of scheme 'hdfs'.关于您的信息,我的hadoop版本是3.2.0。
谢谢你提前帮忙。
发布于 2019-07-27 09:46:17
在深入研究hadoop源代码之后,我认为应该抛出这个异常。
当您试图调用sbin/start-all.sh时,不能跳过下面的代码。
/**
* @return address of file system
*/
public static InetSocketAddress getNNAddress(URI filesystemURI) {
String authority = filesystemURI.getAuthority();
if (authority == null) {
throw new IllegalArgumentException(String.format(
"Invalid URI for NameNode address (check %s): %s has no authority.",
FileSystem.FS_DEFAULT_NAME_KEY, filesystemURI.toString()));
}
if (!HdfsConstants.HDFS_URI_SCHEME.equalsIgnoreCase(
filesystemURI.getScheme())) {
throw new IllegalArgumentException(String.format(
"Invalid URI for NameNode address (check %s): " +
"%s is not of scheme '%s'.", FileSystem.FS_DEFAULT_NAME_KEY,
filesystemURI.toString(), HdfsConstants.HDFS_URI_SCHEME));
}
return getNNAddress(authority);
}我不需要启动namenode和secondarynamenode,因为我使用ceph作为后端存储系统。datanode本身就可以通过它的driver来管理它的所谓的driver。
为任何可能有同样关心的人保留这条线索,并欢迎任何关于我理解的评论。
https://stackoverflow.com/questions/57229947
复制相似问题