kafka安装
kafka分布式消息发布订阅系统
① 易于扩展;
② 发布/订阅高吞吐量;
③ 可持久化;
1. 下载kafka
wget http://apache.fayea.com/kafka/0.8.2.0/kafka_2.10-0.8.2.0.tgz
2. 安装
tar zxvf kafka_2.10-0.8.2.0.tgz
3. 修改zookeeper配置:
/Users/hyy044101331/java_tools/kafka_2.10-0.8.2.0/config
vi server.properties
zookeeper.connect=localhost:2181 zookeeper.connection.timeout.ms=6000
4. 启动zoookeeper
cd /Users/hyy044101331/java_tools sh zk-jiqun-start.sh
5. 启动kafka
cd /Users/hyy044101331/java_tools/kafka_2.10-0.8.2.0/bin sh kafka-server-start.sh ../config/server.properties
6. 创建topic
mengka-2:kafka_2.10-0.8.2.0 hyy044101331$ pwd /Users/hyy044101331/java_tools/kafka_2.10-0.8.2.0 mengka-2:kafka_2.10-0.8.2.0 hyy044101331$ sh create_topic.sh mengka Created topic "mengka".
1 #!/bin/bash 2 3 ### 4 # create a topic 5 ### 6 7 sh /Users/hyy044101331/java_tools/kafka_2.10-0.8.2.0/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 -- topic $1
7. 查看topic列表
sh /Users/hyy044101331/java_tools/kafka_2.10-0.8.2.0/bin/kafka-topics.sh --list --zookeeper localhost:2181 mengka
8. 查看topic的详细信息
kafka-topics.sh --describe --zookeeper localhost:2181 --topic mengka
mengka-2:bin hyy044101331$ sh /Users/hyy044101331/java_tools/kafka_2.10-0.8.2.0/bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic mengka Topic:mengka PartitionCount:1 ReplicationFactor:1 Configs: Topic: mengka Partition: 0 Leader: 0 Replicas: 0 Isr: 0
9. 停止kafka
ps -ef|grep server.properties kill -9 9697
相关推荐
ljcsdn 2020-07-27
woaishanguosha 2020-07-18
qingyuerji 2020-06-14
MojitoBlogs 2020-06-14
MojitoBlogs 2020-06-09
猫咪的一生 2020-06-03
guicaizhou 2020-05-05
猫咪的一生 2020-05-03
jiangkai00 2020-04-15
方新德 2020-04-08
jiangkai00 2020-03-20
那年夏天0 2020-02-22
sweetgirl0 2020-02-21
sweetgirl0 2020-02-09
MrZhangAdd 2020-01-13
jiangkai00 2020-01-12
GoatSucker 2020-01-11
yangyutong00 2019-12-30