专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > Apache

【Apache Kafka】装配指南

发布时间:2010-06-14 17:27:22 文章来源:www.iduyao.cn 采编人员:星星草
【Apache Kafka】安装指南

在Ubuntu12.04 server上安装单结点kafka,我的机器上之前已经安装过zookeeper-3.4.5

根据官网的说明:http://kafka.apache.org/07/quickstart.html

下载一个kafka-0.7.2.tar.gz,解压安装

> tar xzf kafka-<VERSION>.tgz
> cd kafka-<VERSION>
> ./sbt update
> ./sbt package
这个过程中会自动安装Scala,需要花费点时间。

修改/config/server.properties文件,将里面的hostname修改为你主机的IP,还需要修改zk.connect为ZooKeeper的IP:2181。

然后重启kafka-server-start.sh

bin/kafka-server-start.sh config/server.properties
producer发送消息
bin/kafka-console-producer.sh --zookeeper localhost:2181 --topic test 
This is a test.
consumer获得消息
bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning
This is a test.

参考:http://my.oschina.net/ielts0909/blog/93190

http://kafka.apache.org/07/quickstart.html

友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: