AFKA VERSION
- kafka_2.12-2.1.1
# 주키퍼 실행
%KAFKA_HOME%/bin/windows/zookeeper-server-start.bat ../../config/zookeeper.properties
# 카프카 실행
%KAFKA_HOME%/bin/windows/kafka-server-start.bat ../../config/server.properties
# 토픽 생성
%KAFKA_HOME%\bin\windows\kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic [TOPICNAME]
# 토픽 리스트 확인
%KAFKA_HOME%\bin\windows\kafka-topics.bat --list --zookeeper localhost:2181
# 토픽의 데이터 확인 (컨슈머)
%KAFKA_HOME%/bin/windows/kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic [TOPICNAME] --from-beginning
# 토픽 삭제하기
%KAFKA_HOME%/config 폴더 안에있는 server.properties 파일에 아래 내용 추가
delete.topic.enable=true
%KAFKA_HOME%/bin/windows/kafka-topics.bat --zookeeper localhost:2181 --delete --topic [TOPICNAME]
%KAFKA_HOME%\bin\windows>zookeeper-shell.bat localhost:2181
Connecting to localhost:2181
Welcome to ZooKeeper!
JLine support is disabled
WATCHER::
WatchedEvent state:SyncConnected type:None path:null
Connecting to localhost:2181
Welcome to ZooKeeper!
JLine support is disabled
WATCHER::
WatchedEvent state:SyncConnected type:None path:null
> ls
> ls /brokers/topics
> ls /brokers/topics
[topiclist]
Command failed: java.lang.IllegalArgumentException: Path must start with / character
> rmr /brokers/topics/[TOPICNAME]
> ls /brokers/topics
[TOPICLIST]
> ls /brokers/topics
[TOPICLIST]