| 1 |
# Licensed to the Apache Software Foundation (ASF) under one or more |
| 2 |
# contributor license agreements. See the NOTICE file distributed with |
| 3 |
# this work for additional information regarding copyright ownership. |
| 4 |
# The ASF licenses this file to You under the Apache License, Version 2.0 |
| 5 |
# (the "License"); you may not use this file except in compliance with |
| 6 |
# the License. You may obtain a copy of the License at |
| 7 |
# |
| 8 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
# |
| 10 |
# Unless required by applicable law or agreed to in writing, software |
| 11 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
# See the License for the specific language governing permissions and |
| 14 |
# limitations under the License. |
| 15 |
# see kafka.server.KafkaConfig for additional details and defaults |
| 16 |
|
| 17 |
############################# Server Basics ############################# |
| 18 |
|
| 19 |
# The id of the broker. This must be set to a unique integer for each broker. |
| 20 |
broker.id=KAFKAID |
| 21 |
reserved.broker.max.id=10000 |
| 22 |
|
| 23 |
############################# Socket Server Settings ############################# |
| 24 |
|
| 25 |
# The port the socket server listens on |
| 26 |
port=KAFKAPORT |
| 27 |
|
| 28 |
# Hostname the broker will bind to. If not set, the server will bind to all interfaces |
| 29 |
host.name=localhost |
| 30 |
|
| 31 |
# Hostname the broker will advertise to producers and consumers. If not set, it uses the |
| 32 |
# value for "host.name" if configured. Otherwise, it will use the value returned from |
| 33 |
# java.net.InetAddress.getCanonicalHostName(). |
| 34 |
advertised.host.name=KAFKA_HOSTNAME |
| 35 |
advertised.port=KAFKAID |
| 36 |
|
| 37 |
# The port to publish to ZooKeeper for clients to use. If this is not set, |
| 38 |
# it will publish the same port that the broker binds to. |
| 39 |
# advertised.port=<port accessible by clients> |
| 40 |
|
| 41 |
# The number of threads handling network requests |
| 42 |
num.network.threads=2 |
| 43 |
|
| 44 |
# The number of threads doing disk I/O |
| 45 |
num.io.threads=8 |
| 46 |
|
| 47 |
# The send buffer (SO_SNDBUF) used by the socket server |
| 48 |
socket.send.buffer.bytes=1048576 |
| 49 |
|
| 50 |
# The receive buffer (SO_RCVBUF) used by the socket server |
| 51 |
socket.receive.buffer.bytes=1048576 |
| 52 |
|
| 53 |
# The maximum size of a request that the socket server will accept (protection against OOM) |
| 54 |
socket.request.max.bytes=104857600 |
| 55 |
|
| 56 |
|
| 57 |
############################# Log Basics ############################# |
| 58 |
|
| 59 |
# A comma seperated list of directories under which to store log files |
| 60 |
log.dirs=KAFKA_DATADIR |
| 61 |
|
| 62 |
# The default number of log partitions per topic. More partitions allow greater |
| 63 |
# parallelism for consumption, but this will also result in more files across |
| 64 |
# the brokers. |
| 65 |
num.partitions=2 |
| 66 |
|
| 67 |
# Create new topics with a replication factor of 2 so failover can be tested |
| 68 |
# more easily. |
| 69 |
default.replication.factor=2 |
| 70 |
|
| 71 |
auto.create.topics.enable=false |
| 72 |
delete.topic.enable=true |
| 73 |
|
| 74 |
############################# Log Flush Policy ############################# |
| 75 |
|
| 76 |
# Messages are immediately written to the filesystem but by default we only fsync() to sync |
| 77 |
# the OS cache lazily. The following configurations control the flush of data to disk. |
| 78 |
# There are a few important trade-offs here: |
| 79 |
# 1. Durability: Unflushed data may be lost if you are not using replication. |
| 80 |
# 2. Latency: Very large flush intervals may lead to latency spikes when the flush does occur as there will be a lot of data to flush. |
| 81 |
# 3. Throughput: The flush is generally the most expensive operation, and a small flush interval may lead to exceessive seeks. |
| 82 |
# The settings below allow one to configure the flush policy to flush data after a period of time or |
| 83 |
# every N messages (or both). This can be done globally and overridden on a per-topic basis. |
| 84 |
|
| 85 |
# The number of messages to accept before forcing a flush of data to disk |
| 86 |
#log.flush.interval.messages=10000 |
| 87 |
|
| 88 |
# The maximum amount of time a message can sit in a log before we force a flush |
| 89 |
#log.flush.interval.ms=1000 |
| 90 |
|
| 91 |
############################# Log Retention Policy ############################# |
| 92 |
|
| 93 |
# The following configurations control the disposal of log segments. The policy can |
| 94 |
# be set to delete segments after a period of time, or after a given size has accumulated. |
| 95 |
# A segment will be deleted whenever *either* of these criteria are met. Deletion always happens |
| 96 |
# from the end of the log. |
| 97 |
|
| 98 |
# The minimum age of a log file to be eligible for deletion |
| 99 |
log.retention.hours=168 |
| 100 |
|
| 101 |
# A size-based retention policy for logs. Segments are pruned from the log as long as the remaining |
| 102 |
# segments don't drop below log.retention.bytes. |
| 103 |
log.retention.bytes=268435456 |
| 104 |
|
| 105 |
# The maximum size of a log segment file. When this size is reached a new log segment will be created. |
| 106 |
log.segment.bytes=268435456 |
| 107 |
|
| 108 |
# The interval at which log segments are checked to see if they can be deleted according |
| 109 |
# to the retention policies |
| 110 |
log.retention.check.interval.ms=60000 |
| 111 |
|
| 112 |
# By default the log cleaner is disabled and the log retention policy will default to just delete segments after their retention expires. |
| 113 |
# If log.cleaner.enable=true is set the cleaner will be enabled and individual logs can then be marked for log compaction. |
| 114 |
log.cleaner.enable=false |
| 115 |
|
| 116 |
############################# Zookeeper ############################# |
| 117 |
|
| 118 |
# Zookeeper connection string (see zookeeper docs for details). |
| 119 |
# This is a comma separated host:port pairs, each corresponding to a zk |
| 120 |
# server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002". |
| 121 |
# You can also append an optional chroot string to the urls to specify the |
| 122 |
# root directory for all kafka znodes. |
| 123 |
zookeeper.connect=localhost:ZK_PORT |
| 124 |
|
| 125 |
# Timeout in ms for connecting to zookeeper |
| 126 |
zookeeper.session.timeout.ms=3000 |
| 127 |
zookeeper.connection.timeout.ms=3000 |