zoukankan      html  css  js  c++  java
  • Spark操作HBase报:org.apache.hadoop.hbase.client.RetriesExhaustedWithDetailsException异常解决方案

    一.异常信息

      19/03/21 15:01:52 WARN scheduler.TaskSetManager: Lost task 4.0 in stage 21.0 (TID 14640, hntest07, executor 64)  org.apache.hadoop.hbase.client.RetriesExhaustedWithDetailsException: Failed 3 actions: AAA.bbb: 3 times,
      at org.apache.hadoop.hbase.client.AsyncProcess$BatchErrors.makeException(AsyncProcess.java:258)
      at org.apache.hadoop.hbase.client.AsyncProcess$BatchErrors.access$2000(AsyncProcess.java:238)
      at org.apache.hadoop.hbase.client.AsyncProcess.waitForAllPreviousOpsAndReset(AsyncProcess.java:1810)
      at org.apache.hadoop.hbase.client.BufferedMutatorImpl.backgroundFlushCommits(BufferedMutatorImpl.java:240)
      at org.apache.hadoop.hbase.client.BufferedMutatorImpl.flush(BufferedMutatorImpl.java:190)
      at org.apache.hadoop.hbase.client.HTable.flushCommits(HTable.java:1498)
      at org.apache.hadoop.hbase.client.HTable.put(HTable.java:1094)
      at org.com.tl.spark.main.LabelSummaryTaskEntrance$$anonfun$main$1$$anonfun$apply$mcVI$sp$1.apply(LabelSummaryTaskEntrance.scala:163)
      at org.com.tl.spark.main.LabelSummaryTaskEntrance$$anonfun$main$1$$anonfun$apply$mcVI$sp$1.apply(LabelSummaryTaskEntrance.scala:127)
      at org.apache.spark.rdd.RDD$$anonfun$foreachPartition$1$$anonfun$apply$33.apply(RDD.scala:920)
      at org.apache.spark.rdd.RDD$$anonfun$foreachPartition$1$$anonfun$apply$33.apply(RDD.scala:920)
      at org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1888)
      at org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1888)
      at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:66)
      at org.apache.spark.scheduler.Task.run(Task.scala:89)
      at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:242)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)

    二.代码

     val config = HBaseConfiguration.create()
     config.set("hbase.zookeeper.quorum", "hbase01,hbase02,hbase03")
     config.set("hbase.zookeeper.property.clientPort", "2181")
     val connection = ConnectionFactory.createConnection(config)
     val admin = connection.getAdmin
     val table = connection.getTable(TableName.valueOf("ZHEN:TABLENAME"))

    三.解决方案

      1.在代码标红的地方把库名+表名全部大写,中间用":"间隔。

      2.Hbase版本不一致【服务器上启动的Hbase和Spark导入的Hbase-lib不一致】。

      3.hdfs的datanode或namenode宕机。

      4.Hbase的Hmaster或者HRegionServer挂了。

  • 相关阅读:
    每日英语:Why Sit Up Straight?
    每日英语:Doctor's Orders: 20 Minutes Of Meditation Twice A Day
    每日英语:SamsungApple Patent Fight: Is It Worth It?
    每日英语:Better Than Buffett, This Investor Made Me Rich for Life
    每日英语:Coming Soon to China: AtHome Toxic Food Test Kits
    去了家新公司,技术总监不让用 IntelliJ IDEA!!想离职了。。
    IDEA 进行远程 Debug,这个太强了。。
    雷军做程序员时写的博客,太牛了。。
    Spring Boot 如何获取 Controller 方法名和注解信息?
    sql 2005/2008中直接创建web service,允许客户机通过HTTP访问
  • 原文地址:https://www.cnblogs.com/yszd/p/10574191.html
Copyright © 2011-2022 走看看