Data Engineering/MQTT
Kafka 설치(윈도우)
하 선생
2022. 2. 10. 09:07
# 카프카 다운로드
https://kafka.apache.org
별도 설치과정없이 압축해제
# Zookeeper 실행
> cd C:\kafka_2.13-3.1.0
> bin\windows\zookeeper-server-start.bat config\zookeeper.properties
# 카프카 서버 실행
> bin\windows\kafka-server-start.bat config\server.properties
# 사용포트
주키퍼 : 2181
카프카 : 9092
# 테스트
1) 경로이동
> C:\kafka_2.13-3.1.0\bin\windows
2) test란 이름으로 토픽생성
> kafka-topics.bat --create --bootstrap-server localhost:9092 --topic test
3) 생성된 토픽확인
> kafka-topics.bat --list --bootstrap-server localhost:9092
4) 메세지 발행
> kafka-console-producer.bat --broker-list localhost:9092 --topic test
5) 메세지 구독
> kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic test --from-beginning