Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Steps to install kafka under mac

Shulou Source: shulou.com Published: 2022-06-02 04:57:26 09月10日 Update

This article introduces the relevant knowledge of "the steps to install kafka under mac". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Unlike on the Internet, the java8 encountered in the middle is installed directly through download, because a lot of source replacements have been tried, but none of them are effective, so this bad strategy was unexpectedly successful.

# replace source cd "$(brew--repo)" / Library/Taps/homebrew/homebrew-caskgit remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git# installation jdk8# because the java versions of java and Oracle are not recognized, so you must install brew cask install homebrew/cask-versions/adoptopenjdk8# using this command to bypass Download the pkg installation file directly and install it. # https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09/OpenJDK8U-jdk_x64_mac_hotspot_8u232b09.pkg# download and install it. Note that the version may be different. It is recommended to go to the github download page to query the required version # run brew installation brew install kafka# launch zookeeperzookeeper-server-start / usr/local/etc/kafka/zookeeper.properties# command+T New terminal launch kafkakafka-server-start / usr/local/etc/kafka/server.properties# installation Test # command+T New terminal New topic testkafka-topics-- create-- zookeeper localhost:2181-- replication-factor 1-- partitions 1-- topic test# View Topickafka-topics-- list-- zookeeper locoalhost:2181# producer production message kafka-console-producer-- broker-list localhost:9092-- topic test# consumer consumption message kafka-console-consumer-- bootstrap-server 127.0.0.1 VOV 9092-- topic test-- from-beginninghello Kafka production # reset source cd "$(brew--repo)" / Library/Taps/homebrew/homebrew-caskgit remote set-url origin https://github.com/Homebrew/homebrew-cask

FAQ

Daily start command

Zookeeper-server-start / usr/local/etc/kafka/zookeeper.propertieskafka-server-start / usr/local/etc/kafka/server.properties

Resolve java8 installation issu

Download the file manually and install it later.

Https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09/OpenJDK8U-jdk_x64_mac_hotspot_8u232b09.pkg

Create an automated script

Since the service needs to be started manually after booting, it is recommended to make a sh auto-run script, put it on the desktop, and restart it on a daily basis (mac rarely restarts).

#! / bin/bashthecommand & zookeeper-server-start / usr/local/etc/kafka/zookeeper.propertieskafka-server-start / usr/local/etc/kafka/server.properties

Enter the terminal after completion and grant permission.

Chmod 777 / Users/xxx/Desktop/kafka-run.sh "steps to install kafka under mac" ends here. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Version step content command suggestion manual file more message knowledge script run different practical successful successful next unexpected bad policy backward Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Microsoft Xiaomi Redmi vpn