但是通过浏览器访问60010端口查看HBase相关信息时,一直无法连接。
原因:
查看hbase文件夹下(本人是/usr/local/hbase)的logs文件夹 查看相应的日志文件(第一次启动hbase最好清空下这个文件夹下的内容,保证日志文件是最新的)
查看相应的日志文件(hbase-root-master-hadoop.log)发现:
….
2015-07-16 07:40:45,872 INFO org.apache.hadoop.hbase.master.SplitLogManager: found 0 orphan tasks and 0 rescan nodes
2015-07-16 07:40:45,875 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode…
2015-07-16 07:40:55,882 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode…
2015-07-16 07:41:05,890 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode…
2015-07-16 07:41:15,896 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode…
2015-07-16 07:41:25,907 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode…
2015-07-16 07:41:35,922 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode…
2015-07-16 07:41:45,927 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode…
2015-07-16 07:41:55,932 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode…
2015-07-16 07:42:05,938 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode…
2015-07-16 07:42:15,948 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode…
2015-07-16 07:42:25,956 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode…
2015-07-16 07:42:35,960 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode…
2015-07-16 07:42:45,964 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode…
2015-07-16 07:42:55,970 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode…
2015-07-16 07:43:05,975 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode…
2015-07-16 07:43:15,981 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode…
2015-07-16 07:43:25,990 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode…
2015-07-16 07:43:36,001 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode…
2015-07-16 07:43:46,010 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode…
2015-07-16 07:43:56,021 INFO org.apache.hadoop.hbase.util.FSUtils: Waiting for dfs to exit safe mode…
2015-07-16 07:44:05,878 ERROR org.apache.hadoop.hbase.master.HMasterCommandLine: Failed to start master
java.lang.RuntimeException: Master not initialized after 200 seconds
…
这个错误 是hadoop的safemode(安全模式)引起的
解决方案:
执行下述命令
hadoop dfsadmin -safemode leave
(注意将hadoop目录的bin子目录加入到PATH 可修改/etc/profile文件)
重启hbase(start-hbase.sh)
再次访问60010端口 成功!
三、思考
配置环境时 出现问题不可怕 要学会从log中分析出错原因
并慢慢分析可能的原因 再寻找解决方案
这样从中才能学到更多。
提醒各位一句:端口60010打不开的情况,是因为hbase 1.0 以后的版本,需要自己手动配置,在文件 hbase-site.xml 中添加如下配置
hbase.master.info.port
60010