卡夫卡和Spark-Streaming之间存在一个问题,我在生产中有低级别的流量(大约12000-15000记录/每秒)服务,起初消费流量看起来很正常,但是在10-15分钟后,突然消耗了将近1/10的速度。这可能是网络的流量问题?卡夫卡卡夫卡消费者的缺失记录
配置:
num.network.threads = 2个
num.io.threads = 8个
socket.send.buffer.bytes = 1048576
socket.receive.buffer.bytes = 1048576
socket.request.max.bytes = 104857600个
log.flush.interval.messages = 10000个
log.flush.interval.ms = 1000
log.retention.hours = 12
log.segm ent.bytes = 536870912
log.retention.check.interval.ms = 60000
log.cleaner.enable =假
log.cleanup.interval.mins =火花流的1
配置(消费):
....
val kafkaParams = Map(
"zookeeper.connect" -> zkQuorum,
"group.id" -> group,
"zookeeper.connection.timeout.ms" -> "1000000",
"zookeeper.sync.time.ms" -> "200",
"fetch.message.max.bytes" -> "2097152000",
"queued.max.message.chunks" -> "1000",
"auto.commit.enable" -> "true",
"auto.commit.interval.ms" -> "1000")
try {
KafkaUtils.createStream[String, String, StringDecoder, StringDecoder](
ssc, kafkaParams, topics.map((_, partition)).toMap,
StorageLevel.MEMORY_ONLY).map {
case (key, value) => convertTo(key, value)
}.filter {
_ != null
}.foreachRDD(line => saveToHBase(line, INPUT_TABLE))
//}.foreachRDD(line => logger.info("handling testing....."+ line))
} catch {
case e: Exception => logger.error("consumerEx: " + e.printStackTrace)
}