kafka-0.9

1)yum install java

2)curl -L -O http://mirrors.cnnic.cn/apache/kafka/0.9.0.0/kafka_2.10-0.9.0.0.tgz 

3)tar zxvf kafka_2.10-0.9.0.0.tgz 

4) 启动

bin/kafka-server-start.sh config/server.properties &

5)创建topic

bin/kafka-topics.sh --create --topic test --partitions 1 --replication-factor 1 --zookeeper 10.97.6.196:2181

5)查看topic创建情况

bin/kafka-topics.sh --list --zookeeper 10.97.6.196:2181

Topic:test    PartitionCount:1    ReplicationFactor:1    Configs:
    Topic: test    Partition: 0    Leader: 0    Replicas: 0    Isr: 0
Topic:topic_1    PartitionCount:3    ReplicationFactor:2    Configs:
    Topic: topic_1    Partition: 0    Leader: 1    Replicas: 1,0    Isr: 1,0
    Topic: topic_1    Partition: 1    Leader: 2    Replicas: 2,1    Isr: 2,1
    Topic: topic_1    Partition: 2    Leader: 0    Replicas: 0,2    Isr: 0,2

0.8 bin/kafka-topics.sh --describe --zookeeper 10.97.6.196:2181  --topic test0

http://www.cnblogs.com/liuming1992/p/6423458.html

 

6)发布

bin/kafka-console-producer.sh --topic topic_1 --broker-list 10.97.6.196:9092,10.99.1.135:9094

7)接收

bin/kafka-console-consumer.sh --topic topic_1 --zookeeper 10.97.6.196:2181 --from-beginning

二 安装zookeeper

http://www.linuxidc.com/Linux/2016-09/135052.htm

1) wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.9/zookeeper-3.4.9.tar.gz

2) tar -zxvf zookeeper-3.4.9.tar.gz && cd zookeeper-3.4.9/conf/

3) cp zoo_sample.cfg zoo.cfg

4)vim /etc/profile

# idea - zookeeper-3.4.9 config start - 2016-09-08
export ZOOKEEPER_HOME=/usr/local/zookeeper-3.4.9/
export PATH=$ZOOKEEPER_HOME/bin:$PATH
export PATH

5)启动 zookeeper 服务:
    zkServer.sh start

 

 http://www.cnblogs.com/snifferhu/p/5102629.html

http://blog.csdn.net/maomao5987370/article/details/51384694

posted @ 2017-08-25 16:02  taek  阅读(223)  评论(0编辑  收藏  举报