安装kafka

环境:mac

很多网上说的安装教程都是根据wget编译包再进行解压编译的操作的,但是mac本身是不支持wget的操作

1.安装wget功能

  强烈推荐使用brew安装,使用编译包安装会出现各种稀奇古怪问题. brew install wget.注意 不要用root权限操作.会出现以下的报错

Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.

2.安装zookeeper


1.brew into zookeeper
安装完成之后,去修改zookeeper的配置文件,mac安装默认在/usr/local/etc/zookeeper下的zoo.cfg找到dataDir的属性 将文件保存在自己想要的路径。(zookeeper的参数详解 点击打开链接
# 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/hls/Desktop/zooker
# 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

保存成功之后,启动zookeeper。

zkServer
3.安装java

kafka本身依赖jdk,如果直接brew install kafka 会出现以下提示.

honglvshideMacBook-Pro:zookeeper hls$ brew install kafka
kafka: Java 1.8+ is required to install this formula.
JavaRequirement unsatisfied!

You can install with Homebrew-Cask:
  brew cask install java

You can download from:
  https://www.oracle.com/technetwork/java/javase/downloads/index.html

安装mac的java

brew cask install java
如果在安装的过程中出现中断,可以尝试使用

brew cask reinstall java

4.安装kafka

brew install kafka


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值