kafka 单节点快速运用
2016-07-21 09:53
197 查看
第一步下载 解压
tar -xzf kafka_2.11-0.10.0.0.tgzcd kafka_2.11-0.10.0.0
第二部启动kafka内部的zookeeper 和kafka
bin/zookeeper-server-start.sh config/zookeeper.properties &[2013-04-22 15:01:37,495] INFO Reading configuration from: config/zookeeper.properties (org.apache.zookeeper.server.quorum.QuorumPeerConfig) ...
启动kafaka
bin/kafka-server-start.sh config/server.properties &[2013-04-22 15:01:47,028] INFO Verifying properties (kafka.utils.VerifiableProperties) [2013-04-22 15:01:47,051] INFO Property socket.send.buffer.bytes is overridden to 1048576 (kafka.utils.VerifiableProperties) ...
第三步创建一个topic
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test这个topic的名字为test
查看topic
bin/kafka-topics.sh --list --zookeeper localhost:2181test
第四部使用生产者来生产一条消息
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic testThis is a message This is another message
第五步使用消费者来消费一条消息
bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginningThis is a message This is another message
说明 这里第五部跟第四步需要开启独立的控制台 一边是负责生产消息一遍是负责消费消息
相关文章推荐
- 2016-7-20 奶奶走了
- linux 内核移植中的基本配置
- 多媒体技术基础
- 表单设计器初见雏形,出来嘚瑟下!!!
- sql server日期时间转字符串
- cf #363 d
- runloop
- java连接mysql数据库
- java学习笔记
- Codeforces - Educational Codeforces Round 14C - Exponential notation(模拟)
- 按钮动画
- SDK里报错[NSConcreteMutableData wbsdk_base64EncodedString]
- 通过缓冲区复制文本文件
- 【BZOJ】4300 绝世好题
- mysql-5.7.13在windows上安装使用心得
- SDOI
- MediaPlayer( 媒体播放器),TelephonyManager(电话管理类),MediaRecorder(媒体录音机)
- 一些 DOM 对象方法
- 更新lib文件后jar包存在,报FileNotFound的解决办法:
- Loom工具