kafka mac下载安装
来源:互联网 发布:中国旅游数据统计 编辑:程序博客网 时间:2024/06/05 19:34
一.zookeeper下载与安装
1)下载
adeMacBook-Pro:zookeeper_soft apple$ wget http://mirrors.cnnic.cn/apache/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz
2)解压
tar zxvf zookeeper-3.4.6.tar.gz
3)配置
cd zookeeper-3.4.6
cp -rf conf/zoo_sample.cfg conf/zoo.cfg
vim zoo.cfg
zoo.cfg:
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/Users/apple/Documents/soft/zookeeper_soft/zkdata #这个目录是预先创建的
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/Users/apple/Documents/soft/zookeeper_soft/zkdata #这个目录是预先创建的
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
4)启动zookeeper
adeMacBook-Pro:bin apple$ sh zkServer.sh startJMX enabled by defaultUsing config: /Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../conf/zoo.cfg-n Starting zookeeper ... STARTEDadeMacBook-Pro:bin apple$ ps ax| grep zookeeper.out 10311 s003 S+ 0:00.01 grep zookeeper.outadeMacBook-Pro:bin apple$ ps ax| grep zookeeper10307 s003 S 0:00.63 /usr/bin/java -Dzookeeper.log.dir=. -Dzookeeper.root.logger=INFO,CONSOLE -cp /Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../build/classes:/Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../build/lib/*.jar:/Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../lib/slf4j-log4j12-1.6.1.jar:/Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../lib/slf4j-api-1.6.1.jar:/Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../lib/netty-3.7.0.Final.jar:/Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../lib/log4j-1.2.16.jar:/Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../lib/jline-0.9.94.jar:/Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../zookeeper-3.4.6.jar:/Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../src/java/lib/*.jar:/Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../conf: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false org.apache.zookeeper.server.quorum.QuorumPeerMain /Users/apple/Documents/soft/zookeeper_soft/zookeeper-3.4.6/bin/../conf/zoo.cfg
二 下载并且安装kafka(预先得安装配置好scala的环境,Mac环境参照:http://www.cnblogs.com/super-d2/p/4534208.html)
1).下载kafka:
wget http://apache.fayea.com/kafka/0.8.2.1/kafka_2.10-0.8.2.1.tgz
2) 解压:
tar -zxf kafka_2.10-0.8.2.1.tgz
3)启动kafka
adeMacBook-Pro:kafka_2.10-0.8.2.1 apple$ sh bin/kafka-server-start.sh config/server.properties
备注:要挂到后台使用:
sh bin/kafka-server-start.sh config/server.properties &
4)新建一个TOPIC
adeMacBook-Pro:bin apple$ sh kafka-topics.sh --create --topic kafkatopic --replication-factor 1 --partitions 1 --zookeeper localhost:2181
备注:要挂到后台使用:
sh kafka-topics.sh --create --topic kafkatopic --replication-factor 1 --partitions 1 --zookeeper localhost:2181 &
5) 把KAFKA的生产者启动起来:
adeMacBook-Pro:bin apple$ sh kafka-console-producer.sh --broker-list localhost:9092 --sync --topic kafkatopic
备注:要挂到后台使用:
sh kafka-console-producer.sh --broker-list localhost:9092 --sync --topic kafkatopic &
6)另开一个终端,把消费者启动起来:
adeMacBook-Pro:bin apple$ sh kafka-console-consumer.sh --zookeeper localhost:2181 --topic kafkatopic --from-beginning
备注:要挂到后台使用:
sh kafka-console-consumer.sh --zookeeper localhost:2181 --topic kafkatopic --from-beginning &
7)使用
- 在发送消息的终端输入aaa,则可以在消费消息的终端显示,如下图所示:
阅读全文
0 0
- kafka mac下载安装
- Kafka 下载和安装
- Kafka 下载和安装
- mac/linux 下kafka安装
- Mac-JMeter 下载安装
- mac wget下载安装
- Jetty下载安装+MAC
- kafka(2):kafaka mac/linux 安装
- mac下kafka安装及配置
- mac widget 安装下载网址
- mac 上下载安装tomcat1
- mac mysql 下载安装问题
- go 安装下载 for Mac
- mac jdk下载与安装
- Mac jdk 1.7 安装 下载
- Mac下go下载安装
- kafka 安装和使用测试(mac版)
- Kafka详细教程:下载、安装、配置与集群部署
- 关于STM32F4的AHB和APB时钟频率的问题
- intelliJ idea2016将web工程打成war包解决方案
- 解决Fragment偶发异常java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
- MFC控件的用法
- 临时替代Samba 完后直接操作服务器项目的工具sftpnetdrive
- kafka mac下载安装
- 设计模式----策略模式(推送的实现)
- SVG 贝塞尔曲线学习一
- BZOJ 4197([Noi2015]寿司晚宴-状压dp)
- EclipseLink学习(二)--- 一对一映射
- Map的keySet(),entrySet(),values()方法
- NFS架构下使用realpath_turbo优化php性能
- opengles中VBO和IBO结合使用
- 面向对象的基本概念