Open source software supply chain lighting plan, waiting for you>>>
The problem is that there is no problem testing locally
1. View topice
./bin/kafka-topics.sh -list -zookeeper localhost:2181
No problem
2、
./bin/kafka-console-producer.sh –broker-list localhost:9092 –topic liuda
3,、
./bin/kafka-console-consumer.sh –bootstrap-server localhost:9092 –topic liuda –from-beginning
there is no problem in these steps
But when testing with java code, it always reports an error: the link is not available
java.net.ConnectException: Connection timed out: no further information
1. The firewall is off, no problem
2. In the configuration file server. Properties
# listeners=PLAINTEXT://0.0.0.0:9092
#advertised.listeners=PLAINTEXT://120.78.22.22:9092
What we need to pay attention to here is
Both are disabled
Still not
Baidu checked the original when using the producer and consumer client of Kafka, it can’t use localhost, but must specify the local domain name clearly
In server.properties, add the following configuration:
Host. Name = 192.168.111.130 # local IP address
So that the project can be happily connected
Similar Posts:
- kafka java.net.ConnectException: Connection timed out: no further information
- [Solved] Kafka 0.8.2.2 Producer:java.net.ConnectException: Connection timed out: no further information
- zookeeper is not a recognized option [How to Solve]
- Rabbitmq error of connecting the native idea to Linux: java.net.connectexception: connection timed out: Connect [Solved]
- Kafka startup error & problem solving
- [Solved] MySQL Connect Error: Can’t connect to MySQL server on ‘ ‘(61)
- Hiveserver2 Connect Error: Could not open client transport with JDBC Uri: jdbc:hive2://hadoop01:100…
- Tomcat Command Error: Catalina.stop: connect reused solution
- Kafka creates topic error: org.apache.kafka.common.errors.InvalidReplicationFactorException: Replication factor: 1 larger than available brokers: 0.
- Magento SMTP – “could not open socket”