개인프로젝트/기능프로그램_오늘뭐입지
20240517_Kafka 사용하기
일일일코_장민기
2024. 5. 17. 09:35
728x90
Zookeeper 설치
https://www.apache.org/dyn/closer.cgi/zookeeper/
위 사이트에서 Zookeeper 다운
#Kafka 포트 번호 충돌(8080번)이 발생할 경우
Kafka 설치
https://kafka.apache.org/downloads
위 사이트에서 Kafka 다운로드
토픽 생성
# kafka 2.2 이상 버전에서는 --zookeeper 옵션 대신에 --bootstrap-server 옵션을 사용
이미지는 이미 만들었기 때문에 에러 출력됨
로컬 호스트의 Kafka 서버(기본 포트 9092)를 지정
토픽 조회
메세지 송수신
1. 메세지 수신자(consumer) 생성
2. 메세지 송신자(producer) 생성
3. 메세지 송신
4. 메세지 수신
간단한데 실제로 해보면 좀 신기하다
카프카에 대한 정보