Hadoop security mode

Source: Internet
Author: User
The hadoop security mode starts when the distributed file system is started. when the distributed file system is in the safe mode, the content in the file system cannot be modified or deleted until the security mode ends. The security mode is mainly used to check when the system is started... information & hadoop security mode
When the distributed file system is started, there will be security mode at the beginning. when the distributed file system is in security mode, the content in the file system cannot be modified or deleted, until the security mode ends. The security mode is mainly used to check the validity of data blocks on each DataNode when the system starts, and to copy or delete some data blocks as required by the policy. You can also enter security mode through commands during runtime. In practice, when the system starts, an error message indicating that the file cannot be modified in security mode is displayed when you modify or delete the file. you only need to wait for a while. SafeModeException
When running a hadoop program, the following error is reported:
Org. apache. hadoop. dfs. SafeModeException: Cannot delete/user/hadoop/input. Name node is in safe mode.
Let's analyze this error and understand it literally: "Name node is in safe mode ."
Now we know that we need to solve this problem. I want to keep Hadoop in safe mode. can I solve it without waiting? The answer is yes,
 
Enter the following in the Hadoop Directory:
 
$ Bin/hadoop dfsadmin-safemode leave
 
That is to say, disable the Hadoop security mode and solve the problem.
 
Safemode mode
 
When NameNode is started, it first enters the security mode. if the proportion of the block lost by datanode reaches a certain level (1-dfs.safemode.threshold.pct), the system will remain in the security mode, that is, read-only status. Dfs. safemode. threshold. pct (default value: 0.999f) indicates that when HDFS is started, if the number of blocks reported by DataNode reaches 0.999 times the number of blocks recorded by metadata, the security mode can be left; otherwise, the read-only mode is used. If it is set to 1, HDFS is always in SafeMode.
The following line extracts logs from NameNode startup (block reporting ratio 1 reaches the threshold of 0.9990)
The ratio of reported blocks 1.0000 has reached the threshold0.9990. Safe mode will be turned off automatically in 18seconds.
1. modify dfs. safemode. threshold. pct to a smaller value. The default value is 0.999.
2. hadoop dfsadmin-safemode leave command force exit
 
Hadoop dfsadmin-safemode command
 
Format: Usage: java DFSAdmin [-safemode enter | leave | get | wait]
You can use dfsadmin-safemode value to operate the security mode. The value parameter is described as follows:
Enter-enter security mode
Leave-force NameNode to exit safe mode
Get-returned information about whether the security mode is enabled
Wait-wait until the end of security mode.

From the guisu column
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.