0

我正在使用 Confluent Platform v5.5.0

在遵循 Confluent 快速入门步骤后,我运行了 Zookeeper、Kafka、注册表模式和 REST 代理: https ://docs.confluent.io/current/kafka-rest/quickstart.html

我没有对任何配置进行任何更改,只下载了 Confluent 5.5.0 并在单独的终端窗口中启动了 4 个进程中的每一个。

但是,当我尝试通过发布示例来创建消费者时,错误在 REST 代理终端窗口中显示了几次:

[2020-06-07 10:26:38,403] INFO Terminate ZkClient event thread. (org.I0Itec.zkclient.ZkEventThread:83)
[2020-06-07 10:26:38,440] ERROR Unhandled exception (io.confluent.rest.exceptions.KafkaExceptionMapper:123)
java.lang.IllegalArgumentException: A HostProvider may not be empty!
    at org.apache.zookeeper.client.StaticHostProvider.init(StaticHostProvider.java:136)
    at org.apache.zookeeper.client.StaticHostProvider.<init>(StaticHostProvider.java:87)
    at org.apache.zookeeper.ZooKeeper.createDefaultHostProvider(ZooKeeper.java:1312)
    at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:951)
    at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:688)
    at org.I0Itec.zkclient.ZkConnection.connect(ZkConnection.java:70)
    at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:1228)
    at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:157)
    at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:131)
    at io.confluent.kafka.utils.ZkUtils$.createZkClientAndConnection(ZkUtils.scala:95)

我能够向这些端点发送 GET 请求

http://192.168.1.164:8082/topics/jsontest
http://192.168.1.164:8081/config

并分别接收主题列表和配置。所以我认为 REST 代理大部分都在工作,但我在属性文件中遗漏了一些东西。

我在 /etc/kafka-rest/kafka-rest.properties 中找到了这一行

#zookeeper.connect=localhost:2181

但取消注释它只会给出错误:

[2020-06-07 12:33:11,546] ERROR Server died unexpectedly:  (io.confluent.kafka.schemaregistry.rest.SchemaRegistryMain:50)
java.io.IOException: Failed to bind to /0.0.0.0:8081
    at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:346)
    at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:307)
    at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
    at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:231)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
    at org.eclipse.jetty.server.Server.doStart(Server.java:385)
    at io.confluent.rest.ApplicationServer.doStart(ApplicationServer.java:192)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
    at io.confluent.kafka.schemaregistry.rest.SchemaRegistryMain.main(SchemaRegistryMain.java:43)
Caused by: java.net.BindException: Address already in use

有什么事情是我错过或做错的事情吗?谢谢你的任何想法!

4

0 回答 0