Skip to content

Commit a177142

Browse files
feat: upgrade to zookeeper-less kafka (#2445)
* upgrade to zookeeper-less kafka * clean up sentry-zookeeper volume if it exists --------- Co-authored-by: hubertdeng123 <[email protected]>
1 parent 79bebdd commit a177142

File tree

4 files changed

+17
-34
lines changed

4 files changed

+17
-34
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: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -156,43 +156,27 @@ services:
156156
read_only: true
157157
source: ./postgres/
158158
target: /opt/sentry/
159-
zookeeper:
160-
<<: *restart_policy
161-
image: "confluentinc/cp-zookeeper:5.5.7"
162-
environment:
163-
ZOOKEEPER_CLIENT_PORT: "2181"
164-
CONFLUENT_SUPPORT_METRICS_ENABLE: "false"
165-
ZOOKEEPER_LOG4J_ROOT_LOGLEVEL: "WARN"
166-
ZOOKEEPER_TOOLS_LOG4J_LOGLEVEL: "WARN"
167-
KAFKA_OPTS: "-Dzookeeper.4lw.commands.whitelist=ruok"
168-
ulimits:
169-
nofile:
170-
soft: 4096
171-
hard: 4096
172-
volumes:
173-
- "sentry-zookeeper:/var/lib/zookeeper/data"
174-
- "sentry-zookeeper-log:/var/lib/zookeeper/log"
175-
- "sentry-secrets:/etc/zookeeper/secrets"
176-
healthcheck:
177-
<<: *healthcheck_defaults
178-
test:
179-
["CMD-SHELL", 'echo "ruok" | nc -w 2 localhost 2181 | grep imok']
180159
kafka:
181160
<<: *restart_policy
182-
depends_on:
183-
zookeeper:
184-
<<: *depends_on-healthy
185-
image: "confluentinc/cp-kafka:5.5.7"
161+
image: "confluentinc/cp-kafka:7.5.0"
186162
environment:
187-
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
188-
KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://kafka:9092"
163+
# https://docs.confluent.io/platform/current/installation/docker/config-reference.html#cp-kakfa-example
164+
KAFKA_PROCESS_ROLES: "broker,controller"
165+
KAFKA_CONTROLLER_QUORUM_VOTERS: "[email protected]:29093"
166+
KAFKA_CONTROLLER_LISTENER_NAMES: "CONTROLLER"
167+
KAFKA_NODE_ID: "1"
168+
CLUSTER_ID: "MkU3OEVBNTcwNTJENDM2Qk"
169+
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"
170+
KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://127.0.0.1:29092,INTERNAL://kafka:9093,EXTERNAL://kafka:9092"
171+
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "PLAINTEXT:PLAINTEXT,INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,CONTROLLER:PLAINTEXT"
172+
KAFKA_INTER_BROKER_LISTENER_NAME: "PLAINTEXT"
189173
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: "1"
190174
KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS: "1"
191175
KAFKA_LOG_RETENTION_HOURS: "24"
192176
KAFKA_MESSAGE_MAX_BYTES: "50000000" #50MB or bust
193177
KAFKA_MAX_REQUEST_SIZE: "50000000" #50MB on requests apparently too
194178
CONFLUENT_SUPPORT_METRICS_ENABLE: "false"
195-
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"
179+
KAFKA_LOG4J_LOGGERS: "kafka.cluster=WARN,kafka.controller=WARN,kafka.coordinator=WARN,kafka.log=WARN,kafka.server=WARN,state.change.logger=WARN"
196180
KAFKA_LOG4J_ROOT_LOGLEVEL: "WARN"
197181
KAFKA_TOOLS_LOG4J_LOGLEVEL: "WARN"
198182
ulimits:
@@ -478,8 +462,6 @@ volumes:
478462
external: true
479463
sentry-redis:
480464
external: true
481-
sentry-zookeeper:
482-
external: true
483465
sentry-kafka:
484466
external: true
485467
sentry-clickhouse:
@@ -495,7 +477,6 @@ volumes:
495477
sentry-secrets:
496478
sentry-smtp:
497479
sentry-nginx-cache:
498-
sentry-zookeeper-log:
499480
sentry-kafka-log:
500481
sentry-smtp-log:
501482
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/turn-things-off.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ if [[ -n "$MINIMIZE_DOWNTIME" ]]; then
66
else
77
# Clean up old stuff and ensure nothing is working while we install/update
88
$dc down -t $STOP_TIMEOUT --rmi local --remove-orphans
9+
# TODO(getsentry/self-hosted#2489)
10+
if docker volume ls | grep -qw sentry-zookeeper; then
11+
docker volume rm sentry-zookeeper
12+
fi
913
fi
1014

1115
echo "${_endgroup}"

0 commit comments

Comments
 (0)