当按照伪分布式模式配置好hbase时,执行 ./bin/start-hbase.sh 时,查看hmaster 的log日记时,有如下错误:
2015-04-29 08:58:14,967 FATAL [main] regionserver.RSRpcServices: The hostname of regionserver cannot be set to localhost in a fully-distributed setup because it won't be reachable. See "Getting Started" for more information.
4674 2015-04-29 08:58:14,972 ERROR [main] master.HMasterCommandLine: Master exiting
4675 java.lang.RuntimeException: Failed construction of Master: class org.apache.hadoop.hbase.master.HMaster
4676 at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:1982)
4677 at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:198)
4678 at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:139)
4679 at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
4680 at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:126)
4681 at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:1996)
4682 Caused by: java.io.IOException: The hostname of regionserver cannot be set to localhost in a fully-distributed setup because it won't be reachable. See "Getting Started" for more information.
4683 at org.apache.hadoop.hbase.regionserver.RSRpcServices.<init>(RSRpcServices.java:775)
4684 at org.apache.hadoop.hbase.master.MasterRpcServices.<init>(MasterRpcServices.java:195)
4685 at org.apache.hadoop.hbase.master.HMaster.createRpcServices(HMaster.java:474)
4686 at org.apache.hadoop.hbase.regionserver.HRegionServer.<init>(HRegionServer.java:492)
4687 at org.apache.hadoop.hbase.master.HMaster.<init>(HMaster.java:333)
4688 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
4689 at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
4690 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
4691 at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
2015-04-29 08:58:14,967 FATAL [main] regionserver.RSRpcServices: The hostname of regionserver cannot be set to localhost in a fully-distributed setup because it won't be reachable. See "Getting Started" for more information.
4674 2015-04-29 08:58:14,972 ERROR [main] master.HMasterCommandLine: Master exiting
4675 java.lang.RuntimeException: Failed construction of Master: class org.apache.hadoop.hbase.master.HMaster
4676 at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:1982)
4677 at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:198)
4678 at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:139)
4679 at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
4680 at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:126)
4681 at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:1996)
4682 Caused by: java.io.IOException: The hostname of regionserver cannot be set to localhost in a fully-distributed setup because it won't be reachable. See "Getting Started" for more information.
4683 at org.apache.hadoop.hbase.regionserver.RSRpcServices.<init>(RSRpcServices.java:775)
4684 at org.apache.hadoop.hbase.master.MasterRpcServices.<init>(MasterRpcServices.java:195)
4685 at org.apache.hadoop.hbase.master.HMaster.createRpcServices(HMaster.java:474)
4686 at org.apache.hadoop.hbase.regionserver.HRegionServer.<init>(HRegionServer.java:492)
4687 at org.apache.hadoop.hbase.master.HMaster.<init>(HMaster.java:333)
4688 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
4689 at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
4690 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
4691 at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
4692 at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:1977)
所以我最终是在hadoop2.6.0版本上对应hbase是1.1.0版本,不再报错,这样bug目测已经在这个版本被修复啦