Skip to content

kafka setting

qbsb147 edited this page Mar 20, 2026 · 1 revision

⚙️ 1. KRaft 초기화 (필수)

Kafka 4.x에서는 메타데이터 저장을 위해 👉 클러스터 ID 생성 + 로그 디렉토리 초기화 필요

bin\windows\kafka-storage.bat random-uuid

👉 출력된 UUID 복사 후

bin\windows\kafka-storage.bat format -t <클러스터ID> -c config\kraft\server.properties

🚀 2. Kafka 서버 실행

bin\windows\kafka-server-start.bat config\kraft\server.properties

✅ 3. 정상 실행 확인

  • 에러 없이 실행되면 정상
  • 기본 포트: 9092

(로그 출력으로 확인하는 방식이 일반적 → 별도 명령 검증은 환경마다 달라 확실하지 않음)

📨 4. 테스트 (토픽 생성 & 메시지 확인)

📌 토픽 생성

bin\windows\kafka-topics.bat --create --topic test-topic --bootstrap-server localhost:9092 --partitions 1 --replication-factor 1

📌 Producer 실행

bin\windows\kafka-console-producer.bat --topic test-topic --bootstrap-server localhost:9092

📌 Consumer 실행

bin\windows\kafka-console-consumer.bat --topic test-topic --from-beginning --bootstrap-server localhost:9092

👉 메시지 입력 → Consumer에 출력되면 정상 🎉

👉 Kafka 4.x부터는 Zookeeper 없이 KRaft 단독 실행 구조

📡 이벤트 스트리밍

⚙️ 개발 환경 구축

Websocket

Kafka

Redis

Debezium

🧩 기능 구현

이벤트리스너(Spring)

Pub/Sub 기반 메세지 처리(Redis)

이벤트 스트리밍 처리(Kafka)

CDC(Debezium)

🧠 개념

🎯 설계 패턴

🏗️ 아키텍처

📚 기술 스택

Clone this wiki locally