Hi Podunk, If you're saying the error: ERROR Exiting JVM with code 0 (org.apache.zookeeper.util.ServiceUtils), I think this is a bug in Kafka. I guess it's because we didn't close ZooKeeperAdmin before exit. Please open a JIRA ticket for it, and welcome to file a PR for it!
But for the ZK shell, it works well. It returned [0] to you since you only have one broker in the cluster with id 0. For me, I used to enter the ZK shell, and type command, like this: > bin/zookeeper-shell.sh localhost:2181 Connecting to localhost:2181 Welcome to ZooKeeper! .... # then, type commands like in normal shell ls /brokers [ids, seqid, topics] ls /brokers/ids [0] ... Hope that helps. Luke On Wed, Aug 3, 2022 at 7:32 PM <pod...@gmx.com> wrote: > Anyone? > > > > > Sent: Saturday, July 30, 2022 at 9:14 PM > From: pod...@gmx.com > To: users@kafka.apache.org > Subject: An existing connection was forcibly closed by the remote host > > > Hi, > > I start to learn Kafka and.. I have first problem. > I started Zookeeper, I started Kafka - both on localhost. Seems all is > fine. But when I try to execute command: > > zookeeper-shell.bat localhost:2181 ls /brokers/ids > > I get error: > > Connecting to localhost:2181 > WATCHER:: > WatchedEvent state:SyncConnected type:None path:null > [0] > [2022-07-30 19:54:22,524] ERROR Exiting JVM with code 0 > (org.apache.zookeeper.util.ServiceUtils) > > And in Zookeeper: > > [2022-07-30 19:54:53,335] INFO Expiring session 0x10000190aa20001, timeout > of 30000ms exceeded (org.apache.zookeeper.server.ZooKeeperServer) > [2022-07-30 19:58:05,393] WARN Close of session 0x10000190aa20002 > (org.apache.zookeeper.server.NIOServerCnxn) > java.io.IOException: An existing connection was forcibly closed by the > remote host > at java.base/sun.nio.ch.SocketDispatcher.read0(Native Method) > at java.base/sun.nio.ch > .SocketDispatcher.read(SocketDispatcher.java:43) > at > java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276) > at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:245) > at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:223) > at java.base/sun.nio.ch > .SocketChannelImpl.read(SocketChannelImpl.java:358) > at > org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:324) > at > org.apache.zookeeper.server.NIOServerCnxnFactory$IOWorkRequest.doWork(NIOServerCnxnFactory.java:522) > at > org.apache.zookeeper.server.WorkerService$ScheduledWorkRequest.run(WorkerService.java:154) > at > java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) > at > java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) > at java.base/java.lang.Thread.run(Thread.java:834) > > > server.properties: > listeners=PLAINTEXT://localhost:9092 > advertised.listeners=PLAINTEXT://localhost:9092 > > zookeeper.connection.timeout.ms=18000 > > zookeeper.properties: > clientPort=2181 > maxSessionTimeout=18000 > > What can be the reason? >