Recently re-picked up the Hadoop, so the blog reopened ~
Let me start by describing my problem: this time I'm using Eclipse to run a Hadoop program on Ubuntu. First, follow the tutorial on running a Hadoop program under Eclipse in the Xiamen University Database Lab and configure Eclipse, then start Hadoop at the command line. In the Eclipse interface, there is the input folder, right-click this file home has a upload files to DFS, through this upload, found that the file size of upload is 0.0.
Workaround:
First of all, it's a careless thing to change .... At the command line start Hadoop did not carefully see whether each node is started, the results later found that the Datanode node is not started;
Let's say that Datanode cannot start a situation that may occur:
Note: The following information can be found in accordance with/usr/local/hadoop/logs/hadoop-hadoop-datanode-king-lenovo.log (King-lenovo is my computer name)
1. Error in log: 2015-06-11 16:11:06,822 WARN org.apache.hadoop.hdfs.server.datanode.DataNode:Invalid Dfs.datanode.data.dir/usr/local/hadoop/dfs/data
This error is usually/usr/local/hadoop/dfs/data this file folder has a lock, that is, insufficient access rights.
The workaround is to modify the folder permissions: CHOMD g-w/usr/local/hadoop/dfs/data
2. Error in log:java.io.IOException:Incompatible clusterids In/usr/local/hadoop/dfs/data:namenode Clusterid = CID-C1BF781C-D589-46D7-A246-7F64A6F24BC1; Datanode Clusterid = cid-b1ee6a5b-aa39-4e9e-b849-ee7c4650989b
This error means that the Clusterid of Namenode is inconsistent with the clusterid of Datanode, which is usually caused by multiple formatting nodes.
The workaround is to change the two IDs to a consistent one. Namenode Clusterid in/usr/local/hadoop/dfs/name/current/verson, Datanode Clusterid in /usr/local/hadoop/ Dfs/data/current/verson, change one of them to be the same as the other.
Then restart Hadoop.
Hadoop fails to start Datanode under Linux