Apache kafka 如何首次使用apache kafka集成部署storm core拓扑?
我想获得有关ApacheStorm和kafka初始设置的帮助 我能够将拓扑提交给storm群集,但在storm ui中出现以下错误 下面是我的代码片段Apache kafka 如何首次使用apache kafka集成部署storm core拓扑?,apache-kafka,apache-storm,Apache Kafka,Apache Storm,我想获得有关ApacheStorm和kafka初始设置的帮助 我能够将拓扑提交给storm群集,但在storm ui中出现以下错误 下面是我的代码片段 // Kafka consumer client depends on Zookeeper when finding kafka nodes. // Zookeeper Host List String zkConnString = "localhost:2181"; String brokerZkPath = "/kafka-cluster-1
// Kafka consumer client depends on Zookeeper when finding kafka nodes.
// Zookeeper Host List
String zkConnString = "localhost:2181";
String brokerZkPath = "/kafka-cluster-1/brokers";
String zkRoot = "/kafka-cluster-1/brokers/topics";
String topicName = "myfirsttopic";
/* ****************************************************************** */
/* Topology configuration variable */
/* ****************************************************************** */
/* the number of tasks that should be assigned to execute this bolt */
Integer boltParalismHint = 1;
Integer spoutParalismHint = 1;
/* ****************************************************************** */
/* Build kafka consumer spout */
/* ****************************************************************** */
// Build zookeeper instance
BrokerHosts hosts = new ZkHosts( zkConnString, brokerZkPath );
// Build configuration instance for Spout
SpoutConfig spoutConfig = new SpoutConfig( hosts, topicName, zkRoot + "/" + topicName , UUID.randomUUID().toString() );
spoutConfig.ignoreZkOffsets = true;
// Build Multischeme instance
spoutConfig.scheme = new SchemeAsMultiScheme( new StringScheme() );
// Build Kafka spout
KafkaSpout kafkaSpout = new KafkaSpout(spoutConfig);
我已经引用了,并将IgnorezkOffset设置为true
如果要强制喷口忽略任何消费状态
存储在ZooKeeper中的信息,那么您应该设置参数
Kafkanconfig.ignorezk偏移为true
然而,从日志上看,卡夫卡喷口似乎正在读取Zookeeper的偏移量
由于这是一个初始设置,我如何停止从Zookeeper读取风暴偏移量
我使用以下版本
- apache storm 1.2.1
- 阿帕奇·卡夫卡·卡夫卡2.12-1.1.0
你找到解决这个问题的办法了吗?我也面临同样的问题@日本指弹新人渡边郁
// Kafka consumer client depends on Zookeeper when finding kafka nodes.
// Zookeeper Host List
String zkConnString = "localhost:2181";
String brokerZkPath = "/kafka-cluster-1/brokers";
String zkRoot = "/kafka-cluster-1/brokers/topics";
String topicName = "myfirsttopic";
/* ****************************************************************** */
/* Topology configuration variable */
/* ****************************************************************** */
/* the number of tasks that should be assigned to execute this bolt */
Integer boltParalismHint = 1;
Integer spoutParalismHint = 1;
/* ****************************************************************** */
/* Build kafka consumer spout */
/* ****************************************************************** */
// Build zookeeper instance
BrokerHosts hosts = new ZkHosts( zkConnString, brokerZkPath );
// Build configuration instance for Spout
SpoutConfig spoutConfig = new SpoutConfig( hosts, topicName, zkRoot + "/" + topicName , UUID.randomUUID().toString() );
spoutConfig.ignoreZkOffsets = true;
// Build Multischeme instance
spoutConfig.scheme = new SchemeAsMultiScheme( new StringScheme() );
// Build Kafka spout
KafkaSpout kafkaSpout = new KafkaSpout(spoutConfig);