Skip to content

Instantly share code, notes, and snippets.

@bjethwan
Created March 8, 2018 04:08
Show Gist options
  • Save bjethwan/3e1e9c26d58bc75fb78035b6f3fbcf75 to your computer and use it in GitHub Desktop.
Save bjethwan/3e1e9c26d58bc75fb78035b6f3fbcf75 to your computer and use it in GitHub Desktop.
Script for single node single broker apache kafka install
#!/bin/bash
sudo yum update -y
sudo yum install wget -y
sudo yum install java-1.8.0-openjdk-devel.x86_64 -y
mkdir mykafka
cd mykafka
mkdir kafka-config
mkdir kafka-log
wget http://www-us.apache.org/dist/kafka/1.0.0/kafka_2.12-1.0.0.tgz
tar -xzf kafka_2.12-1.0.0.tgz
cp kafka_2.12-1.0.0/config/server.properties kafka-config/server.properties
cp kafka_2.12-1.0.0/config/zookeeper.properties kafka-config/zookeeper.properties
sudo mv kafka_2.12-1.0.0 /opt
echo 'export PATH=/opt/kafka_2.12-1.0.0/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
sed -i 's|log.dirs=/tmp/kafka-logs|log.dirs=/home/ec2-user/mykafka/kafka-log|' kafka-config/server.properties
# nohup bin/zookeeper-server-start.sh config/zookeeper.properties &
# nohup bin/kafka-server-start.sh config/server.properties &
zookeeper-server-start.sh -daemon kafka-config/zookeeper.properties
kafka-server-start.sh -daemon kafka-config/server.properties
@bjethwan
Copy link
Author

bjethwan commented Mar 8, 2018

AWS -> Red Hat Enterprise Linux 7.4

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