• fs.default.name和fs.defaultFS


    在hadoop的配置文件 core-site.xml中,需要设置 fs.default.name 或 fs.defaultFS ,具体应该使用哪一个,会造什么样的错误,需要在实际操作中去验证。官网有下面这段描述

    We need to have only one of the two (fs.default.name or fs.defaultFS, and the former is deprecated). If both are present then NN HA will be enabled/disabled based on what is read first.

    Following is description from NN HA in Apache docs:

    fs.defaultFS - the default path prefix used by the Hadoop FS client when none is given.
    Optionally, you may now configure the default path for Hadoop clients to use the new HA-enabled logical URI. If you used "mycluster" as the nameservice ID earlier, this will be the value of the authority portion of all of your HDFS paths. This may be configured like so, in your core-site.xml file:

    <property>
        <name>fs.defaultFS</name>
        <value>hdfs://mycluster</value>
    </property>

    从文档中可以看出,使用 fs.default.name 还是 使用 fs.defaultFS ,要首先判断是否开启了 NN 的HA (namenode 的 highavaliable),如果开启了nn ha,那么就用fs.defaultFS,在单一namenode的情况下,就用 fs.default.name , 如果在单一namenode节点的情况使用 fs.defaultFS ,系统将报

     ERROR org.apache.hadoop.hdfs.server.namenode.NameNode: Failed to start namenode.
    java.lang.IllegalArgumentException: Invalid URI for NameNode address (check fs.defaultFS): file:/// has no authority.
            at org.apache.hadoop.hdfs.server.namenode.NameNode.getAddress(NameNode.java:471)
            at org.apache.hadoop.hdfs.server.namenode.NameNode.getAddress(NameNode.java:461)
            at org.apache.hadoop.hdfs.server.namenode.NameNode.getRpcServerAddress(NameNode.java:512)
            at org.apache.hadoop.hdfs.server.namenode.NameNode.loginAsNameNodeUser(NameNode.java:612)
            at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:632)
            at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:811)
            at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:795)
            at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1488)
            at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1554)
    INFO org.apache.hadoop.util.ExitUtil: Exiting with status 1
    INFO org.apache.hadoop.hdfs.server.namenode.NameNode: SHUTDOWN_MSG: 
    ————————————————
    版权声明:本文为CSDN博主「lepton126」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/lepton126/article/details/88327205

  • 相关阅读:
    当你发现前端传过来的空格是 xa0
    反转义——使从文件读取的失效的转义字符串生效
    openpyxl 读取前端传输的文件,并处理
    django实现下载excel
    IO模块的使用
    pandas 执行sql语句
    近期工作生活小总结
    入职一个月++近期学习++生活总结
    github访问不了
    实现Spring框架(二) SpringMVC框架
  • 原文地址:https://www.cnblogs.com/lishiqi-blog/p/12410373.html
Copyright © 2020-2023  润新知