Skip to content

Commit 010582c

Browse files
author
Aleksandar Osenov
committed
Removing zookeeper config
1 parent 9374b05 commit 010582c

File tree

7 files changed

+10
-35
lines changed

7 files changed

+10
-35
lines changed

devicehive-backend/src/main/resources/application.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ devicehive.cache.commands.ttl.seconds=120
3030
logging.level.com.devicehive=info
3131

3232
bootstrap.servers=127.0.0.1:9092
33-
zookeeper.connect=127.0.0.1:2181
3433
num.partitions=3
3534
replication.factor=1
3635

devicehive-frontend/src/main/resources/application.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ app.executor.size=20
4444

4545
# Kafka properties
4646
bootstrap.servers=127.0.0.1:9092
47-
zookeeper.connect=127.0.0.1:2181
4847
num.partitions=3
4948
replication.factor=1
5049
response.topic.perfix=response_topic_

devicehive-shim-kafka-impl/src/main/resources/kafka.properties

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,3 @@ max.block.ms=60000
3737
buffer.memory=33554432
3838
retention.ms=120000
3939
linger.ms=0
40-
41-
zookeeper.sessionTimeout=10000
42-
zookeeper.connectionTimeout=8000

dockerfiles/devicehive-auth/devicehive-start.sh

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,10 @@ fi
3333

3434
if [ "$SPRING_PROFILES_ACTIVE" = "rpc-client" ]
3535
then
36-
if [ -z "$DH_ZK_ADDRESS" ] \
37-
|| ( [ -z "$DH_KAFKA_BOOTSTRAP_SERVERS" ] && [ -z "$DH_KAFKA_ADDRESS" ] )
36+
if [ -z "$DH_KAFKA_BOOTSTRAP_SERVERS" ] && [ -z "$DH_KAFKA_ADDRESS" ]
3837
then
3938
echo "Some of required environment variables are not set or empty."
4039
echo "Please check following vars are passed to container:"
41-
echo "- DH_ZK_ADDRESS"
4240
echo "And one of variants of Kafka bootstrap parameters:"
4341
echo "- DH_KAFKA_BOOTSTRAP_SERVERS for multiple servers"
4442
echo "or"
@@ -52,31 +50,28 @@ then
5250
fi
5351
fi
5452

55-
# Check if Zookeper, Kafka and Postgres are ready
53+
# Check Kafka and Postgres are ready
5654
while true; do
5755
if [ "$SPRING_PROFILES_ACTIVE" = "rpc-client" ]
5856
then
59-
nc -v -z -w1 "$DH_ZK_ADDRESS" "${DH_ZK_PORT:=2181}"
60-
result_zk=$?
6157
FIRST_KAFKA_SERVER="${DH_KAFKA_BOOTSTRAP_SERVERS%%,*}"
6258
nc -v -z -w1 "${FIRST_KAFKA_SERVER%%:*}" $(expr $FIRST_KAFKA_SERVER : '.*:\([0-9]*\)')
6359
result_kafka=$?
6460
else
65-
result_zk=0
6661
result_kafka=0
6762
fi
6863
nc -v -z -w1 "$DH_POSTGRES_ADDRESS" "${DH_POSTGRES_PORT:=5432}"
6964
result_postgres=$?
7065

71-
if [ "$result_kafka" -eq 0 ] && [ "$result_postgres" -eq 0 ] && [ "$result_zk" -eq 0 ]; then
66+
if [ "$result_kafka" -eq 0 ] && [ "$result_postgres" -eq 0 ]; then
7267
break
7368
fi
7469
sleep 3
7570
done
7671
KAFKA_PARAMETERS=""
7772
if [ "$SPRING_PROFILES_ACTIVE" = "rpc-client" ]
7873
then
79-
KAFKA_PARAMETERS="-Dbootstrap.servers=${DH_KAFKA_BOOTSTRAP_SERVERS} -Dzookeeper.connect=${DH_ZK_ADDRESS}:${DH_ZK_PORT:-2181} -Dzookeeper.connectionTimeout=${DH_ZK_CONNECTIONTIMEOUT:-8000} -Dzookeeper.sessionTimeout=${DH_ZK_SESSIONTIMEOUT:-10000}"
74+
KAFKA_PARAMETERS="-Dbootstrap.servers=${DH_KAFKA_BOOTSTRAP_SERVERS}"
8075
fi
8176

