今天在配置好hbase分布环境后,进行shell操作,在创建表时出现了如下错误:
ERROR: org.apache.hadoop.hbase.MasterNotRunningException: Retried 7 times
进入hbase目录下的logs目录中查看MASTAR的日志信息发现了问题:
2014-03-08 07:14:17,955 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...
2014-03-08 07:14:27,964 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...
2014-03-08 07:14:37,971 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...
2014-03-08 07:14:47,978 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...
2014-03-08 07:14:58,003 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...
2014-03-08 07:15:08,012 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...
2014-03-08 07:15:18,017 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...
2014-03-08 07:15:28,026 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...
2014-03-08 07:15:38,079 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...
2014-03-08 07:15:48,089 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...
2014-03-08 07:15:58,092 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...
2014-03-08 07:16:08,097 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...
2014-03-08 07:16:18,105 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...
2014-03-08 07:16:28,116 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...
2014-03-08 07:16:38,125 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...
2014-03-08 07:16:48,129 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...
2014-03-08 07:16:58,137 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode...
2014-03-08 07:17:08,145 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode..
很明显hadoop由于某方面原因处于了安全模式!
知道问题的所在了,我们就可以解决问题了!
我们执行命令:hadoop dfsadmin -safemode get查看安全模式的状态,可以看到:Safe mode is ON!所以接下来我们只需关闭安全模式即可!
执行命令:hadoop dfsadmin -safemode leave即可离开安全模式!
ok,一切搞定!