Copy the local file to HDFS. The result is incorrect: Name node is in safe mode.
This is because when the Distributed File System is started, there will be a safe mode at the beginning. When the Distributed File System is in 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 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.
Run the following command to manually Exit security mode:
Bin/hadoop dfsadmin-safemode leave
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.