8277
echo "Starting DeviceHive auth"

dockerfiles/devicehive-backend/devicehive-start.sh

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ if [ -z "$DH_POSTGRES_ADDRESS" ] \
1717
|| [ -z "$DH_POSTGRES_DB" ] \
1818
|| [ -z "$REDIS_MASTER_HOST" ] \
1919
|| [ -z "$REDIS_MASTER_PORT" ] \
20-
|| [ -z "$DH_ZK_ADDRESS" ] \
2120
|| ( [ -z "$DH_KAFKA_BOOTSTRAP_SERVERS" ] && [ -z "$DH_KAFKA_ADDRESS" ] )
2221
then
2322
echo "Some of required environment variables are not set or empty."
@@ -28,7 +27,6 @@ then
2827
echo "- DH_POSTGRES_DB"
2928
echo "- REDIS_MASTER_HOST"
3029
echo "- REDIS_MASTER_PORT"
31-
echo "- DH_ZK_ADDRESS"
3230
echo "And one of variants of Kafka bootstrap parameters:"
3331
echo "- DH_KAFKA_BOOTSTRAP_SERVERS for multiple servers"
3432
echo "or"
@@ -41,17 +39,15 @@ then
4139
DH_KAFKA_BOOTSTRAP_SERVERS="${DH_KAFKA_ADDRESS}:${DH_KAFKA_PORT:-9092}"
4240
fi
4341

44-
# Check if Zookeper, Kafka and Postgres are ready
42+
# Check Kafka and Postgres are ready
4543
while true; do
46-
nc -v -z -w1 "$DH_ZK_ADDRESS" "${DH_ZK_PORT:=2181}"
47-
result_zk=$?
4844
FIRST_KAFKA_SERVER="${DH_KAFKA_BOOTSTRAP_SERVERS%%,*}"
4945
nc -v -z -w1 "${FIRST_KAFKA_SERVER%%:*}" $(expr $FIRST_KAFKA_SERVER : '.*:\([0-9]*\)')
5046
result_kafka=$?
5147
nc -v -z -w1 "$DH_POSTGRES_ADDRESS" "${DH_POSTGRES_PORT:=5432}"
5248
result_postgres=$?
5349

54-
if [ "$result_kafka" -eq 0 ] && [ "$result_postgres" -eq 0 ] && [ "$result_zk" -eq 0 ]; then
50+
if [ "$result_kafka" -eq 0 ] && [ "$result_postgres" -eq 0 ]; then
5551
break
5652
fi
5753
sleep 3
@@ -76,9 +72,6 @@ java -server -Xms1g -Xmx2g -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:+DisableExpl
7672
-Dspring.datasource.url="jdbc:postgresql://${DH_POSTGRES_ADDRESS}:${DH_POSTGRES_PORT}/${DH_POSTGRES_DB}" \
7773
-Dspring.datasource.username="${DH_POSTGRES_USERNAME}" \
7874
-Dspring.datasource.password="${DH_POSTGRES_PASSWORD}" \
79-
-Dzookeeper.connect="${DH_ZK_ADDRESS}:${DH_ZK_PORT}" \
80-
-Dzookeeper.connectionTimeout="${DH_ZK_CONNECTIONTIMEOUT:-8000}" \
81-
-Dzookeeper.sessionTimeout="${DH_ZK_SESSIONTIMEOUT:-10000}" \
8275
"./devicehive-backend-${DH_VERSION}-boot.jar" &
8376
PID=$!
8477
wait $PID

