You are viewing documentation for an older version (0.7) of Kafka. For up-to-date documentation, see the latest version.

Important configuration properties for Kafka broker

Important configuration properties for Kafka broker

Important configuration properties for Kafka broker:

More details about server configuration can be found in the scala class kafka.server.KafkaConfig.

namedefaultdescription
brokeridnoneEach broker is uniquely identified by an id. This id serves as the brokers “name”, and allows the broker to be moved to a different host/port without confusing consumers.
enable.zookeepertrueenable zookeeper registration in the server
log.flush.interval500Controls the number of messages accumulated in each topic (partition) before the data is flushed to disk and made available to consumers.
log.default.flush.scheduler.interval.ms3000Controls the interval at which logs are checked to see if they need to be flushed to disk. A background thread will run at a frequency specified by this parameter and will check each log to see if it has exceeded its flush.interval time, and if so it will flush it.
log.default.flush.interval.mslog.default.flush.scheduler.interval.msControls the maximum time that a message in any topic is kept in memory before flushed to disk. The value only makes sense if it’s a multiple of log.default.flush.scheduler.interval .ms
topic.flush.intervals.msnonePer-topic overrides for log.default.flush.interval.ms. Controls the maximum time that a message in selected topics is kept in memory before flushed to disk. The per-topic value only makes sense if it’s a multiple of log.default.flush.scheduler.interval.ms. E.g., topic1:1000,topic2:2000
log.retention.hours168Controls how long a log file is retained.
topic.log.retention.hoursnoneTopic-specific retention time that overrides log.retention.hours, e.g., topic1:10,topic2:20
log.retention.size-1the maximum size of the log before deleting it. This controls how large a log is allowed to grow
log.cleanup.interval.mins10Controls how often the log cleaner checks logs eligible for deletion. A log file is eligible for deletion if it hasn’t been modified for log.retention.hours hours.
log.dirnoneSpecifies the root directory in which all log data is kept.
log.file.size110241024*1024Controls the maximum size of a single log file.
log.roll.hours24 * 7The maximum time before a new log segment is rolled out
max.socket.request.bytes104857600the maximum number of bytes in a socket request
monitoring.period.secs600the interval in which to measure performance statistics
num.threadsRuntime.getRuntime().availableProcessorsControls the number of worker threads in the broker to serve requests.
num.partitions1Specifies the default number of partitions per topic.
socket.send.buffer102400the SO_SNDBUFF buffer of the socket sever sockets
socket.receive.buffer102400the SO_RCVBUFF buffer of the socket sever sockets
topic.partition.count.mapnoneOverride parameter to control the number of partitions for selected topics. E.g., topic1:10,topic2:20
zk.connectlocalhost:2182/kafkaSpecifies the zookeeper connection string in the form hostname:port/chroot. Here the chroot is a base directory which is prepended to all path operations (this effectively namespaces all kafka znodes to allow sharing with other applications on the same zookeeper cluster)
zk.connectiontimeout.ms6000Specifies the max time that the client waits to establish a connection to zookeeper.
zk.sessiontimeout.ms6000The zookeeper session timeout.
zk.synctime.ms2000Max time for how far a ZK follower can be behind a ZK leader