Haddop 配置引起的
WARN org.mortbay.log: /getimage: java.io.IOException: GetImage failed. java.io.IOException: Content-Length header is not provided by the namenode when trying to fetch http://127.0.1.1:50090/getimage?getimage=1
WARN org.mortbay.log: /getimage: java.io.IOException: GetImage failed. java.io.IOException: Content-Length header is not provided by the namenode when trying to fetch http://127.0.1.1:50090/getimage?getimage=1
最近在翻看NameNode的log時發現經常有這一段信息出現:
看來是SecondNameNode在向NameNode獲取Image時出的問題。雖然不影響hdfs使用,但是SecondName
備份功能失效,任其下去萬一NameNode掛了那可就無處申冤了。
經過Google大神幫助,得知需要在hdfs-site.xml中手動配置dfs.secondary.http.address,這個配置項的默認值如下
<property>
<name>dfs.namenode.secondary.http-address</name>
<value>0.0.0.0:50090</value>
<description>
The secondary namenode http server address and port.
If the port is 0 then the server will start on a free port.
</description>
</property>
<name>dfs.namenode.secondary.http-address</name>
<value>0.0.0.0:50090</value>
<description>
The secondary namenode http server address and port.
If the port is 0 then the server will start on a free port.
</description>
</property>
需要明確指明SecondName,與conf/master里面的名稱一樣
<property>
<name>dfs.namenode.secondary.http-address</name>
<value>test-dn2:50090</value>
<description>
The secondary namenode http server address and port.
If the port is 0 then the server will start on a free port.
</description>
</property>
<name>dfs.namenode.secondary.http-address</name>
<value>test-dn2:50090</value>
<description>
The secondary namenode http server address and port.
If the port is 0 then the server will start on a free port.
</description>
</property>