Skip to content

Commit a55b9c8

Browse files
authored
Merge pull request #10 from Yolean/kafka-image
Publish Kafka image geared towards persistent storage
2 parents 5a15651 + d09d784 commit a55b9c8

File tree

3 files changed

+144
-7
lines changed

3 files changed

+144
-7
lines changed

50kafka.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ spec:
1717
spec:
1818
containers:
1919
- name: broker
20-
image: solsson/kafka:0.10.0.1
20+
image: solsson/kafka-persistent:0.10.1
2121
ports:
2222
- containerPort: 9092
2323
command:
@@ -27,12 +27,6 @@ spec:
2727
volumeMounts:
2828
- name: datadir
2929
mountPath: /opt/kafka/data
30-
# - name: conf
31-
# mountPath: /opt/kafka/config/server.properties
32-
#volumes:
33-
#- name: conf
34-
# configMap:
35-
# name: conf-d
3630
volumeClaimTemplates:
3731
- metadata:
3832
name: datadir

docker-kafka-persistent/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
FROM openjdk:8u102-jre
3+
4+
ENV kafka_version=0.10.1.0
5+
ENV scala_version=2.11.8
6+
ENV kafka_bin_version=2.11-$kafka_version
7+
8+
RUN curl -SLs "http://www.scala-lang.org/files/archive/scala-$scala_version.deb" -o scala.deb \
9+
&& dpkg -i scala.deb \
10+
&& rm scala.deb \
11+
&& curl -SLs "http://www.apache.org/dist/kafka/$kafka_version/kafka_$kafka_bin_version.tgz" | tar -xzf - -C /opt \
12+
&& mv /opt/kafka_$kafka_bin_version /opt/kafka
13+
14+
WORKDIR /opt/kafka
15+
ENTRYPOINT ["bin/kafka-server-start.sh"]
16+
17+
ADD config/server.properties config/
18+
19+
CMD ["config/server.properties"]
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
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+
16+
# see kafka.server.KafkaConfig for additional details and defaults
17+
18+
############################# Server Basics #############################
19+
20+
# The id of the broker. This must be set to a unique integer for each broker.
21+
broker.id=0
22+
23+
# Use https://github.com/Yolean/kafka-topic-client instead
24+
auto.create.topics.enable=false
25+
26+
# Switch to enable topic deletion or not, default value is false
27+
delete.topic.enable=false
28+
29+
############################# Socket Server Settings #############################
30+
31+
# The address the socket server listens on. It will get the value returned from
32+
# java.net.InetAddress.getCanonicalHostName() if not configured.
33+
# FORMAT:
34+
# listeners = security_protocol://host_name:port
35+
# EXAMPLE:
36+
# listeners = PLAINTEXT://your.host.name:9092
37+
#listeners=PLAINTEXT://:9092
38+
39+
# Hostname and port the broker will advertise to producers and consumers. If not set,
40+
# it uses the value for "listeners" if configured. Otherwise, it will use the value
41+
# returned from java.net.InetAddress.getCanonicalHostName().
42+
#advertised.listeners=PLAINTEXT://your.host.name:9092
43+
44+
# The number of threads handling network requests
45+
num.network.threads=3
46+
47+
# The number of threads doing disk I/O
48+
num.io.threads=8
49+
50+
# The send buffer (SO_SNDBUF) used by the socket server
51+
socket.send.buffer.bytes=102400
52+
53+
# The receive buffer (SO_RCVBUF) used by the socket server
54+
socket.receive.buffer.bytes=102400
55+
56+
# The maximum size of a request that the socket server will accept (protection against OOM)
57+
socket.request.max.bytes=104857600
58+
59+
60+
############################# Log Basics #############################
61+
62+
# A comma seperated list of directories under which to store log files
63+
log.dirs=/tmp/kafka-logs
64+
65+
# The default number of log partitions per topic. More partitions allow greater
66+
# parallelism for consumption, but this will also result in more files across
67+
# the brokers.
68+
num.partitions=1
69+
70+
# The number of threads per data directory to be used for log recovery at startup and flushing at shutdown.
71+
# This value is recommended to be increased for installations with data dirs located in RAID array.
72+
num.recovery.threads.per.data.dir=1
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=-1
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=1073741824
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=1073741824
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=300000
111+
112+
############################# Zookeeper #############################
113+
114+
# Zookeeper connection string (see zookeeper docs for details).
115+
# This is a comma separated host:port pairs, each corresponding to a zk
116+
# server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002".
117+
# You can also append an optional chroot string to the urls to specify the
118+
# root directory for all kafka znodes.
119+
zookeeper.connect=zookeeper:2181
120+
121+
# Timeout in ms for connecting to zookeeper
122+
zookeeper.connection.timeout.ms=6000
123+
124+

0 commit comments

Comments
 (0)