Reputation: 11
Install kafka info :
Cent OS hosts Add :
<VM GUEST IP> localhost
kafka server.config :
listeners=PLAINTEXT://0.0.0.0:9092
advertised.listeners=PLAINTEXT://<VM GUEST IP>:9092
host.name=<VM GUEST IP>
VMWare Nat Setting :
19092 > <VM GUEST IP>:9092
12181 > <VM GUEST IP>:2181
Cent OS Firewall open 9092,2181.
Windows Server port open 19092, 12181.And Complete the tcping test from another user's computer.
However, there is no connection between Producer and Customer test.
Test :
bin/kafka-console-producer.sh --broker-list <windows server IP>:19092 --topic <topic>
Result N/A But :
Connection to node 0 (/<VMWare IP>:9092) could not be established. Broker may not be available.
There was nothing wrong with VMWare. Similarly, Producer and Customer tests passed correctly on Windows server.
Other users' computers cannot be accessed.What is the problem?
Upvotes: 0
Views: 550
Reputation: 191874
The advertised.listeners
needs to expose 19092
if you plan on using clients outside of the VM network.
See this blog, replacing "Docker/AWS" with "VMWare"
Example configuration
listeners=INTERNAL://0.0.0.0:19092,EXTERNAL://0.0.0.0:9092
listener.security.protocol.map=INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
advertised.listeners=INTERNAL://<VM address>:19092,EXTERNAL://<Host Address>:9092
inter.broker.listener.name=INTERNAL
Upvotes: 2