分享

hbase启动后RegionServer自动挂掉,org.apache.hadoop.hbase.tool.Canary

啊耀 发表于 2016-1-27 18:29:50 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 7 16969
hbase启动后 RegionServer 是启动状态,但是过10秒左右就全挂了

日志:

        org.apache.hadoop.hbase.tool.Canary:The monitor is running too long(15003) after timeout limit:15000 will be killed by itself !

各位大哥帮帮忙看看是什么情况?
还是有就是我一个17M左右的字节数组插入hbase,regionServer也是全挂了。是不是我的hbase配置不对??

已有(7)人评论

跳转到指定楼层
wscl1213 发表于 2016-1-27 20:32:14
本帖最后由 wscl1213 于 2016-1-27 20:34 编辑

下面是源码:



  // initialize HBase conf and admin【初始化hbase
-    if (conf == null) conf = HBaseConfiguration.create();
-    admin = new HBaseAdmin(conf);
-    try {
-      // lets the canary monitor the cluster
-      do {
-        if (admin.isAborted()) {
-          LOG.error("HBaseAdmin aborted");
-          return(1);
+    // start to prepare the stuffs
+    Monitor monitor = null;
+    Thread monitorThread = null;
+    long startTime = 0;
+    long currentTimeLength = 0;
+
+    do {
+      // do monitor !!//开始监控
+      monitor = this.newMonitor(index, args);
+      monitorThread = new Thread(monitor);
+      startTime = System.currentTimeMillis();
+      monitorThread.start();
+      while (!monitor.isDone()) {
+        // wait for 1 sec
+        Thread.sleep(1000);
+        // exit if any error occurs
+        if (this.failOnError && monitor.hasError()) {
+          monitorThread.interrupt();
+          System.exit(1);
         }
-
-        if (tables_index >= 0) {
-          for (int i = tables_index; i < args.length; i++) {
-            sniff(admin, sink, TableName.valueOf(args));
-          }
-        } else {
-          sniff();
+        currentTimeLength = System.currentTimeMillis() - startTime;
+        if (currentTimeLength > this.timeout) {
//这里的意思是如果时间大于设置的超时时间,就会输出下面错误
+          LOG.error("The monitor is running too long (" + currentTimeLength
+              + ") after timeout limit:" + this.timeout
+              + " will be killed itself !!");
+          monitorThread.interrupt();
+          monitor.setError(true);
+          break;
         }
+      }
+


回复

使用道具 举报

Alkaloid0515 发表于 2016-1-27 21:55:27
个人认为应该是没有起来,而是在启动的过程中遇到问题,然后失败。
如上面所示超时。
没有启动起来原因很多。

回复

使用道具 举报

啊耀 发表于 2016-1-28 09:34:11
Alkaloid0515 发表于 2016-1-27 21:55
个人认为应该是没有起来,而是在启动的过程中遇到问题,然后失败。
如上面所示超时。
没有启动起来原因很 ...

regionServer出现这种情况,是因为我把一个17M左右的文件插进hbase,这时hbase会报 the keyValue size too large 这个错误,
我在conf里面设置了hbase.client.keyvalue.maxsize 为1G。
然后重新插入数据,导致regionServer就全挂了,我重启hbase, regionserver就出现启动后迅速挂了。
我今天到公司重启hbase,regionserver竟然正常了,我如果又插入数据,我觉得又会出现昨天这种情况。
实在不清楚这是什么情况?
我这个环境是cdh5 ,hbase 是0.96

你们有QQ群吗?可以把我拉进群里面学习学习吗?谢谢!!



回复

使用道具 举报

啊耀 发表于 2016-1-28 09:35:45

就是不清楚什么会出现这种情况
回复

使用道具 举报

啊耀 发表于 2016-1-28 10:40:36

这个this.timeout,在哪里可以设置
回复

使用道具 举报

wscl1213 发表于 2016-1-28 20:59:48
配置确定生效了?
是在hbase-site.xml的吧。
尝试写到代码里
[mw_shl_code=java,true]        Configuration conf = HBaseConfiguration.create();
                conf.set("hbase.rootdir", "hdfs://m1:9000/hbase");
                // 使用eclipse时必须添加这个,否则无法定位
                conf.set("hbase.zookeeper.quorum", "m1,s1,s2");
                conf.set("hbase.client.keyvalue.maxsize","524288000");//最大500m[/mw_shl_code]
回复

使用道具 举报

xuanxufeng 发表于 2016-1-28 21:01:54
增加hbase.client.keyvalue.maxsize,并设置hbase.client.keyvalue.maxsize 为1G,这意味着,当重新启动群集,还遇到了同样的错误:keyvalue to large。
解决办法:

hbase.client.keyvalue.maxsize是一个客户端属性。你需要在你的客户端节点上的hbase-site.xml上设置这个属性。或者,你可以在你的代码的Configuration对象中配置属性。没有必要重新启动HBase。

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条