Complete the code to start a Kafka broker with ZooKeeper connection.
bin/kafka-server-start.sh config/server.properties --override zookeeper.connect=[1]The Kafka broker connects to ZooKeeper at the default port 2181 on localhost.
Complete the configuration to enable KRaft mode in Kafka broker.
process.roles=[1]In KRaft mode, the broker acts as both broker and controller, so both roles are set.
Fix the error in the KRaft controller quorum configuration.
controller.quorum.voters=[1]The correct format for voters is 'id@host:port' separated by commas.
Fill both blanks to configure the KRaft metadata log directory and cluster id.
metadata.log.dir=[1] cluster.id=[2]
The metadata log directory is set to a dedicated KRaft logs folder, and the cluster id is a UUID string.
Fill all three blanks to create a dictionary comprehension that maps broker ids to their ports in KRaft mode.
broker_ports = [1]: [2] for [3] in range(1, 4)}
This comprehension creates a dictionary where keys are broker ids and values are ports calculated by adding 9092 to 1000 times the id.