欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

mac安装Kafka

程序员文章站 2022-03-04 13:48:51
...

由于工作需要,想研究下kafka。于是在自己的mac上安装Kafka,直接执行命令brew install kafka,结果报了如下提示:

Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
um
==> Updated Formulae
zsh-completions ✔   bmake               diffoscope          eslint              gandi.cli           json-fortran        meson               opam                safe                wabt
abyss               brotli              dlib                feh                 [email protected]               libgcrypt           mkvtoolnix          parallel            skaffold            webpack
angular-cli         c-ares              doitlive            flake8              getdns              libopendkim         monero              pgformatter         stubby              xmake
ansible             checkbashisms       duplicity           flyway              gpa                 librsvg             nifi                php-cs-fixer        tbb                 z3
aspectj             collectd            ejabberd            fonttools           homebank            lynis               nnn                 plantuml            ucloud              zookeeper
autopep8            ddgr                elixir              futhark             idris               mdcat               nss                 rust                unbound

kafka: Java 1.8 is required to install this formula.
JavaRequirement unsatisfied!
You can install with Homebrew Cask:
 brew cask install homebrew/cask-versions/java8
You can download from:
 https://www.oracle.com/technetwork/java/javase/downloads/index.html
Error: An unsatisfied requirement failed this build.

从提示中,可以看出是缺少java1.8的jdk。于是执行命令brew cask install homebrew/cask-versions/java8,安装Java1.8的jdk,安装过程如下所示

==> Tapping homebrew/cask-versions
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions'...
remote: Enumerating objects: 227, done.
remote: Counting objects: 100% (227/227), done.
remote: Compressing objects: 100% (216/216), done.
remote: Total 227 (delta 17), reused 49 (delta 10), pack-reused 0
Receiving objects: 100% (227/227), 91.82 KiB | 79.00 KiB/s, done.
Resolving deltas: 100% (17/17), done.
Tapped 207 casks (246 files, 349.5KB).
==> Caveats
This Cask makes minor modifications to the JRE to prevent issues with
packaged applications, as discussed here:

  https://bugs.eclipse.org/bugs/show_bug.cgi?id=411361

If your Java application still asks for JRE installation, you might need
to reboot or logout/login.

Installing java8 means you have AGREED to the license at
  https://www.oracle.com/technetwork/java/javase/terms/license/index.html

==> Satisfying dependencies
==> Downloading https://download.oracle.com/otn-pub/java/jdk/8u192-b12/750e1c8617c5452694857ad95c3ee230/jdk-8u192-macosx-x64.dmg
==> Downloading from https://download.oracle.com/otn-pub/java/jdk/8u192-b12/750e1c8617c5452694857ad95c3ee230/jdk-8u192-macosx-x64.dmg?AuthParam=1540643090_5c9af33a69f03fb1455c1720498fa1e5
######################################################################## 100.0%
==> Verifying SHA-256 checksum for Cask 'java8'.
==> Installing Cask java8
==> Running installer for java8; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
Password:
installer: Package name is JDK 8 Update 192
installer: Installing at base path /
installer: The install was successful.
?  java8 was successfully installed!

在安装完1.8版本jdk之后,再次执行命令brew install kafka,安装过程如下所示:

==> Installing dependencies for kafka: zookeeper
==> Installing kafka dependency: zookeeper
==> Downloading https://homebrew.bintray.com/bottles/zookeeper-3.4.13.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring zookeeper-3.4.13.high_sierra.bottle.tar.gz
==> Caveats
To have launchd start zookeeper now and restart at login:
  brew services start zookeeper
Or, if you don't want/need a background service you can just run:
  zkServer start
==> Summary
?  /usr/local/Cellar/zookeeper/3.4.13: 244 files, 33.4MB
==> Installing kafka
==> Downloading https://homebrew.bintray.com/bottles/kafka-2.0.0.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring kafka-2.0.0.high_sierra.bottle.tar.gz
==> Caveats
To have launchd start kafka now and restart at login:
  brew services start kafka
Or, if you don't want/need a background service you can just run:
  zookeeper-server-start /usr/local/etc/kafka/zookeeper.properties & kafka-server-start /usr/local/etc/kafka/server.properties
==> Summary
?  /usr/local/Cellar/kafka/2.0.0: 160 files, 46.8MB
==> Caveats
==> zookeeper
To have launchd start zookeeper now and restart at login:
  brew services start zookeeper
Or, if you don't want/need a background service you can just run:
  zkServer start
==> kafka
To have launchd start kafka now and restart at login:
  brew services start kafka
Or, if you don't want/need a background service you can just run:
  zookeeper-server-start /usr/local/etc/kafka/zookeeper.properties & kafka-server-start /usr/local/etc/kafka/server.properties

至此,mac上安装kafka的过程结束。

相关标签: Kafka