kafka+zookeeper环境配置(Mac 或者 linux环境)
来源:互联网 发布:模拟电吉他软件下载 编辑:程序博客网 时间:2024/05/17 23:08
转自:http://www.cnblogs.com/super-d2/p/4534323.html
一.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.6cp -rf conf/zoo_sample.cfg conf/zoo.cfgvim zoo.cfgzoo.cfg:# The number of milliseconds of each ticktickTime=2000# The number of ticks that the initial # synchronization phase can takeinitLimit=10# The number of ticks that can pass between # sending a request and getting an acknowledgementsyncLimit=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 connectclientPort=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 start
安装zookeeper最简单的方法就是使用Homebrew
brew install zookeeper
二 下载并且安装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 &
kafka快速安装方法:
brew install kafka
0 0
- kafka+zookeeper环境配置(Mac 或者 linux环境)
- kafka+zookeeper环境配置(Mac 或者 linux环境)
- kafka+zookeeper环境配置(Mac 或者 linux环境)
- kafka+zookeeper环境配置(Mac 或者 linux环境)
- kafka+zookeeper环境配置(Mac 或者 linux环境)
- kafka+zookeeper环境配置(linux环境单机版)
- kafka+zookeeper环境配置(linux环境单机版)
- kafka+zookeeper环境配置
- Linux下kafka和zookeeper环境搭配
- zookeeper+kafka环境搭建
- zookeeper+kafka环境搭建
- mac kafka 环境搭建
- 搭mongodb+zookeeper+kafka环境
- Zookeeper+kafka集群环境搭建
- Linux 环境zookeeper HA配置注意事项
- Linux 环境zookeeper HA配置注意事项
- 5.配置kafka环境
- Mac os 或者linux下sublime text 3配置c++编译环境
- JMeter事务控制器(Transaction controller)
- hdu 1175 连连看
- 用指针作为函数参数
- java基础学习总结——数组
- Ubuntu16.04中安装Kermit
- kafka+zookeeper环境配置(Mac 或者 linux环境)
- Qt框架及模块认识
- [Mac] Atom 必备插件集合
- 排序算法-插入排序 Insertion Sort Θ(n-n)
- 十八、桥接模式Bridge(结构型模式)
- java中文筛选分词对比
- 我用百度、阿里的产品经验,总结成了这9个产品设计方法
- STL学习笔记— —特殊容器queue
- java图形验证码实现