Solution for hadoop Safe mode is ON

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)
  1. 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
  1. 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.

  1. hadoop@mhadoop:~/hadoop-1.0.0$ bin/hadoop fsck /
  2. FSCK started by hadoop from /192.168.1.110 for path / at Wed Mar 07 17:57:43 CST 2012
  3. .
  4. /tmp/hadoop/tmp/mapred/staging/hadoop/.staging/job_201202290728_0001/job.jar: CORRUPT block blk_-8710406465335110666
  5. /tmp/hadoop/tmp/mapred/staging/hadoop/.staging/job_201202290728_0001/job.jar: MISSING 1 blocks of total size 142465 B..
  6. /tmp/hadoop/tmp/mapred/staging/hadoop/.staging/job_201202290728_0002/job.jar: CORRUPT block blk_8343735010139595189
  7. /tmp/hadoop/tmp/mapred/staging/hadoop/.staging/job_201202290728_0002/job.jar: MISSING 1 blocks of total size 142465 B..
  8. /tmp/hadoop/tmp/mapred/staging/hadoop/.staging/job_201202290728_0004/job.jar: CORRUPT block blk_4796918520991551976
  9. /tmp/hadoop/tmp/mapred/staging/hadoop/.staging/job_201202290728_0004/job.jar: MISSING 1 blocks of total size 142465 B..
  10. /tmp/hadoop/tmp/mapred/staging/hadoop/.staging/job_201202290728_0005/job.jar: CORRUPT block blk_8732649167016211914
  11. /tmp/hadoop/tmp/mapred/staging/hadoop/.staging/job_201202290728_0005/job.jar: MISSING 1 blocks of total size 142465 B..
  12. /tmp/hadoop/tmp/mapred/staging/hadoop/.staging/job_201202290728_0006/job.jar: CORRUPT block blk_2190395249671123528
  13. /tmp/hadoop/tmp/mapred/staging/hadoop/.staging/job_201202290728_0006/job.jar: MISSING 1 blocks of total size 142465 B..
  14. /tmp/hadoop/tmp/mapred/system/jobtracker.info: Under replicated blk_3010497672022840180_1511. Target Replicas is 2 but found 1 replica(s).
  15. .
  16. /user/hadoop/input/README.txt: Under replicated blk_1278803782511847062_1510. Target Replicas is 2 but found 1 replica(s).
  17. ..
  18. /user/hadoop/output/_logs/history/job_201202290728_0007_1330473591943_hadoop_word+count: CORRUPT block blk_-165491155081655193
  19. /user/hadoop/output/_logs/history/job_201202290728_0007_1330473591943_hadoop_word+count: MISSING 1 blocks of total size 13581 B..
  20. /user/hadoop/output/_logs/history/job_201202290728_0007_conf.xml: CORRUPT block blk_359906738089887519
  21. /user/hadoop/output/_logs/history/job_201202290728_0007_conf.xml: MISSING 1 blocks of total size 20344 B..
  22. /user/hadoop/output/part-r-00000: CORRUPT block blk_-3883649133311907523
  23. /user/hadoop/output/part-r-00000: MISSING 1 blocks of total size 158081 B.Status: CORRUPT
  24. Total size: 905701 B
  25. Total dirs: 20
  26. Total files: 11
  27. Total blocks (validated): 10 (avg. block size 90570 B)
  28. ********************************
  29. CORRUPT FILES: 8
  30. MISSING BLOCKS: 8
  31. MISSING SIZE: 904331 B
  32. CORRUPT BLOCKS: 8
  33. ********************************
  34. Minimally replicated blocks: 2 (20.0 %)
  35. Over-replicated blocks: 0 (0.0 %)
  36. Under-replicated blocks: 2 (20.0 %)
  37. Mis-replicated blocks: 0 (0.0 %)
  38. Default replication factor: 2
  39. Average block replication: 0.2
  40. Corrupt blocks: 8
  41. Missing replicas: 2 (100.0 %)
  42. Number of data-nodes: 1
  43. Number of racks: 1
  44. FSCK ended at Wed Mar 07 17:57:43 CST 2012 in 11 milliseconds
  45. The filesystem under path '/' is CORRUPT

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325405582&siteId=291194637