今天启动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.(DataNode.java:216)
50010端口被占用,在hdfs-site.xml中改成其他端口号
dfs.datanode.address
0.0.0.0:50010
The address where the datanode server will listen to.
If the port is0 then the server will start on a free port.
类似的,还有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中修改下端口号:
mapred.job.tracker.http.address
0.0.0.0:50030
The job tracker http server address and port
the server will listen on.If the port is0 then the server
will start on a free port.