Skip to content

Instantly share code, notes, and snippets.

@tmusabbir
Last active July 8, 2016 06:21
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save tmusabbir/7147994 to your computer and use it in GitHub Desktop.
Save tmusabbir/7147994 to your computer and use it in GitHub Desktop.
Install Kafka in CentOS
Install Kafka in CentOS
[root@ip-10-0-0-101 download]# git clone https://git-wip-us.apache.org/repos/asf/kafka.git
Initialized empty Git repository in /root/download/kafka/.git/
remote: Counting objects: 14747, done.
remote: Compressing objects: 100% (6313/6313), done.
remote: Total 14747 (delta 9065), reused 10714 (delta 6622)
Receiving objects: 100% (14747/14747), 13.97 MiB | 1.51 MiB/s, done.
Resolving deltas: 100% (9065/9065), done.
[root@ip-10-0-0-101 download]# cd kafka/
[root@ip-10-0-0-101 kafka]# git checkout -b 0.8 remotes/origin/0.8
Branch 0.8 set up to track remote branch 0.8 from origin.
Switched to a new branch '0.8'
[root@ip-10-0-0-101 kafka]# ./sbt update
[root@ip-10-0-0-101 kafka]# ./sbt package
[root@ip-10-0-0-101 kafka]# ./sbt assembly-package-dependency
zookeeper.connect=10.0.0.102:2181,10.0.0.103:2181,10.0.0.104:2181
[root@ip-10-0-0-102 kafka]# bin/kafka-create-topic.sh --topic test --replica 3 --zookeeper 10.0.0.102:2181,10.0.0.103:2181,10.0.0.104:2181
creation succeeded!
[root@ip-10-0-0-102 kafka]# ls /var/kafka-logs/
replication-offset-checkpoint test-0
bin/kafka-console-consumer.sh --zookeeper 10.0.0.102:2181,10.0.0.103:2181,10.0.0.104:2181 --topic test --from-beginning
bin/kafka-console-producer.sh --broker-list 10.0.0.102:9092,10.0.0.103:9092,10.0.0.104:9092 --sync --topic test
############################# Producer Basics #############################
metadata.broker.list=10.0.0.102:9092,10.0.0.103:9092,10.0.0.104:9092
############################# Server Basics #############################
# The id of the broker. This must be set to a unique integer for each broker.
broker.id=0
############################# Socket Server Settings #############################
# The port the socket server listens on
port=9092
############################# Log Basics #############################
# A comma seperated list of directories under which to store log files
log.dirs=/var/kafka-logs
############################# Zookeeper #############################
zookeeper.connect=10.0.0.102:2181,10.0.0.103:2181,10.0.0.104:2181
pdsh -w 10.0.0.102,10.0.0.103,10.0.0.104 /etc/kafka/bin/kafka-server-start.sh /etc/kafka/config/server.properties
[info] Done packaging.
[success] Total time: 36 s, completed Oct 25, 2013 1:11:51 AM
@shett044
Copy link

I get this error when running ./sbt update
error: error while loading CharSequence, class file '/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-0.b14.el7_2.x86_64/jre/lib/rt.jar(java/lang/CharSequence.class)' is broken

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