今天启动Hadoop的时候遇到两个错误:
1. ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: java.io.IOException: Incompatible namespaceIDs in ...
namenode namespaceID = 1691922584; datanode namespaceID = 614022826
数据格式不匹配,需要进行 hadoop namenode -format
2. 2011-05-1 14:30:41,855 ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: java.net.BindException: Problem binding to /0.0.0.0:50010 : Address already in useat org.apache.hadoop.ipc.Server.bind(Server.java:190)at org.apache.hadoop.hdfs.server.datanode.DataNode.startDataNode(DataNode.java:309)at org.apache.hadoop.hdfs.server.datanode.DataNode.<init>(DataNode.java:216)
50010端口被占用,在hdfs-site.xml中改成其他端口号
<property>
<name>dfs.datanode.address</name>
<value>0.0.0.0:50010</value>
<description>The address where the datanode server will listen to.
If the port is 0 then the server will start on a free port.
</description>
</property>
类似的,还有50030端口被占用的情况:
2011-05-1 14:30:43,931 INFO org.apache.hadoop.http.HttpServer: Port returned by webServer.getConnectors()[0].getLocalPort() before open() is -1. Opening the listener on 50030
2011-05-1 14:30:43,933 FATAL org.apache.hadoop.mapred.JobTracker: java.net.BindException: Address already in use
at sun.nio.ch.Net.bind(NativeMethod)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119)
在mapred-default.xml中修改下端口号:
<property>
<name>mapred.job.tracker.http.address</name>
<value>0.0.0.0:50030</value>
<description>The job tracker http server address and port
the server will listen on.If the port is 0 then the server
will start on a free port.
</description>
</property>