With a hadoop cluster environment, there are always errors in reading and writing files recently. Check the log of the name node (
Safe mode is ON)
- Safe mode is ON. The ratio of reported blocks 0.2000 has not reached the threshold 0.9990. Safe mode will be turned off automatically.
flip up
- org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot delete /home/hadoop/tmp/mapred/system. Name node is in safe mode.
There are three google solutions
1) Execute the command: bin/hadoop dfsadmin -safemode leave
The description of the dfsadmin -safemode value parameter value is as follows:
enter - enter safe mode
leave - Force the NameNode to leave safe mode
get - returns information about whether safe mode is enabled
wait - Wait for safe mode to end.
2) Reformatting the filesystem = . =
3)bin/hadoop fsck /
The first method needs to be executed every time, which is very tangled~
The second method, you know what format means. . . .
The third method, if there is a lot of data, it will be very slow to execute, there is no way, just wait.
- hadoop@mhadoop:~/hadoop-1.0.0$ bin/hadoop fsck /
- FSCK started by hadoop from /192.168.1.110 for path / at Wed Mar 07 17:57:43 CST 2012
- .
- /tmp/hadoop/tmp/mapred/staging/hadoop/.staging/job_201202290728_0001/job.jar: CORRUPT block blk_-8710406465335110666
- /tmp/hadoop/tmp/mapred/staging/hadoop/.staging/job_201202290728_0001/job.jar: MISSING 1 blocks of total size 142465 B..
- /tmp/hadoop/tmp/mapred/staging/hadoop/.staging/job_201202290728_0002/job.jar: CORRUPT block blk_8343735010139595189
- /tmp/hadoop/tmp/mapred/staging/hadoop/.staging/job_201202290728_0002/job.jar: MISSING 1 blocks of total size 142465 B..
- /tmp/hadoop/tmp/mapred/staging/hadoop/.staging/job_201202290728_0004/job.jar: CORRUPT block blk_4796918520991551976
- /tmp/hadoop/tmp/mapred/staging/hadoop/.staging/job_201202290728_0004/job.jar: MISSING 1 blocks of total size 142465 B..
- /tmp/hadoop/tmp/mapred/staging/hadoop/.staging/job_201202290728_0005/job.jar: CORRUPT block blk_8732649167016211914
- /tmp/hadoop/tmp/mapred/staging/hadoop/.staging/job_201202290728_0005/job.jar: MISSING 1 blocks of total size 142465 B..
- /tmp/hadoop/tmp/mapred/staging/hadoop/.staging/job_201202290728_0006/job.jar: CORRUPT block blk_2190395249671123528
- /tmp/hadoop/tmp/mapred/staging/hadoop/.staging/job_201202290728_0006/job.jar: MISSING 1 blocks of total size 142465 B..
- /tmp/hadoop/tmp/mapred/system/jobtracker.info: Under replicated blk_3010497672022840180_1511. Target Replicas is 2 but found 1 replica(s).
- .
- /user/hadoop/input/README.txt: Under replicated blk_1278803782511847062_1510. Target Replicas is 2 but found 1 replica(s).
- ..
- /user/hadoop/output/_logs/history/job_201202290728_0007_1330473591943_hadoop_word+count: CORRUPT block blk_-165491155081655193
- /user/hadoop/output/_logs/history/job_201202290728_0007_1330473591943_hadoop_word+count: MISSING 1 blocks of total size 13581 B..
- /user/hadoop/output/_logs/history/job_201202290728_0007_conf.xml: CORRUPT block blk_359906738089887519
- /user/hadoop/output/_logs/history/job_201202290728_0007_conf.xml: MISSING 1 blocks of total size 20344 B..
- /user/hadoop/output/part-r-00000: CORRUPT block blk_-3883649133311907523
- /user/hadoop/output/part-r-00000: MISSING 1 blocks of total size 158081 B.Status: CORRUPT
- Total size: 905701 B
- Total dirs: 20
- Total files: 11
- Total blocks (validated): 10 (avg. block size 90570 B)
- ********************************
- CORRUPT FILES: 8
- MISSING BLOCKS: 8
- MISSING SIZE: 904331 B
- CORRUPT BLOCKS: 8
- ********************************
- Minimally replicated blocks: 2 (20.0 %)
- Over-replicated blocks: 0 (0.0 %)
- Under-replicated blocks: 2 (20.0 %)
- Mis-replicated blocks: 0 (0.0 %)
- Default replication factor: 2
- Average block replication: 0.2
- Corrupt blocks: 8
- Missing replicas: 2 (100.0 %)
- Number of data-nodes: 1
- Number of racks: 1
- FSCK ended at Wed Mar 07 17:57:43 CST 2012 in 11 milliseconds
- The filesystem under path '/' is CORRUPT