我正在尝试为 Kafka Rest 运行第二个实例。这是第一个的属性文件:
id=kafka-rest-test-server-1
schema.registry.url=http://localhost:8081,http://localhost:9081
zookeeper.connect=localhost:2181,localhost:2182,localhost:2183
bootstrap.servers=PLAINTEXT://localhost:9092,PLAINTEXT://localhost:9093,PLAINTEXT://localhost:9094
多个实例的唯一要求是您为每个实例设置一个唯一的 ID。
但是,当我使用 other 运行第二个实例时id
,会抛出一个异常,指出该地址已在使用中:
WARN FAILED io.confluent.rest.Application$1@41294f8: java.net.BindException: Address already in use (org.eclipse.jetty.util.component.AbstractLifeCycle:212)
java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
...