分享

bin/hdfs getconf -secondaryNameNodes得不到配置信息

散落在云海 发表于 2015-4-14 19:57:18 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 5 43929
本帖最后由 散落在云海 于 2015-4-15 15:42 编辑

我是想在其他 服务器上配置snn
在 配置文件中配置了但是使用这个命令报错:Incorrect configuration: secondary namenode address dfs.namenode.secondary.http-address is not configured.

这是我的配置文件:
master的hdfs-site.xml:

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
  3. <!--
  4.   Licensed under the Apache License, Version 2.0 (the "License");
  5.   you may not use this file except in compliance with the License.
  6.   You may obtain a copy of the License at
  7.     http://www.apache.org/licenses/LICENSE-2.0
  8.   Unless required by applicable law or agreed to in writing, software
  9.   distributed under the License is distributed on an "AS IS" BASIS,
  10.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11.   See the License for the specific language governing permissions and
  12.   limitations under the License. See accompanying LICENSE file.
  13. -->
  14. <!-- Put site-specific property overrides in this file. -->
  15. <configuration>
  16.         <property>
  17.                 <name>dfs.nameservices</name>
  18.                 <value>cluster1</value>
  19.         </property>
  20.         <property>
  21.                 <name>dfs.namenode.http-address</name>
  22.                 <value>master:50070</value>
  23.         </property>
  24.         <property>
  25.                 <name>dfs.namenode.secondary.http-address</name>
  26.                 <value>slave1:50090</value>
  27.         </property>
  28.         <property>
  29.                 <name>dfs.namenode.name.dir</name>
  30.                 <value>file:///usr/local/hadoop-2.6.0/tmp/dfs/name</value>
  31.         </property>
  32.         <property>
  33.                 <name>dfs.datanode.data.dir</name>
  34.                 <value>file:///usr/local/hadoop-2.6.0/tmp/dfs/data</value>
  35.         </property>
  36.         <property>
  37.                 <name>dfs.replication</name>
  38.                 <value>3</value>
  39.         </property>
  40.         <property>
  41.                 <name>dfs.webhdfs.enabled</name>
  42.                 <value>true</value>
  43.         </property>
  44. </configuration>
复制代码



slave1的hdfs-site.xml:
  1. <configuration>
  2.         <property>
  3.                 <name>dfs.nameservices</name>
  4.                 <value>cluster1</value>
  5.         </property>
  6.         <property>
  7.                 <name>dfs.namenode.http-address</name>
  8.                 <value>master:50070</value>
  9.         </property>
  10.         <property>
  11.                 <name>dfs.namenode.secondary.http-address</name>
  12.                 <value>slave1:50090</value>
  13.         </property>
  14.         <property>
  15.                 <name>dfs.namenode.name.dir</name>
  16.                 <value>file:///usr/local/hadoop-2.6.0/tmp/dfs/name</value>
  17.         </property>
  18.         <property>
  19.                 <name>dfs.datanode.data.dir</name>
  20.                 <value>file:///usr/local/hadoop-2.6.0/tmp/dfs/data</value>
  21.         </property>
  22.         <property>
  23.                 <name>dfs.replication</name>
  24.                 <value>3</value>
  25.         </property>
  26.         <property>
  27.                 <name>dfs.webhdfs.enabled</name>
  28.                 <value>true</value>
  29.         </property>
  30. </configuration>
复制代码


现在有两个问题:
1,在上面两台机器上使用bin/hdfs getconf -secondaryNameNodes都得不到配置信息。
2.在master上启动secondarynamenode会报错:
2015-04-13 18:54:31,884 FATAL org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode: Failed to start secondary namenode
java.net.BindException: Port in use: slave1:50090
    at org.apache.hadoop.http.HttpServer2.openListeners(HttpServer2.java:891)
    at org.apache.hadoop.http.HttpServer2.start(HttpServer2.java:827)
    at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.initialize(SecondaryNameNode.java:276)
    at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.<init>(SecondaryNameNode.java:192)
    at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.main(SecondaryNameNode.java:671)
Caused by: java.net.BindException: Cannot assign requested address
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:444)
    at sun.nio.ch.Net.bind(Net.java:436)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:216)
    at org.apache.hadoop.http.HttpServer2.openListeners(HttpServer2.java:886)
    ... 4 more
端口占用,但是slave1上明明没有占用。而且如果在slave1上启动secondarynamenode的话就没有问题。
请问是什么原因?

已有(5)人评论

跳转到指定楼层
jixianqiuxue 发表于 2015-4-15 08:12:00


hdfs-site.xml
   <property>
                <name>dfs.namenode.secondary.http-address</name>
                <value>slave1:50090</value>
        </property>
改成master比如:
       <property>
                <name>dfs.namenode.secondary.http-address</name>
               <value>master:9001</value>
       </property>
配置文件错了。

更多参考这个:
hadoop2.2完全分布式最新高可靠安装文档





回复

使用道具 举报

yongjian3311 发表于 2015-4-15 13:21:13
我也是直接把secondarynamenode放在master上了
回复

使用道具 举报

散落在云海 发表于 2015-4-15 15:40:40
jixianqiuxue 发表于 2015-4-15 08:12
hdfs-site.xml
改成master比如:
配置文件错了。

哎,我是想secondary设置在其他服务器上。
回复

使用道具 举报

hyj 发表于 2015-4-15 16:50:05
散落在云海 发表于 2015-4-15 15:40
哎,我是想secondary设置在其他服务器上。

参考下这篇文章

hadoop2.X如何将namenode与SecondaryNameNode分开配置

回复

使用道具 举报

hyj 发表于 2015-4-15 16:58:08

应该还是配置的问题,master可能是按照默认的namenode和sendarynamenode的方式启动的,但是读取配置的时候,有的地方没有修改。
也就是说配置文件有的地方修改了,有的地方没有修改过来。
查看下master上的端口50090是什么情况,


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条