Last active
May 24, 2024 17:04
-
-
Save piatra/0d6f7ad1435fa7aa790a to your computer and use it in GitHub Desktop.
start zookeeper and kafka in the background and create a topic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$#" -ne 1 ]; then | |
echo "Please supply topic name" | |
exit 1 | |
fi | |
nohup bin/zookeeper-server-start.sh -daemon config/zookeeper.properties > /dev/null 2>&1 & | |
sleep 2 | |
nohup bin/kafka-server-start.sh -daemon config/server.properties > /dev/null 2>&1 & | |
sleep 2 | |
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic $1 | |
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic parsed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@khanhafizurrahman32 I know this is over two years later, but for anyone else with the issue...firewall could be blocking it