dockerfiles/devicehive-frontend/devicehive-start.sh

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ if [ -z "$DH_POSTGRES_ADDRESS" ] \
1515
|| [ -z "$DH_POSTGRES_USERNAME" ] \
1616
|| [ -z "$DH_POSTGRES_PASSWORD" ] \
1717
|| [ -z "$DH_POSTGRES_DB" ] \
18-
|| [ -z "$DH_ZK_ADDRESS" ] \
1918
|| [ -z "$DH_BACKEND_ADDRESS" ] \
2019
|| [ -z "$DH_BACKEND_PORT" ] \
2120
|| [ -z "$REDIS_MASTER_HOST" ] \
@@ -30,7 +29,6 @@ then
3029
echo "- DH_POSTGRES_USERNAME"
3130
echo "- DH_POSTGRES_PASSWORD"
3231
echo "- DH_POSTGRES_DB"
33-
echo "- DH_ZK_ADDRESS"
3432
echo "- DH_BACKEND_ADDRESS"
3533
echo "- DH_BACKEND_PORT"
3634
echo "- REDIS_MASTER_HOST"
@@ -49,18 +47,16 @@ then
4947
DH_KAFKA_BOOTSTRAP_SERVERS="${DH_KAFKA_ADDRESS}:${DH_KAFKA_PORT:-9092}"
5048
fi
5149

52-
# Check if Zookeper, Kafka, Backend and Postgres are ready
50+
# Check if Kafka, Backend and Postgres are ready
5351
while true; do
54-
nc -v -z -w1 "$DH_ZK_ADDRESS" "${DH_ZK_PORT:=2181}"
55-
result_zk=$?
5652
FIRST_KAFKA_SERVER="${DH_KAFKA_BOOTSTRAP_SERVERS%%,*}"
5753
nc -v -z -w1 "${FIRST_KAFKA_SERVER%%:*}" $(expr $FIRST_KAFKA_SERVER : '.*:\([0-9]*\)')
5854
result_kafka=$?
5955
nc -v -z -w1 "$DH_POSTGRES_ADDRESS" "${DH_POSTGRES_PORT:=5432}"
6056
result_postgres=$?
6157
nc -v -z -w1 "$DH_BACKEND_ADDRESS" "${DH_BACKEND_PORT:=8000}"
6258
result_backend=$?
63-
if [ "$result_kafka" -eq 0 ] && [ "$result_postgres" -eq 0 ] && [ "$result_zk" -eq 0 ] && [ "$result_backend" -eq 0 ]; then
59+
if [ "$result_kafka" -eq 0 ] && [ "$result_postgres" -eq 0 ] && [ "$result_backend" -eq 0 ]; then
6460
break
6561
fi
6662
sleep 3
@@ -87,9 +83,6 @@ java -server -Xms1g -Xmx2g -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:+DisableExpl
8783
-Dspring.datasource.url="jdbc:postgresql://${DH_POSTGRES_ADDRESS}:${DH_POSTGRES_PORT:-5432}/${DH_POSTGRES_DB}" \
8884
-Dspring.datasource.username="${DH_POSTGRES_USERNAME}" \
8985
-Dspring.datasource.password="${DH_POSTGRES_PASSWORD}" \
90-
-Dzookeeper.connect="${DH_ZK_ADDRESS}:${DH_ZK_PORT:-2181}" \
91-
-Dzookeeper.connectionTimeout="${DH_ZK_CONNECTIONTIMEOUT:-8000}" \
92-
-Dzookeeper.sessionTimeout="${DH_ZK_SESSIONTIMEOUT:-10000}" \
9386
"./devicehive-frontend-${DH_VERSION}-boot.jar" &
9487
PID=$!
9588
wait "$PID"

dockerfiles/devicehive-kafka.Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM docker.io/bitnami/kafka:3.1
1+
FROM docker.io/bitnami/kafka:3.5.1
22

33
MAINTAINER devicehive
44

5-
ENV DH_VERSION="4.1.0"
5+
ENV DH_VERSION="5.0.1"
66

77
LABEL org.label-schema.url="https://devicehive.com" \
88
org.label-schema.vendor="DeviceHive" \
@@ -14,7 +14,6 @@ ENV KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CLIENT:PLAINTEXT,EXTERNAL:PLAINTEXT
1414
ENV KAFKA_CFG_LISTENERS=CLIENT://:9092
1515
ENV KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://kafka:9092
1616
ENV KAFKA_CFG_INTER_BROKER_LISTENER_NAME=CLIENT
17-
ENV KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
1817
ENV ALLOW_PLAINTEXT_LISTENER=yes
1918

2019
USER root

0 commit comments

Comments
 (0)