【发布时间】:2020-06-02 23:44:30
【问题描述】:
在关闭了自动创建主题的 Kafka 集群上运行 Kafka Connect。据我所见,在另一个正在运行的集群上,我们创建了连接配置、连接偏移和连接状态等主题。因此,这些主题在具有相同复制因子和分区的新集群上重新创建。
虽然我有从连接实例到代理的 netcat 并且那里没有连接问题,但我们在启动服务时遇到错误
Could not look up partition metadata for offset backing store topic in allotted period. This could indicate a connectivity issue, unavailable topic partitions, or if this is your first use of the topic it may have taken too long to create
我可以从 connect utils 类看到它在下面抛出的位置。但是已经检查过,这些主题现在已经创建了所以有点丢失了
producer = createProducer();
consumer = createConsumer();
List<TopicPartition> partitions = new ArrayList<>();
// We expect that the topics will have been created either manually by the user or automatically by the herder
List<PartitionInfo> partitionInfos = null;
long started = time.milliseconds();
while (partitionInfos == null && time.milliseconds() - started < CREATE_TOPIC_TIMEOUT_MS) {
partitionInfos = consumer.partitionsFor(topic);
Utils.sleep(Math.min(time.milliseconds() - started, 1000));
}
if (partitionInfos == null)
throw new ConnectException("Could not look up partition metadata for offset backing store topic in" +
" allotted period. This could indicate a connectivity issue, unavailable topic partitions, or if" +
" this is your first use of the topic it may have taken too long to create
【问题讨论】:
-
请描述每个主题
-
@cricket_007 我明天会回到笔记本电脑,但从查看文档来看,我认为问题可能是偏移存储主题。我知道它不是使用压缩清理策略创建的。不确定这是否重要?
-
应该是,默认情况下
-
不是因为主题是手动创建的,这解决了我的问题。如果您愿意,可以将其发布为答案,我会接受
标签: java apache-kafka apache-kafka-connect