Last active
July 8, 2016 06:21
-
-
Save tmusabbir/7147994 to your computer and use it in GitHub Desktop.
Install Kafka in CentOS
This file contains hidden or 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
Install Kafka in CentOS |
This file contains hidden or 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
[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 |
This file contains hidden or 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
zookeeper.connect=10.0.0.102:2181,10.0.0.103:2181,10.0.0.104:2181 | |
This file contains hidden or 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
[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 |
This file contains hidden or 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/kafka-console-consumer.sh --zookeeper 10.0.0.102:2181,10.0.0.103:2181,10.0.0.104:2181 --topic test --from-beginning |
This file contains hidden or 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/kafka-console-producer.sh --broker-list 10.0.0.102:9092,10.0.0.103:9092,10.0.0.104:9092 --sync --topic test |
This file contains hidden or 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
############################# Producer Basics ############################# | |
metadata.broker.list=10.0.0.102:9092,10.0.0.103:9092,10.0.0.104:9092 | |
This file contains hidden or 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
############################# 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 | |
This file contains hidden or 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
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 |
This file contains hidden or 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
[info] Done packaging. | |
[success] Total time: 36 s, completed Oct 25, 2013 1:11:51 AM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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