HDFS reinitialization
Sometimes you will encounter HDFS access exception. You can reinitialize HDFS at this time, but try not to initialize it too many times, and you'd better turn off Hadoop (stop-all.sh) before initialization, otherwise all the previous files will be deleted and the slave node process will fail.
1. Shut down the hadoop cluster. / stop-all.sh
Delete the folder rm-rf / usr/local/src/hadoop-1.2.1/tmp before initializing 2.hadoop
3. (optional) delete hadoop log rm-rf / usr/local/src/hadoop-1.2.1/logs
4.hadoop initializes. / hadoop namenode-format
5. Start the hadoop cluster. / start-all.sh
6. Visit HDFS. / hadoop fs-ls /