What is the ZooKeeper address format used in these Kafka command examples?

Study for the CCDAK Apache Kafka Test. Use flashcards and multiple choice questions with hints and explanations for each question. Prepare thoroughly for your exam!

Multiple Choice

What is the ZooKeeper address format used in these Kafka command examples?

Explanation:
ZooKeeper is addressed with a host and a port in the form host:port, and 2181 is the default port for ZooKeeper. In these Kafka command examples the ZooKeeper service is on the local machine, so the address shown is localhost:2181. The port 9092 belongs to Kafka brokers, not ZooKeeper, so that would point to a broker instead of the ZooKeeper service. Using 127.0.0.1:2181 would connect to the same local host, so it’s functionally equivalent, but the exact string in the examples uses localhost. A hostname like zookeeper:2181 could work if that host resolves in the environment, but it isn’t the exact format used in the given examples.

ZooKeeper is addressed with a host and a port in the form host:port, and 2181 is the default port for ZooKeeper. In these Kafka command examples the ZooKeeper service is on the local machine, so the address shown is localhost:2181. The port 9092 belongs to Kafka brokers, not ZooKeeper, so that would point to a broker instead of the ZooKeeper service. Using 127.0.0.1:2181 would connect to the same local host, so it’s functionally equivalent, but the exact string in the examples uses localhost. A hostname like zookeeper:2181 could work if that host resolves in the environment, but it isn’t the exact format used in the given examples.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy