Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use format in namenode

Shulou Source: shulou.com Published: 2022-06-03 07:32:27 11月23日 Update

Namenode is mainly used to manage the metadata information of the namespace (actually directories and files) of the entire distributed file system. At the same time, in order to ensure the reliability of the data, the operation log is added, which is saved to the (persistent) local file system.

To use HDFS for the first time, you must first-format

There are two important paths on the namenode node, which are used to store metadata and operation log respectively. These two paths come from configuration files, and the corresponding attributes are dfs.name.dir and dfs.name.edits.dir. The default path is / tmp/hadoop/dfs/name. When format, clear the files in the directory first, and then create:

(whether the default path in different versions is the same or not depends on the specific version. I don't know which version I am referring to in this excerpt:

Under dfs.name.dir:

{dfs.name.dir} / current/fsimage

{dfs.name.dir} / current/fstime

{dfs.name.dir} / current/VERSION

{dfs.name.dir} / image/fsimage

Under dfs.name.edits.dir:

{dfs.name.edits.dir} / current/edits

{dfs.name.edits.dir} / current/fstime

{dfs.name.edits.dir} / current/VERSION

{dfs.name.edits.dir} / image/fsimage

Fsimage: stores metadata information for namespaces (actually directories and files)

Edits: used to store log information about namespace operations and achieve recovery of NameNode nodes

Fstime: when was the last check point used to store metadata

VERSION: used to store NameNode version information, namespace ID (version number)

Tags: Data files versions storage information space logs directories paths two actually that is systems nodes different important distributed reliable and in fact Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi vpn Apple Shulou Technology OPPO Reno