Skip to content

Commit

Permalink
Merge pull request #2280 from ControlSystemStudio/zookeeper_2279
Browse files Browse the repository at this point in the history
Alarm examples: Replace deprecated --zookeeper option ...
  • Loading branch information
kasemir authored May 27, 2022
2 parents 3242bde + 65e8aec commit 2a9a07a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions app/alarm/examples/create_alarm_topics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ config=$1
# Create the compacted topics.
for topic in "$1"
do
kafka/bin/kafka-topics.sh --zookeeper localhost:2181 --create --replication-factor 1 --partitions 1 --topic $topic
kafka/bin/kafka-configs.sh --zookeeper localhost:2181 --entity-type topics --alter --entity-name $topic \
kafka/bin/kafka-topics.sh --bootstrap-server localhost:9092 --create --replication-factor 1 --partitions 1 --topic $topic
kafka/bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type topics --alter --entity-name $topic \
--add-config cleanup.policy=compact,segment.ms=10000,min.cleanable.dirty.ratio=0.01,min.compaction.lag.ms=1000
done

# Create the deleted topics
for topic in "${1}Command" "${1}Talk"
do
kafka/bin/kafka-topics.sh --zookeeper localhost:2181 --create --replication-factor 1 --partitions 1 --topic $topic
kafka/bin/kafka-configs.sh --zookeeper localhost:2181 --entity-type topics --alter --entity-name $topic \
kafka/bin/kafka-topics.sh --bootstrap-server localhost:9092 --create --replication-factor 1 --partitions 1 --topic $topic
kafka/bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type topics --alter --entity-name $topic \
--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
done
4 changes: 3 additions & 1 deletion app/alarm/examples/delete_alarm_topics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ fi

config=$1

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

2 changes: 1 addition & 1 deletion app/alarm/examples/list_topics.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
kafka/bin/kafka-topics.sh --zookeeper localhost:2181 --describe
kafka/bin/kafka-topics.sh --bootstrap-server localhost:9092 --describe

0 comments on commit 2a9a07a

Please sign in to comment.