# A comma separated list of directories under which to store log files log.dirs=/home/kafka1,/home/kafka2,/home/kafka3 # Zookeeper connection string zookeeper.connect=zk1:2181,zk2:2181,zk3:2181/kafka1 # Timeout in ms for connecting to zookeeper zookeeper.connection.timeout.ms=18000 # The address the socket server listens on listeners=PLAINTEXT://:9092 # Hostname and port the broker will advertise advertised.listeners=PLAINTEXT://:9092 # Log retention settings log.retention.hours=168 log.retention.ms=15552000000 log.retention.bytes=1073741824 log.segment.bytes=1073741824 log.retention.check.interval.ms=300000
This is a safety mechanism which guarantees that only active members of the group are able to commit offsets. So to stay in the group, you must continue to call poll.
GC 参数
The recommended way to handle these cases is to move message processing to another thread, which allows the consumer to continue callingpollwhile the processor is still working. Some care must be taken to ensure that committed offsets do not get ahead of the actual position.
# The number of threads that the server uses for receiving requests from the network and sending responses to the network num.network.threads=3 # The number of threads that the server uses for processing requests, which may include disk I/O num.io.threads=8
# 修改配置 vi /etc/sysctl.conf # The percentage of how likely the VM subsystem is to use swap space rather than dropping pages from the page cache. vm.swappiness=1 # The percentage of the total amount of system memory, and setting this value to 5 is appropriate in many situations. vm.dirty_background_ratio=5