Broker configuration basics in Kafka - Commands & Configuration
broker.id=1 listeners=PLAINTEXT://:9092 log.dirs=/tmp/kafka-logs num.network.threads=3 num.io.threads=8 socket.send.buffer.bytes=102400 socket.receive.buffer.bytes=102400 socket.request.max.bytes=104857600 log.retention.hours=168 log.segment.bytes=1073741824 log.retention.check.interval.ms=300000 zookeeper.connect=localhost:2181
broker.id: Unique ID for this broker in the cluster.
listeners: Network address and port where the broker listens for client connections.
log.dirs: Directory where Kafka stores message logs.
num.network.threads and num.io.threads: Threads for handling network and disk I/O.
socket.*: Network buffer sizes for efficient data transfer.
log.retention.hours: How long to keep logs before deletion.
log.segment.bytes: Size of log segments before rolling over.
log.retention.check.interval.ms: How often Kafka checks for expired logs.
zookeeper.connect: Address of ZooKeeper managing the cluster metadata.
kafka-server-start.sh server.properties
netstat -tuln | grep 9092
ls /tmp/kafka-logsIf you remember nothing else from this pattern, remember: the broker configuration file controls how the Kafka broker connects, stores data, and communicates, so setting it correctly is essential for a healthy Kafka cluster.