-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontrol.sh
More file actions
executable file
·34 lines (31 loc) · 815 Bytes
/
control.sh
File metadata and controls
executable file
·34 lines (31 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
Sys="${1}"
Option="${2}"
echo "\n\t *** Control script *** \n"
case ${Sys} in
-z) echo "Zookeeper ${Option}"
./zookeeper/bin/zkServer.sh ${Option}
;;
-k) case ${Option} in
-B)
echo "Kafka starting..."
./kafka/bin/kafka-server-start.sh ./kafka/config/server.properties &
sleep 4
;;
-E)
echo "Kafka stopping..."
./kafka/bin/kafka-server-stop.sh ./kafka/config/server.properties &
sleep 4
;;
esac
;;
-p) echo "Producer running..."
./kafka/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic ${Option}
;;
-c) echo "Consumer running..."
./kafka/bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic ${Option}
;;
-l) echo "Topics :"
./kafka/bin/kafka-topics.sh --list --zookeeper localhost:2181
;;
esac