【问题标题】:Schema Registry won't start after upgrading to Confluent 4.1升级到 Confluent 4.1 后,Schema Registry 不会启动
【发布时间】:2018-09-30 18:15:17
【问题描述】:

我最近将 Confluent 升级到 4.1,但架构注册表似乎存在一些问题。在 confluent start schema-registry(因此 ksql-server)上无法启动。

这是我在 schema-registry 的日志中得到的错误:

[2018-04-20 11:27:38,426] ERROR Error starting the schema registry (io.confluent.kafka.schemaregistry.rest.SchemaRegistryRestApplication:65)
io.confluent.kafka.schemaregistry.exceptions.SchemaRegistryInitializationException: Error initializing kafka store while initializing schema registry
        at io.confluent.kafka.schemaregistry.storage.KafkaSchemaRegistry.init(KafkaSchemaRegistry.java:203)
        at io.confluent.kafka.schemaregistry.rest.SchemaRegistryRestApplication.setupResources(SchemaRegistryRestApplication.java:63)
        at io.confluent.kafka.schemaregistry.rest.SchemaRegistryRestApplication.setupResources(SchemaRegistryRestApplication.java:41)
        at io.confluent.rest.Application.createServer(Application.java:165)
        at io.confluent.kafka.schemaregistry.rest.SchemaRegistryMain.main(SchemaRegistryMain.java:43)
Caused by: io.confluent.kafka.schemaregistry.storage.exceptions.StoreInitializationException: io.confluent.kafka.schemaregistry.storage.exceptions.StoreException: Failed to write Noop record to kafka store.
        at io.confluent.kafka.schemaregistry.storage.KafkaStore.init(KafkaStore.java:139)
        at io.confluent.kafka.schemaregistry.storage.KafkaSchemaRegistry.init(KafkaSchemaRegistry.java:201)
        ... 4 more
Caused by: io.confluent.kafka.schemaregistry.storage.exceptions.StoreException: Failed to write Noop record to kafka store.
        at io.confluent.kafka.schemaregistry.storage.KafkaStore.getLatestOffset(KafkaStore.java:423)
        at io.confluent.kafka.schemaregistry.storage.KafkaStore.waitUntilKafkaReaderReachesLastOffset(KafkaStore.java:276)
        at io.confluent.kafka.schemaregistry.storage.KafkaStore.init(KafkaStore.java:137)
        ... 5 more
Caused by: java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.NotLeaderForPartitionException: This server is not the leader for that topic-partition.
        at org.apache.kafka.clients.producer.internals.FutureRecordMetadata.valueOrError(FutureRecordMetadata.java:94)
        at org.apache.kafka.clients.producer.internals.FutureRecordMetadata.get(FutureRecordMetadata.java:77)
        at org.apache.kafka.clients.producer.internals.FutureRecordMetadata.get(FutureRecordMetadata.java:29)
        at io.confluent.kafka.schemaregistry.storage.KafkaStore.getLatestOffset(KafkaStore.java:418)
        ... 7 more
Caused by: org.apache.kafka.common.errors.NotLeaderForPartitionException: This server is not the leader for that topic-partition.
[2018-04-20 11:27:38,430] INFO Shutting down schema registry (io.confluent.kafka.schemaregistry.storage.KafkaSchemaRegistry:726)
[2018-04-20 11:27:38,430] INFO [kafka-store-reader-thread-_schemas]: Shutting down (io.confluent.kafka.schemaregistry.storage.KafkaStoreReaderThread:66)
[2018-04-20 11:27:38,431] INFO [kafka-store-reader-thread-_schemas]: Stopped (io.confluent.kafka.schemaregistry.storage.KafkaStoreReaderThread:66)
[2018-04-20 11:27:38,440] INFO [kafka-store-reader-thread-_schemas]: Shutdown completed (io.confluent.kafka.schemaregistry.storage.KafkaStoreReaderThread:66)
[2018-04-20 11:27:38,446] INFO KafkaStoreReaderThread shutdown complete. (io.confluent.kafka.schemaregistry.storage.KafkaStoreReaderThread:227)

我不知道为什么会报告此错误,并且错误消息对我来说没有意义。

失败后,confluent start schema-registryconfluent start ksql-server 启动了这两个服务,但是在启动 KSQL 时我收到以下警告:

**************** WARNING ******************
Remote server address may not be valid:
Error issuing GET to KSQL server
Caused by: java.net.ConnectException: Connection refused (Connection refused)
Caused by: Could not connect to the server.
*******************************************

尝试运行命令时(例如show tables;)报以下错误:

ksql> show tables;
Error issuing POST to KSQL server
Caused by: java.net.ConnectException: Connection refused (Connection refused)
Caused by: Could not connect to the server.

编辑:我已经通过破坏当前运行解决了这个问题(confluent destroy),但如果有人能解释这个问题会很有趣。

【问题讨论】:

    标签: apache-kafka confluent-platform confluent-schema-registry ksqldb


    【解决方案1】:

    根据您发布的信息,感觉您可能在某处有一些僵尸进程或错误数据,但我不能确定。

    Schema Registry 抱怨它无法向 Kafka 写入消息,因为 Kafka 代理抱怨它不拥有 Schema Registry 正在写入的主题分区。这可能是由以前的 Kafka 代理(从旧安装)引起的,仍在运行。

    升级前你confluent stop了吗?

    使用confluent destroy,就像你做的那样,扁平化/重置安装总是一个不错的选择,只要你不珍惜你的数据。检查虚假进程(或使用旧的“重启机器”技巧)也可以是在事情未按预期运行时开始的好地方。

    很高兴现在一切都整理好了:D

    安迪

    【讨论】:

    • 我不确定我是否在升级前运行了confluent stop。很可能我没有,所以我猜这可能会导致问题!干杯。
    猜你喜欢
    • 2019-06-23
    • 2016-12-31
    • 2018-08-02
    • 1970-01-01
    • 2021-10-04
    • 2017-10-06
    • 2019-05-01
    • 2023-01-11
    • 1970-01-01
    相关资源
    最近更新 更多