Apache Kafka Kafka Security & Configuration 2 — Questions and Answers
Question 1: Where is the `server.properties` file used in a Kafka deployment?
- It is the main broker configuration file containing all broker settings (Correct answer)
- It configures the Kafka Streams application
- It stores consumer group credentials
- It defines Connect worker settings
Correct answer: It is the main broker configuration file containing all broker settings
server.properties is the primary configuration file for each Kafka broker, containing settings like listener ports, log directories, and replication defaults.
Question 2: What does the `log.dirs` broker configuration specify?
- One or more comma-separated directories where Kafka stores partition log data on disk (Correct answer)
- The directory for broker application logs
- The path to ZooKeeper data files
- SSL key store directory
Correct answer: One or more comma-separated directories where Kafka stores partition log data on disk
log.dirs tells Kafka brokers which directories to use for storing partition segment files; spreading across multiple paths can improve I/O throughput.
Question 3: What is the default Kafka broker port?
- 9092 (Correct answer)
- 2181
- 8080
- 9093
Correct answer: 9092
Kafka brokers listen on port 9092 by default for PLAINTEXT client connections (port 9093 is common for SSL).
Question 4: What does `inter.broker.listener.name` configure?
- The listener name that brokers use for internal replication communication (Correct answer)
- The external client-facing listener
- The ZooKeeper connection string
- The admin REST API port
Correct answer: The listener name that brokers use for internal replication communication
inter.broker.listener.name specifies which named listener (and its associated protocol) is used for broker-to-broker replication traffic.
Question 5: What Kafka broker setting controls the maximum message size the broker will accept?
- message.max.bytes (Correct answer)
- max.message.size
- fetch.max.bytes
- log.segment.bytes
Correct answer: message.max.bytes
message.max.bytes (default 1 MB) is the maximum size of a batch that the broker will accept from producers; exceeding it results in a MESSAGE_TOO_LARGE error.
Question 6: How does Kafka KRaft mode differ from the ZooKeeper-based architecture?
- KRaft mode eliminates ZooKeeper by storing cluster metadata in a Kafka internal topic managed by a Raft consensus quorum (Correct answer)
- KRaft uses an external etcd cluster instead of ZooKeeper
- KRaft is a client-side caching layer
- KRaft mode requires a dedicated metadata broker tier
Correct answer: KRaft mode eliminates ZooKeeper by storing cluster metadata in a Kafka internal topic managed by a Raft consensus quorum
KRaft (Kafka Raft) replaces ZooKeeper with Kafka's own built-in Raft consensus protocol for metadata management, simplifying operations.
Where is the `server.properties` file used in a Kafka deployment?