我只想尝试从 kafka 并行接收流数据。这是我的代码:
val myKafkaStream = (1 to numReceivers.toInt).map { i =>
KafkaUtils.createStream(ssc, zkQuorum, group, topicMap)
}
我在 yarn 上运行代码,numReceiver 是 5,并且代码确实有效。但问题是只有两个接收器接收数据。num-executor 是 5,executor-core 是 2
结果:
KafkaReveiver-0 : 49637.95 event/sec
KafkaReveiver-1 : 0.0 event/sec
KafkaReveiver-2 : 0.0 event/sec
KafkaReveiver-3 : 49616.85 event/sec
KafkaReveiver-4 : 0.0 event/sec