개발/kafka

[kafka] kafka, zookeeper, server 시작하기 (mac m1)

ttoance 2024. 12. 14. 22:18

 

1. kafka 파일 다운로드 

https://kafka.apache.org/quickstart

 

Apache Kafka

Apache Kafka: A Distributed Streaming Platform.

kafka.apache.org

 

 

2. 카프카 바이너리 압축 풀기

tar -xzf kafka_2.13-3.9.0.tgz
mv kafka_2.13-3.9.0 ~/
cd ~/kafka_2.13-3.9.0
export PATH=$PATH:~/kafka_2.13-3.9.0/bin

 

 

3. 주키퍼 서버 시작하기

 cd ~/kafka_2.13-3.9.0
bin/zookeeper-server-start.sh config/zookeeper.properties

 

4. 수동으로 클러스터 생성 및 구성

cd ~/kafka_2.13-3.9.0
cp config/server.properties config/server0.properties
cp config/server.properties config/server1.properties
cp config/server.properties config/server2.properties

 

 

 

5. 서버 구성 

vi config/server0.properties

broker.id=0
listeners=PLAINTEXT://localhost:9092
log.dirs= /tmp/kafka-logs-0

vi config/server0.properties

broker.id=1
listeners=PLAINTEXT://localhost:9093
log.dirs= /tmp/kafka-logs-1

vi config/server0.properties

broker.id=2
listeners=PLAINTEXT://localhost:9094
log.dirs= /tmp/kafka-logs-2

 

 

6. 카프카 시작하기

cd ~/kafka_2.13-3.9.0
bin/kafka-server-start.sh config/server0.properties
bin/kafka-server-start.sh config/server1.properties
bin/kafka-server-start.sh config/server2.properties

 

 

https://www.michael-noll.com/blog/2013/03/13/running-a-multi-broker-apache-kafka-cluster-on-a-single-node/

 

Running a Multi-Broker Apache Kafka 0.8 Cluster on a Single Node

In this article I describe how to install, configure and run a multi-broker Apache Kafka 0.8 (trunk) cluster on a single machine. The final setup consists of one local ZooKeeper instance and three local Kafka brokers. We will test-drive the setup by sendin

www.michael-noll.com

 

반응형