1. error prompt
Formatting the name directories of the current NameNode. If the name directories are not empty, this is expected to fail.
2. Problem Cause
Namenode formatted before, so this can not be formatted, you need to delete the original formatting.
3. Solution
1) dn at or nn / dfs directory
[root@hadoop101 dfs]# ls /dfs/ nn snn
Delete three machines (all machines) / dfs directory
rm -rf /dfs/
2) Then click to retry
Reference: https: //blog.csdn.net/u010886217/article/details/85333016