Skip to content

Commit 65e8aec

Browse files
committed
Alarm examples: Replace deprecated --zookeeper option ...
with --bootstrap-server. Note that port number also needs to change from 2181 to 9092, otherwise zookeeper gives strange messages ``` WARN Exception causing close of session 0x0: Unreasonable length = 308375649 (org.apache.zookeeper.server.NIOServerCnxn) ``` and clients will hang #2279
1 parent c3692db commit 65e8aec

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

app/alarm/examples/create_alarm_topics.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ config=$1
1111
# Create the compacted topics.
1212
for topic in "$1"
1313
do
14-
kafka/bin/kafka-topics.sh --zookeeper localhost:2181 --create --replication-factor 1 --partitions 1 --topic $topic
15-
kafka/bin/kafka-configs.sh --zookeeper localhost:2181 --entity-type topics --alter --entity-name $topic \
14+
kafka/bin/kafka-topics.sh --bootstrap-server localhost:9092 --create --replication-factor 1 --partitions 1 --topic $topic
15+
kafka/bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type topics --alter --entity-name $topic \
1616
--add-config cleanup.policy=compact,segment.ms=10000,min.cleanable.dirty.ratio=0.01,min.compaction.lag.ms=1000
1717
done
1818

1919
# Create the deleted topics
2020
for topic in "${1}Command" "${1}Talk"
2121
do
22-
kafka/bin/kafka-topics.sh --zookeeper localhost:2181 --create --replication-factor 1 --partitions 1 --topic $topic
23-
kafka/bin/kafka-configs.sh --zookeeper localhost:2181 --entity-type topics --alter --entity-name $topic \
22+
kafka/bin/kafka-topics.sh --bootstrap-server localhost:9092 --create --replication-factor 1 --partitions 1 --topic $topic
23+
kafka/bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type topics --alter --entity-name $topic \
2424
--add-config cleanup.policy=delete,segment.ms=10000,min.cleanable.dirty.ratio=0.01,min.compaction.lag.ms=1000,retention.ms=20000,delete.retention.ms=1000,file.delete.delay.ms=1000
2525
done

app/alarm/examples/delete_alarm_topics.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ fi
2222

2323
config=$1
2424

25+
# ...State was used earlier.
26+
# With recent setups, you might get a "... does not exist" error which can be ignored
2527
for topic in "$1" "${1}State" "${1}Command" "${1}Talk"
2628
do
27-
kafka/bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic $topic
29+
kafka/bin/kafka-topics.sh --bootstrap-server localhost:9092 --delete --topic $topic
2830
done
2931

app/alarm/examples/list_topics.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
kafka/bin/kafka-topics.sh --zookeeper localhost:2181 --describe
1+
kafka/bin/kafka-topics.sh --bootstrap-server localhost:9092 --describe

0 commit comments

Comments
 (0)