HBase启动时连接不上从节点
打开HBase的日志文件发现报错如下:
2014-04-23 17:51:52,310 FATAL org.apache.hadoop.hbase.regionserver.HRegionServer: Master rejected startup because clock is out of sync
org.apache.hadoop.hbase.ClockOutOfSyncException: org.apache.hadoop.hbase.ClockOutOfSyncException: Server Slave2.Hadoop,60020,1398246678725 has been rejected; Reported time is too far out of sync with master. Time difference of 66428ms > max allowed of 30000ms
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at org.apache.hadoop.ipc.RemoteException.instantiateException(RemoteException.java:95)
at org.apache.hadoop.ipc.RemoteException.unwrapRemoteException(RemoteException.java:79)
at org.apache.hadoop.hbase.regionserver.HRegionServer.reportForDuty(HRegionServer.java:2051)
at org.apache.hadoop.hbase.regionserver.HRegionServer.run(HRegionServer.java:736)
at java.lang.Thread.run(Thread.java:722)
从 Reported time is too far out of sync with master. Time difference of 66428ms > max allowed of 30000ms能看出来,是超时问题,设定的时30秒,现在已经过了66秒多,所以报错!
解决方案:根据http://blog.s135.com/ntp_api_bz和http://blog.csdn.net/ethanzhao/article/details/4406017所说统一集群时间,我将ntp改为每小时的第15分钟同步一次