23
23
sed -i "s/#init#broker.rack=#init#/broker.rack=$ZONE/" /etc/kafka/server.properties
24
24
fi
25
25
26
+ # This requires additional RBAC, and won't be needed after https://github.com/kubernetes/kubernetes/pull/55329
26
27
kubectl -n $POD_NAMESPACE label pod $POD_NAME kafka-broker-id=$KAFKA_BROKER_ID
27
28
28
29
OUTSIDE_HOST=$(kubectl get node "$NODE_NAME" -o jsonpath='{.status.addresses[?(@.type=="InternalIP")].address}')
@@ -35,22 +36,26 @@ data:
35
36
}
36
37
37
38
server.properties : |-
38
- # Licensed to the Apache Software Foundation (ASF) under one or more
39
- # contributor license agreements. See the NOTICE file distributed with
40
- # this work for additional information regarding copyright ownership.
41
- # The ASF licenses this file to You under the Apache License, Version 2.0
42
- # (the "License"); you may not use this file except in compliance with
43
- # the License. You may obtain a copy of the License at
44
- #
45
- # http://www.apache.org/licenses/LICENSE-2.0
46
- #
47
- # Unless required by applicable law or agreed to in writing, software
48
- # distributed under the License is distributed on an "AS IS" BASIS,
49
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
50
- # See the License for the specific language governing permissions and
51
- # limitations under the License.
52
-
53
- # see kafka.server.KafkaConfig for additional details and defaults
39
+ ############################# Log Basics #############################
40
+
41
+ # A comma seperated list of directories under which to store log files
42
+ # Overrides log.dir
43
+ log.dirs=/var/lib/kafka/data/topics
44
+
45
+ # The default number of log partitions per topic. More partitions allow greater
46
+ # parallelism for consumption, but this will also result in more files across
47
+ # the brokers.
48
+ num.partitions=1
49
+
50
+ default.replication.factor=3
51
+
52
+ min.insync.replicas=2
53
+
54
+ auto.create.topics.enable=true
55
+
56
+ # The number of threads per data directory to be used for log recovery at startup and flushing at shutdown.
57
+ # This value is recommended to be increased for installations with data dirs located in RAID array.
58
+ num.recovery.threads.per.data.dir=1
54
59
55
60
############################# Server Basics #############################
56
61
@@ -96,21 +101,6 @@ data:
96
101
# The maximum size of a request that the socket server will accept (protection against OOM)
97
102
socket.request.max.bytes=104857600
98
103
99
-
100
- ############################# Log Basics #############################
101
-
102
- # A comma seperated list of directories under which to store log files
103
- log.dirs=/tmp/kafka-logs
104
-
105
- # The default number of log partitions per topic. More partitions allow greater
106
- # parallelism for consumption, but this will also result in more files across
107
- # the brokers.
108
- num.partitions=1
109
-
110
- # The number of threads per data directory to be used for log recovery at startup and flushing at shutdown.
111
- # This value is recommended to be increased for installations with data dirs located in RAID array.
112
- num.recovery.threads.per.data.dir=1
113
-
114
104
############################# Internal Topic Settings #############################
115
105
# The replication factor for the group metadata internal topics "__consumer_offsets" and "__transaction_state"
116
106
# For anything other than development testing, a value greater than 1 is recommended for to ensure availability such as 3.
@@ -143,7 +133,7 @@ data:
143
133
# from the end of the log.
144
134
145
135
# The minimum age of a log file to be eligible for deletion due to age
146
- log.retention.hours=168
136
+ log.retention.hours=-1
147
137
148
138
# A size-based retention policy for logs. Segments are pruned from the log as long as the remaining
149
139
# segments don't drop below log.retention.bytes. Functions independently of log.retention.hours.
@@ -163,7 +153,7 @@ data:
163
153
# server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002".
164
154
# You can also append an optional chroot string to the urls to specify the
165
155
# root directory for all kafka znodes.
166
- zookeeper.connect=localhost :2181
156
+ zookeeper.connect=zookeeper :2181
167
157
168
158
# Timeout in ms for connecting to zookeeper
169
159
zookeeper.connection.timeout.ms=6000
@@ -179,21 +169,6 @@ data:
179
169
group.initial.rebalance.delay.ms=0
180
170
181
171
log4j.properties : |-
182
- # Licensed to the Apache Software Foundation (ASF) under one or more
183
- # contributor license agreements. See the NOTICE file distributed with
184
- # this work for additional information regarding copyright ownership.
185
- # The ASF licenses this file to You under the Apache License, Version 2.0
186
- # (the "License"); you may not use this file except in compliance with
187
- # the License. You may obtain a copy of the License at
188
- #
189
- # http://www.apache.org/licenses/LICENSE-2.0
190
- #
191
- # Unless required by applicable law or agreed to in writing, software
192
- # distributed under the License is distributed on an "AS IS" BASIS,
193
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
194
- # See the License for the specific language governing permissions and
195
- # limitations under the License.
196
-
197
172
# Unspecified loggers and loggers with additivity=true output to server.log and stdout
198
173
# Note that INFO only applies to unspecified loggers, the log level of the child logger is used otherwise
199
174
log4j.rootLogger=INFO, stdout
0 commit comments