Skip to content

Instantly share code, notes, and snippets.

@piatra
Last active May 24, 2024 17:04
Show Gist options
  • Save piatra/0d6f7ad1435fa7aa790a to your computer and use it in GitHub Desktop.
Save piatra/0d6f7ad1435fa7aa790a to your computer and use it in GitHub Desktop.
start zookeeper and kafka in the background and create a topic
#!/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
@douglasawh
Copy link

@khanhafizurrahman32 I know this is over two years later, but for anyone else with the issue...firewall could be blocking it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment