Skip to content

Commit 0ce7b00

Browse files
Migrate to zookeeper-less kafka (#3263)
* migrate to kraft * fix syntax error * move zookeeper volume removal to end of installation
1 parent 9b815ac commit 0ce7b00

File tree

4 files changed

+17
-32
lines changed

4 files changed

+17
-32
lines changed

_unit-test/create-docker-volumes-test.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ sentry-data
1414
sentry-kafka
1515
sentry-postgres
1616
sentry-redis
17-
sentry-symbolicator
18-
sentry-zookeeper"
17+
sentry-symbolicator"
1918

2019
before=$(get_volumes)
2120

docker-compose.yml

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -132,42 +132,27 @@ services:
132132
POSTGRES_HOST_AUTH_METHOD: "trust"
133133
volumes:
134134
- "sentry-postgres:/var/lib/postgresql/data"
135-
zookeeper:
136-
<<: *restart_policy
137-
image: "confluentinc/cp-zookeeper:7.6.1"
138-
environment:
139-
ZOOKEEPER_CLIENT_PORT: "2181"
140-
CONFLUENT_SUPPORT_METRICS_ENABLE: "false"
141-
ZOOKEEPER_LOG4J_ROOT_LOGLEVEL: "WARN"
142-
ZOOKEEPER_TOOLS_LOG4J_LOGLEVEL: "WARN"
143-
KAFKA_OPTS: "-Dzookeeper.4lw.commands.whitelist=ruok"
144-
ulimits:
145-
nofile:
146-
soft: 4096
147-
hard: 4096
148-
volumes:
149-
- "sentry-zookeeper:/var/lib/zookeeper/data"
150-
- "sentry-zookeeper-log:/var/lib/zookeeper/log"
151-
- "sentry-secrets:/etc/zookeeper/secrets"
152-
healthcheck:
153-
<<: *healthcheck_defaults
154-
test: ["CMD-SHELL", 'echo "ruok" | nc -w 2 localhost 2181 | grep imok']
155135
kafka:
156136
<<: *restart_policy
157-
depends_on:
158-
zookeeper:
159-
<<: *depends_on-healthy
160137
image: "confluentinc/cp-kafka:7.6.1"
161138
environment:
162-
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
163-
KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://kafka:9092"
139+
# https://docs.confluent.io/platform/current/installation/docker/config-reference.html#cp-kakfa-example
140+
KAFKA_PROCESS_ROLES: "broker,controller"
141+
KAFKA_CONTROLLER_QUORUM_VOTERS: "[email protected]:29093"
142+
KAFKA_CONTROLLER_LISTENER_NAMES: "CONTROLLER"
143+
KAFKA_NODE_ID: "1001"
144+
CLUSTER_ID: "MkU3OEVBNTcwNTJENDM2Qk"
145+
KAFKA_LISTENERS: "PLAINTEXT://0.0.0.0:29092,INTERNAL://0.0.0.0:9093,EXTERNAL://0.0.0.0:9092,CONTROLLER://0.0.0.0:29093"
146+
KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://127.0.0.1:29092,INTERNAL://kafka:9093,EXTERNAL://kafka:9092"
147+
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "PLAINTEXT:PLAINTEXT,INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,CONTROLLER:PLAINTEXT"
148+
KAFKA_INTER_BROKER_LISTENER_NAME: "PLAINTEXT"
164149
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: "1"
165150
KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS: "1"
166151
KAFKA_LOG_RETENTION_HOURS: "24"
167152
KAFKA_MESSAGE_MAX_BYTES: "50000000" #50MB or bust
168153
KAFKA_MAX_REQUEST_SIZE: "50000000" #50MB on requests apparently too
169154
CONFLUENT_SUPPORT_METRICS_ENABLE: "false"
170-
KAFKA_LOG4J_LOGGERS: "kafka.cluster=WARN,kafka.controller=WARN,kafka.coordinator=WARN,kafka.log=WARN,kafka.server=WARN,kafka.zookeeper=WARN,state.change.logger=WARN"
155+
KAFKA_LOG4J_LOGGERS: "kafka.cluster=WARN,kafka.controller=WARN,kafka.coordinator=WARN,kafka.log=WARN,kafka.server=WARN,state.change.logger=WARN"
171156
KAFKA_LOG4J_ROOT_LOGLEVEL: "WARN"
172157
KAFKA_TOOLS_LOG4J_LOGLEVEL: "WARN"
173158
ulimits:
@@ -538,8 +523,6 @@ volumes:
538523
external: true
539524
sentry-redis:
540525
external: true
541-
sentry-zookeeper:
542-
external: true
543526
sentry-kafka:
544527
external: true
545528
sentry-clickhouse:
@@ -555,7 +538,6 @@ volumes:
555538
sentry-secrets:
556539
sentry-smtp:
557540
sentry-nginx-cache:
558-
sentry-zookeeper-log:
559541
sentry-kafka-log:
560542
sentry-smtp-log:
561543
sentry-clickhouse-log:

install/create-docker-volumes.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ echo "Created $(docker volume create --name=sentry-kafka)."
66
echo "Created $(docker volume create --name=sentry-postgres)."
77
echo "Created $(docker volume create --name=sentry-redis)."
88
echo "Created $(docker volume create --name=sentry-symbolicator)."
9-
echo "Created $(docker volume create --name=sentry-zookeeper)."
109

1110
echo "${_endgroup}"

install/wrap-up.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,8 @@ else
2828
echo "-----------------------------------------------------------------"
2929
echo ""
3030
fi
31+
32+
# TODO(getsentry/self-hosted#2489)
33+
if docker volume ls | grep -qw sentry-zookeeper; then
34+
docker volume rm sentry-zookeeper
35+
fi

0 commit comments

Comments
 (0)