Anthony Vinay
Anthony Vinay

Reputation: 657

Not able to start kafka in local machine

I have downloaded kafka 2.4.0 binaries for Windows. When I start kafka from command line using kafka-server-start.bat using server.properties file, I get the following errors :

[2020-02-04 15:37:33,775] WARN [Controller id=0, targetBrokerId=0] Connection to node 0 (host.docker.internal/10.177.172.141:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
[2020-02-04 15:37:34,931] WARN [Controller id=0, targetBrokerId=0] Connection to node 0 (host.docker.internal/10.177.172.141:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
[2020-02-04 15:37:36,122] WARN [Controller id=0, targetBrokerId=0] Connection to node 0 (host.docker.internal/10.177.172.141:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
[2020-02-04 15:37:37,364] WARN [Controller id=0, targetBrokerId=0] Connection to node 0 (host.docker.internal/10.177.172.141:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
[2020-02-04 15:37:38,692] WARN [Controller id=0, targetBrokerId=0] Connection to node 0 (host.docker.internal/10.177.172.141:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)

From the Zookeeper logs I get these errors :

[2020-02-04 15:37:23,056] INFO Client attempting to establish new session at /127.0.0.1:51457 (org.apache.zookeeper.server.ZooKeeperServer)
[2020-02-04 15:37:23,071] INFO Established session 0x100000298ee0000 with negotiated timeout 6000 for client /127.0.0.1:51457 (org.apache.zookeeper.server.ZooKeeperServer)
[2020-02-04 15:37:23,198] INFO Got user-level KeeperException when processing sessionid:0x100000298ee0000 type:create cxid:0x1 zxid:0x12c txntype:-1 reqpath:n/a Error Path:/consumers Error:KeeperErrorCode = NodeExists for /consumers (org.apache.zookeeper.server.PrepRequestProcessor)
[2020-02-04 15:37:23,214] INFO Got user-level KeeperException when processing sessionid:0x100000298ee0000 type:create cxid:0x2 zxid:0x12d txntype:-1 reqpath:n/a Error Path:/brokers/ids Error:KeeperErrorCode = NodeExists for /brokers/ids (org.apache.zookeeper.server.PrepRequestProcessor)
[2020-02-04 15:37:23,230] INFO Got user-level KeeperException when processing sessionid:0x100000298ee0000 type:create cxid:0x3 zxid:0x12e txntype:-1 reqpath:n/a Error Path:/brokers/topics Error:KeeperErrorCode = NodeExists for /brokers/topics (org.apache.zookeeper.server.PrepRequestProcessor)

I have docker installed, but it is not running. The server.properties file is untouched. I am not able to understand and debug why it is connecting to "host.docker.internal".

Note : Kafka ran successfully once. I remember I did a force shutdown of windows when kafka was running. I do not know whether this can be the issue. I tried the lower version of kafka, I am still getting the same error.

Upvotes: 0

Views: 1279

Answers (2)

Anthony Vinay
Anthony Vinay

Reputation: 657

Windows Hosts file was not looking good to me.

  • I uninstalled Docker.
  • Removed all entries of "host.docker.internal", "gateway.docker.internal", "kubernetes.docker.internal".
  • Restarted my system and Kafka was running properly.

Upvotes: 0

OneCricketeer
OneCricketeer

Reputation: 191963

why it is connecting to "host.docker.internal

Most likely, your Windows Hosts file has been updated with that property.

You need to edit your server.properties to use

listeners=PLAINTEXT://0.0.0.0:9092
advertised.listeners=PLAINTEXT://127.0.0.1:9092

Upvotes: 1

Related Questions