Skip to content

Suggest a mix of persistent and ephemeral data to improve reliability across zones #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions zookeeper/10zookeeper-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ data:
clientPort=2181
initLimit=5
syncLimit=2
server.1=zoo-0.zoo:2888:3888:participant
server.2=zoo-1.zoo:2888:3888:participant
server.3=zoo-2.zoo:2888:3888:participant
server.4=zoo-3.zoo:2888:3888:participant
server.5=zoo-4.zoo:2888:3888:participant
server.1=pzoo-0.pzoo:2888:3888:participant
server.2=pzoo-1.pzoo:2888:3888:participant
server.3=pzoo-2.pzoo:2888:3888:participant
server.4=zoo-0.zoo:2888:3888:participant
server.5=zoo-1.zoo:2888:3888:participant

log4j.properties: |-
log4j.rootLogger=INFO, stdout
Expand Down
15 changes: 15 additions & 0 deletions zookeeper/20pzoo-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: pzoo
namespace: kafka
spec:
ports:
- port: 2888
name: peer
- port: 3888
name: leader-election
clusterIP: None
selector:
app: zookeeper
storage: persistent
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ spec:
clusterIP: None
selector:
app: zookeeper
storage: ephemeral
7 changes: 4 additions & 3 deletions zookeeper/50zoo.yml → zookeeper/50pzoo.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: zoo
name: pzoo
namespace: kafka
spec:
serviceName: "zoo"
replicas: 5
serviceName: "pzoo"
replicas: 3
template:
metadata:
labels:
app: zookeeper
storage: persistent
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "5556"
Expand Down
62 changes: 62 additions & 0 deletions zookeeper/51zoo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: zoo
namespace: kafka
spec:
serviceName: "zoo"
replicas: 2
template:
metadata:
labels:
app: zookeeper
storage: ephemeral
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "5556"
spec:
terminationGracePeriodSeconds: 10
containers:
- name: metrics
image: solsson/kafka-prometheus-jmx-exporter@sha256:1f7c96c287a2dbec1d909cd8f96c0656310239b55a9a90d7fd12c81f384f1f7d
command:
- "java"
- "-jar"
- "jmx_prometheus_httpserver.jar"
- "5556"
- example_configs/zookeeper.yaml
ports:
- containerPort: 5556
- name: zookeeper
image: solsson/kafka:0.11.0.0-rc2@sha256:c1316e0131f4ec83bc645ca2141e4fda94e0d28f4fb5f836e15e37a5e054bdf1
env:
- name: JMX_PORT
value: "5555"
command:
- sh
- -c
- >
set -e;
export ZOOKEEPER_SERVER_ID=$((${HOSTNAME##*-} + 4));
echo "${ZOOKEEPER_SERVER_ID:-1}" | tee /var/lib/zookeeper/data/myid;
sed -i "s/server\.$ZOOKEEPER_SERVER_ID\=[a-z0-9.-]*/server.$ZOOKEEPER_SERVER_ID=0.0.0.0/" config/zookeeper.properties;
cat config/zookeeper.properties;
./bin/zookeeper-server-start.sh config/zookeeper.properties
ports:
- containerPort: 2181
name: client
- containerPort: 2888
name: peer
- containerPort: 3888
name: leader-election
volumeMounts:
- name: config
mountPath: /usr/local/kafka/config
- name: data
mountPath: /var/lib/zookeeper/data
volumes:
- name: config
configMap:
name: zookeeper-config
- name: data
emptyDir: {}