But when I use commands like create topic at the bottom of it, I get a timeout error
$ docker run --net=host --rm confluentinc/cp-kafka:5.3.1 kafka-topics --create --topic test_topic --partitions 1 --replication-factor 1 --if-not-exists --zookeeper localhost:22181
Exception in thread "main" kafka.zookeeper.ZooKeeperClientTimeoutException: Timed out waiting for connection while in state: CONNECTING
at kafka.zookeeper.ZooKeeperClient.$anonfun$waitUntilConnected$3(ZooKeeperClient.scala:258)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
at kafka.utils.CoreUtils$.inLock(CoreUtils.scala:253)
at kafka.zookeeper.ZooKeeperClient.waitUntilConnected(ZooKeeperClient.scala:254)
at kafka.zookeeper.ZooKeeperClient.<init>(ZooKeeperClient.scala:112)
at kafka.zk.KafkaZkClient$.apply(KafkaZkClient.scala:1826)
at kafka.admin.TopicCommand$ZookeeperTopicService$.apply(TopicCommand.scala:280)
at kafka.admin.TopicCommand$.main(TopicCommand.scala:53)
at kafka.admin.TopicCommand.main(TopicCommand.scala)
The other commands are the same, please ask if the image version is not correct or the parameters are not correct
I created a single node kafka based on the way in the link.
But when I use commands like create topic at the bottom of it, I get a timeout error
The other commands are the same, please ask if the image version is not correct or the parameters are not correct
Looking forward to your reply