kafka安装
2016-01-25 17:27
447 查看
一:安装
首先查看防火墙是否关闭:
/etc/init.d/iptables status
没有关闭,用下列命令关闭:
/etc/init.d/iptables stop
(1) 下载kafka
kafka下载地址:https://www.apache.org/dyn/closer.cgi?path=/kafka/0.9.0.0/kafka_2.11-0.9.0.0.tgz,下载包放到 /export/servers/目录下
(2)安装kafka
--> tar -xzvf kafka_2.11-0.9.0.0.tgz
--> cd kafka_2.11-0.9.0.0
vim config/server.properties
编辑内容如下:
一定要注销掉 listeners=PLAINTEXT://:9092
broker.id=0
port=9092
host.name=192.168.1.162
num.network.threads=3
num.io.threads=8
socket.send.buffer.bytes=102400
socket.receive.buffer.bytes=102400
socket.request.max.bytes=104857600
log.dirs=/tmp/kafka-logs
num.partitions=1
num.recovery.threads.per.data.dir=1
log.retention.hours=168
log.segment.bytes=1073741824
log.retention.check.interval.ms=300000
log.cleaner.enable=false
zookeeper.connect=192.168.154.64:2181
zookeeper.connection.timeout.ms=60000
-->启动kafka-server:
bin/kafka-server-start.sh config/server.properties
-->create a topic
bin/kafka-topics.sh --create --zookeeper 192.168.154.64:2181
--replication-factor 1 --partitions 1 --topic test
--> topic list
bin/kafka-topics.sh
--list --zookeeper 192.168.154.64:2181
-->send messages
bin/kafka-console-producer.sh --broker-list localhost:9092
--topic test
-->Start a consumer
bin/kafka-console-consumer.sh --zookeeper 192.168.154.64:2181 --topic test --from-beginning
具体的配置请查看官网地址:http://kafka.apache.org/documentation.html#quickstart
首先查看防火墙是否关闭:
/etc/init.d/iptables status
没有关闭,用下列命令关闭:
/etc/init.d/iptables stop
(1) 下载kafka
kafka下载地址:https://www.apache.org/dyn/closer.cgi?path=/kafka/0.9.0.0/kafka_2.11-0.9.0.0.tgz,下载包放到 /export/servers/目录下
(2)安装kafka
--> tar -xzvf kafka_2.11-0.9.0.0.tgz
--> cd kafka_2.11-0.9.0.0
vim config/server.properties
编辑内容如下:
一定要注销掉 listeners=PLAINTEXT://:9092
broker.id=0
port=9092
host.name=192.168.1.162
num.network.threads=3
num.io.threads=8
socket.send.buffer.bytes=102400
socket.receive.buffer.bytes=102400
socket.request.max.bytes=104857600
log.dirs=/tmp/kafka-logs
num.partitions=1
num.recovery.threads.per.data.dir=1
log.retention.hours=168
log.segment.bytes=1073741824
log.retention.check.interval.ms=300000
log.cleaner.enable=false
zookeeper.connect=192.168.154.64:2181
zookeeper.connection.timeout.ms=60000
-->启动kafka-server:
bin/kafka-server-start.sh config/server.properties
-->create a topic
bin/kafka-topics.sh --create --zookeeper 192.168.154.64:2181
--replication-factor 1 --partitions 1 --topic test
--> topic list
bin/kafka-topics.sh
--list --zookeeper 192.168.154.64:2181
-->send messages
bin/kafka-console-producer.sh --broker-list localhost:9092
--topic test
-->Start a consumer
bin/kafka-console-consumer.sh --zookeeper 192.168.154.64:2181 --topic test --from-beginning
具体的配置请查看官网地址:http://kafka.apache.org/documentation.html#quickstart
相关文章推荐
- firebug使用
- Android 4.3 menu item showAsAction=“always”无效的解决办法
- ios蓝牙的基本使用
- firebug使用
- PHP文件系统处理
- 苹果iPhone必须关闭的四个功能
- 苹果iPhone必须关闭的四个功能
- Android Style和Theme
- 一个简单的侧滑关闭Activity的示例
- MySQL某一时间点数据与一小时前、一天前、一月前数据对比
- 将数字转换成对应的中文 将阿拉伯数字翻译成中文的大写数字
- 温控的具体实现:三
- jquery:给正则表达式添加变量
- Linux学习笔记:MySQL读写分离实验【从库回收权限】
- 【SDOI2015】【BZOJ3991】寻宝游戏
- ARM64多核CPU启动流程
- android camera2启动流程
- Nest add mapping
- Android中的传感器的理解
- 结构化 VS 非结构化