Last active
August 12, 2017 10:26
-
-
Save gnh1201/e17108c267ffbbad57470e7918768109 to your computer and use it in GitHub Desktop.
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 | |
# | |
# Install script for Kafka 0.11.0.0 (Released June 28, 2017) | |
# writer: 2017 Go Namhyeon <[email protected]> | |
# | |
help() | |
{ | |
echo "This script installs Kafka 0.11.0.0 (Released June 28, 2017)" | |
echo "2017 Go Namhyeon <[email protected]>" | |
} | |
install_java() | |
{ | |
echo "Installing Java 8..." | |
add-apt-repository -y ppa:webupd8team/java | |
apt-get -y update | |
apt-get -y install oracle-java8-installer | |
} | |
install_kafka() { | |
echo "Installing Kafka..." | |
cd /usr/ | |
wget "http://www-us.apache.org/dist/kafka/0.11.0.0/kafka_2.11-0.11.0.0.tgz" | |
tar -xvf "kafka_2.11-0.11.0.0.tgz" | |
ln -s /usr/kafka_2.11-0.11.0.0 /usr/kafka | |
} | |
run_zk() { | |
echo "Trying run Zookeeper, Please wait..." | |
cd /usr/kafka | |
bin/zookeeper-server-start.sh config/zookeeper.properties & | |
echo 'Zookeeper is launched.' | |
} | |
run_broker() { | |
echo "Trying run Kafka broker, Please wait..." | |
cd /usr/kafka | |
bin/kafka-server-start.sh config/server.properties & | |
echo 'Kafka broker is launched.' | |
} | |
install_java | |
install_kafka | |
run_zk | |
run_broker |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment