What if the namenode of hdfs fails to start?
Editor to share with you what to do if the namenode of hdfs cannot be started. I hope you will get something after reading this article. Let's discuss it together.
On the linux where hadoop2.6.0 is installed
Format hdfs file system hadoop namenode-format
Start the hdfs and MapReduce daemons (start-dfs.sh, start-yarn.sh)
Start operating in the hdfs file system
Due to accidental reasons, the machine restarted
When the hdfs and mapreduce daemons are started again, the hdfs file system becomes inoperable
Display: (ls: Call From ubuntu/127.0.1.1 to localhost:8020 failed on connection exception: java.net.ConnectException: deny connection; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused)
The jps command shows that namenode is not started
There are some suggestions on the Internet: format the hdfs file system, although it can be reused, but the files previously operated are gone.
He looked for it on the Internet again and said
"
You have to reformat the namenode every time you turn it on.
In fact, the problem lies in the tmp file. The default tmp file will be emptied every time it is rebooted, and the formatting information of namenode will be lost at the same time.
So we have to reconfigure a directory of tmp files
First set up a hadoop_tmp directory under the home directory
Sudo mkdir ~ / hadoop_tmp
Then modify the core-site.xml file in the hadoop/conf directory and add the following node:
Hadoop.tmp.dir
/ home/chjzh/hadoop_tmp
A base for other temporary directories.
Note: my user is chjzh, so the directory is / home/chjzh/hadoop_tmp
OK, reformat Namenode
Hadoop namenode-format
Then start hadoop
Start-all.sh
Execute the JPS command and you can see NameNode.
"
After reading this article, I believe you have a certain understanding of "what if the namenode of hdfs cannot be started". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!