$K2_HOME/kafka/bin/zookeeper-server-start -daemon $K2_HOME/kafka/zookeeper.properties
$K2_HOME/kafka/bin/kafka-server-start -daemon $K2_HOME/kafka/server.properties
$K2_HOME/kafka/bin/zookeeper-shell <ZOOKEEPER IP>:2181 <<< "ls /brokers/ids"
$K2_HOME/kafka/bin/kafka-server-stop
$K2_HOME/kafka/bin/zookeeper-server-stop
$K2_HOME/kafka/bin/kafka-topics --zookeeper <ZOOKEEPER IP>:2181 –list
$K2_HOME/kafka/bin/kafka-topics --create --replication-factor <n> --partitions <k> --topic <topicName> --zookeeper <ZOOKEEPER IP>:2181
$K2_HOME/kafka/bin/kafka-console-consumer --topic <topicName> --bootstrap-server <server ip>:9093
$K2_HOME/kafka/bin/kafka-topics --delete --topic <topicName> --zookeeper <zookeeper ip>:2181
$K2_HOME/kafka/bin/kafka-console-consumer --whitelist ‘^(IDFINDER).*’ --bootstrap-server <server ip>:9093
$K2_HOME/kafka/bin/kafka-console-consumer --topic <topicName> --bootstrap-server <server ip>:9093 --from-beginning
$K2_HOME/kafka/bin/kafka-consumer-groups --group <groupID> -- describe --bootstrap-server <server ip>:9093
$K2_HOME/kafka/bin/kafka-consumer-groups --bootstrap-server <server ip>:9093 –list
$K2_HOME/kafka/bin/kafka-run-class kafka.tools.GetOffsetShell --broker-list <server ip>:9098 --topic <TOPIC> --time -1 --offsets
Note that when running Kafka on a Windows server, make the following adjustments on the above commands:
Run the .bat scripts from the cmd window.
Examples:
To start Kafka on a Windows server, do the following:
To start a Kafka consumer on a "test" topic, do the following:
The local Kafka installation runs on the default port (9092). Edit the above commands and replace port 9093 with port 9092.
Click for more information about local installation of Kafka and Zookeeper.
$K2_HOME/kafka/bin/zookeeper-server-start -daemon $K2_HOME/kafka/zookeeper.properties
$K2_HOME/kafka/bin/kafka-server-start -daemon $K2_HOME/kafka/server.properties
$K2_HOME/kafka/bin/zookeeper-shell <ZOOKEEPER IP>:2181 <<< "ls /brokers/ids"
$K2_HOME/kafka/bin/kafka-server-stop
$K2_HOME/kafka/bin/zookeeper-server-stop
$K2_HOME/kafka/bin/kafka-topics --zookeeper <ZOOKEEPER IP>:2181 –list
$K2_HOME/kafka/bin/kafka-topics --create --replication-factor <n> --partitions <k> --topic <topicName> --zookeeper <ZOOKEEPER IP>:2181
$K2_HOME/kafka/bin/kafka-console-consumer --topic <topicName> --bootstrap-server <server ip>:9093
$K2_HOME/kafka/bin/kafka-topics --delete --topic <topicName> --zookeeper <zookeeper ip>:2181
$K2_HOME/kafka/bin/kafka-console-consumer --whitelist ‘^(IDFINDER).*’ --bootstrap-server <server ip>:9093
$K2_HOME/kafka/bin/kafka-console-consumer --topic <topicName> --bootstrap-server <server ip>:9093 --from-beginning
$K2_HOME/kafka/bin/kafka-consumer-groups --group <groupID> -- describe --bootstrap-server <server ip>:9093
$K2_HOME/kafka/bin/kafka-consumer-groups --bootstrap-server <server ip>:9093 –list
$K2_HOME/kafka/bin/kafka-run-class kafka.tools.GetOffsetShell --broker-list <server ip>:9098 --topic <TOPIC> --time -1 --offsets
Note that when running Kafka on a Windows server, make the following adjustments on the above commands:
Run the .bat scripts from the cmd window.
Examples:
To start Kafka on a Windows server, do the following:
To start a Kafka consumer on a "test" topic, do the following:
The local Kafka installation runs on the default port (9092). Edit the above commands and replace port 9093 with port 9092.
Click for more information about local installation of Kafka and Zookeeper.