In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
How to prohibit formatting in Namenode? in view of this question, this article introduces in detail the corresponding analysis and answers, hoping to help more partners who want to solve this problem to find a more simple and feasible way.
1 the purpose of document writing
As we all know, Namenode stores the metadata of Hadoop clusters, and Datanode stores data. If the Namenode is formatted, it means that all data from the entire cluster will be lost. Unless the metadata is backed up and can be recovered by technical means, the lost data will not be recovered, which is undoubtedly fatal to the cluster in the production environment. This article focuses on how to disable Namenode formatting and add a bit of security to your cluster.
Test environment:
Operating system version is CentOS 6.8,
Version 5.11.2 for CM and CDH
Article directory structure:
1. Purpose of document writing
two。 Disable Namenode formatting
2.1 from formatting to running away
2.2 configure advanced parameters
3. Parameter function verification
4. Summary
2 prohibit Namenode formatting 2.1 from formatting to running away
Even ordinary users can format your Namenode! Some people may think that as long as the root user rights of the operating system are well controlled, ordinary users cannot switch to hdfs users to execute commands, and Namenode seems to be safe. In fact, it is not, with a command, the average user can format your Namenode and run away.
The average user can switch to the hdfs user through the environment variable, and then execute the format command. Like this:
Export HADOOP_USER_NAME=hdfs
Hdfs namenode-format
I hope that after reading, do not go to other people's cluster format Namenode, if you do, advise you to run quickly, do not say that I taught you to format, remember.
2.2 configure advanced parameters
In the HDFS configuration interface, search for "hdfs-site.xml", find the Namenode advanced configuration code snippet (safety valve), add the contents in the red box, and set the value of the parameter "dfs.namenode.support.allow.format" (default is true) to false, indicating that namenode formatting is prohibited. Then save the configuration and restart HDFS and related services. If you are an operation and maintenance staff, the pillars of the company, it is strongly recommended to configure this parameter, or buy a good pair of shoes, it is easier to run.
3 functional verification of parameters
1. Choose a random Namenode to test and stop the Namenode
2. Format the Namenode
3. You can see that Namenode formatting failed.
4. The above figure may not directly show that the Namenode formatting failed due to configuration parameters. I wanted to capture some logs, but because that Namenode was stopped, the logs were not printed. But I finally found a diagram that intuitively illustrates the effect of disabling Namenode formatting parameters.
This is the answer to the question about how Namenode forbids formatting. I hope the above content can be of some help to you. If you still have a lot of doubts to solve, you can follow the industry information channel for more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.