Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Steps to install kafka under mac

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report