hadoop Reformat HDFS step parsing

  • 2020-06-23 02:30:07
  • OfStack

Those who know Hadoop know that Hadoop has two core components, one is HDFS, the other is MapReduce. HDFS serves as the data storage scheme of Hadoop, while MapReduce provides computing services. At the same time, as a distributed file system, the installation of HDFS also requires corresponding formatting operations. If the installation fails or we need to reinstall, then we need to reformat HDFS. This article will discuss how to reformat HDFS.

How to reformat the hdfs system:

1. Open ES18en-ES19en. xml

We open hdfs-ES26en. xml of Hadoop, and the basic configuration is as follows:


<property> 
  <name>dfs.name.dir</name> 
  <value>/usr/local/hadoop/hdfs/name</value> 
</property> 
<property> 
  <name>dfs.data.dir</name> 
  <value>/usr/local/hadoop/hdsf/data</value> 
</property> 

Delete the directory specified by ES31en.name.dir, the directory specified by ES34en.data.dir, and the storage information path configured in ES37en-ES38en.xml.

2. Delete the relevant directory specified by the ES43en-ES44en.xml configuration file


<property> 
  <name>hadoop.tmp.dir</name> 
  <value>/usr/local/hadoop/hadooptmp</value> 
</property> 

Delete the directory specified by hadoop.tmp.dir, that is, delete the temporary file path of Hadoop.

3. Re-execute the command: hadoop ES57en-ES58en

Formatting done.

To format HDFS this way, you need to empty all the data in the original HDFS, then format and install a brand new HDFS.

Note: This format requires all the data in HDFS to be cleared. We will discuss the method of reformatting without deleting the data in the future.

conclusion

That is the end of this article on the hadoop reformat HDFS step parsing, I hope to help you. Interested friends can continue to read: Talk about 7 common Hadoop and Spark project cases and other related topics, if there is any deficiency, welcome to comment out. Thank you for your support!


Related articles: