Several times, after starting Hadoop and HBase, execute the JPS command and have seen a hmaster process,
However, entering the shell of HBase and executing a command, the following error occurs:
ERROR:org.apache.hadoop.hbase.MasterNotRunningException:Retried 7 times
Go to the logs directory to view the log of Master: Discovery always shows the following:
2013-04-13 17:13:17,374 INFO org.apache.hadoop.hbase.util.FSUtils:Waiting for DFS to exit Safe mode ... 2013-04-13 17:13:27,377 INFO org.apache.hadoop.hbase.util.FSUtils:Waiting for DFS to exit Safe mode ... 2013-04-13 17:13:37,386 INFO org.apache.hadoop.hbase.util.FSUtils:Waiting for DFS to exit Safe mode ... 2013-04-13 17:13:47,393 INFO org.apache.hadoop.hbase.util.FSUtils:Waiting for DFS to exit Safe mode ... 2013-04-13 17:13:57,395 INFO org.apache.hadoop.hbase.util.FSUtils:Waiting for DFS to exit Safe mode ... 2013-04-13 17:14:07,409 INFO org.apache.hadoop.hbase.util.FSUtils:Waiting for DFS to exit Safe mode ...
It turned out that Hadoop was still in security mode when it was first started.
[Email protected] hadoop-2.6.0-cdh5.6.0]$ Bin/hadoop dfsadmin-safemode getsafe mode is on
You can wait until Hadoop exits Safe mode and then execute the hbase command, or manually exit the security mode of Hadoop
[Email protected] hadoop-2.6.0-cdh5.6.0]$ Bin/hadoop dfsadmin-safemode leavesafe mode is OFF
Now it's no problem to execute the hbase command again.
Hadoop dfsadmin-safemode Command parameter description:
Enter -Enter Safe mode leave -Force Namenode to leave safe mode get -Returns information about whether Safe mode is turned on wait -waits until the end of safe mode.
Util.FSUtils:Waiting for DFS to exit Safe mode