查看日志出现错误:
2014-06-04 20:17:49,133 ERROR [main] regionserver.HRegionServerCommandLine: Region server exiting
java.lang.RuntimeException: Failed construction of Regionserver: class org.apache.hadoop.hbase.regionserver.HRegionServer
at org.apache.hadoop.hbase.regionserver.HRegionServer.constructRegionServer(HRegionServer.java:2385)
at org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine.start(HRegionServerCommandLine.java:61)
at org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine.run(HRegionServerCommandLine.java:85)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:126)
at org.apache.hadoop.hbase.regionserver.HRegionServer.main(HRegionServer.java:2400)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.apache.hadoop.hbase.regionserver.HRegionServer.constructRegionServer(HRegionServer.java:2383)
... 5 more
Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at org.apache.hadoop.security.authentication.util.KerberosName.<clinit>(KerberosName.java:42)
at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:225)
解决办法:
单独在要启动的RegionServer上执行以下命令
xuhui@cloud002:~/hadoop-2.2.0/hbase-0.98.2-hadoop2$ bin/hbase-daemon.sh start regionserver
再次查看已经启动起来了:
xuhui@cloud002:~/hadoop-2.2.0/hbase-0.98.2-hadoop2$ jps
2002 DataNode
3069 Jps
2907 HRegionServer
2261 NodeManager
2393 QuorumPeerMain
ok 问题解决
以上办法只能解决RegionServer的每次启动问题,而且每次都的这么输入,不能直接在Master上直接输入启动Master和RegionServer;
终极解决办法就是:
将hadoop中/home/xuhui/hadoop-2.2.0/share/hadoop/common/lib包里的slf4j-api-1.7.5.jar和slf4j-log4j12-1.7.5.jar复制到/home/xuhui/hadoop-2.2.0/hbase-0.98.2-hadoop2/lib下。
ok