HBase因为机器时间不一样导致起不起来

几天没有启动hbase,今天重新启动,却发现 HRegionServer没有启动,
到 region server 查看 jps,里面只有HQuorumPeer,没有 HRegionServer。
于是就单独启动:
Java代码 收藏代码
  1. hbase-daemon.sh --config /usr/local/hbase/hbase-conf start regionserver 

看到日志:
/usr/local/hbase/hbase-logs/hbase-root-regionserver-ub9001.out:
Java代码 收藏代码
  1. Exception in thread "regionserver60020" java.lang.NullPointerException 
  2.     at org.apache.hadoop.hbase.regionserver.HRegionServer.join(HRegionServer.java:1587
  3.     at org.apache.hadoop.hbase.regionserver.HRegionServer.run(HRegionServer.java:757
  4.     at java.lang.Thread.run(Thread.java:619

/usr/local/hbase/hbase-logs/hbase-root-regionserver-ub9001.log:
Java代码 收藏代码
  1. 2012-07-3108:22:57,498 INFO org.apache.hadoop.hbase.regionserver.HRegionServer: Attempting connect to Master server at ub9000,60000,1343694287558 
  2. 2012-07-3108:22:57,539 INFO org.apache.hadoop.hbase.regionserver.HRegionServer: Connected to master at ub9001/192.168.0.221:60020 
  3. 2012-07-3108:22:57,539 INFO org.apache.hadoop.hbase.regionserver.HRegionServer: Telling master at ub9000,60000,1343694287558 that we are up with port=60020, startcode=1343694176934 
  4. 2012-07-3108:22:57,545 FATAL org.apache.hadoop.hbase.regionserver.HRegionServer: Master rejected startup because clock is out of sync 
  5. org.apache.hadoop.hbase.ClockOutOfSyncException: org.apache.hadoop.hbase.ClockOutOfSyncException: Server ub9001,60020,1343694176934 has been rejected; Reported time is too far out of sync with master.  Time difference of 410865ms > max allowed of 180000ms 
  6.     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
  7.     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39
  8.     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27
  9.     at java.lang.reflect.Constructor.newInstance(Constructor.java:513
  10.     at org.apache.hadoop.ipc.RemoteException.instantiateException(RemoteException.java:95
  11.     at org.apache.hadoop.ipc.RemoteException.unwrapRemoteException(RemoteException.java:79
  12.     at org.apache.hadoop.hbase.regionserver.HRegionServer.reportForDuty(HRegionServer.java:1676
  13.     at org.apache.hadoop.hbase.regionserver.HRegionServer.run(HRegionServer.java:634
  14.     at java.lang.Thread.run(Thread.java:619

才知道原来时间对不上.
同时在几个机器上校正时间:
Java代码 收藏代码
  1. date -s 08:42:00 //第一种方法
  2. 同步系统时间
    /usr/sbin/ntpdate  asia.pool.ntp.org (第二种方法)

最后重启:
Java代码 收藏代码
  1. hbase-daemon.sh --config /usr/local/hbase/hbase-conf start regionserver 

Java代码 收藏代码
  1. 2012-07-3108:40:43,827 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server Responder: starting 
  2. 2012-07-3108:40:43,828 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server listener on60020: starting 


【成功截图】
hbase主控节点 -- HMaster

hbase 存储节点--HRegionServer
HBase因为机器时间不一样导致起不起来_第1张图片

停止HBase

你可能感兴趣的:(HBase因为机器时间不一样导致起不起来)