开发者社区> 问答> 正文

sparkstreaming+kafka+hbase实时写入数据,执行6天后,出现异常,数据无法写入

没找到怎么贴图片-------

tf.filter(!_.contains(str1)).filter(!_.contains(str2)).map(_.replaceAll(""", "")).map(_.split(",")).filter(_.length == 7)

.map(p => (p(0).substring(3), p(1), p(4), p(5), p(6))).map(line => {

val put = new Put(Bytes.toBytes(line._1.reverse + MD5Util.stringMD5(UUID.randomUUID().toString)))

put.addColumn(Bytes.toBytes("info"), Bytes.toBytes("DeviceID"), Bytes.toBytes(line._1))

put.addColumn(Bytes.toBytes("info"), Bytes.toBytes("DeviceName"), Bytes.toBytes(line._2))

put.addColumn(Bytes.toBytes("info"), Bytes.toBytes("CollectionTime"), Bytes.toBytes(line._3))

put.addColumn(Bytes.toBytes("info"), Bytes.toBytes("GranularityPeriod"), Bytes.toBytes(line._4))

put.addColumn(Bytes.toBytes("info"), Bytes.toBytes("cpuUsage"), Bytes.toBytes(line._5))

}).foreachPartition(line => { val conn = ConnectionFactory.createConnection(HBaseConfiguration.create)

val table = conn.getTable(TableName.valueOf("eSight_cpu")) import scala.collection.JavaConversions._

table.put(seqAsJavaList(line.toSeq))

})

以上是代码。
以下是错误信息:

java.io.IOException: Bad response ERROR for BP-983455033-190.15.119.7-1525777063721:blk_1077688664_3948006
from datanode DatanodeInfoWithStorage[190.15.119.10:25009,DS-cc5cf8be-f909-4651-9afa-113776e46d16,DISK]
at org.apache.hadoop.hdfs.DataStreamer$ResponseProcessor.run(DataStreamer.java:1148)
然后就是一直:

[Stage 1998:============================> (1 + 1) / 2]

[Stage 1998:============================> (1 + 1) / 2]

[Stage 1998:============================> (1 + 1) / 2]
卡在这里。

展开
收起
hbase小能手 2018-11-08 11:35:18 3543 0
1 条回答
写回答
取消 提交回答
  • HBase是一个分布式的、面向列的开源数据库,一个结构化数据的分布式存储系统。HBase不同于一般的关系数据库,它是一个适合于非结构化数据存储的数据库。阿里云HBase技术团队共同探讨HBase及其生态的问题。

    你这个报错应该和 Spark 、HBase 关系不大吧,看看集群的 HDFS 磁盘是否有问题。特别是 190.15.119.10 j节点

    2019-07-17 23:12:57
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Java Spring Boot开发实战系列课程【第16讲】:Spring Boot 2.0 实战Apache Kafka百万级高并发消息中间件与原理解析 立即下载
MaxCompute技术公开课第四季 之 如何将Kafka数据同步至MaxCompute 立即下载
消息队列kafka介绍 立即下载