__consumer_offsets
To produce data to a topic, a producer must provide the Kafka client with any broker from the cluster and the topic name
- Very important: you only need to connect to one broker (any broker) and just provide the topic name you want to write to. Kafka Clients will route your data to the appropriate brokers and partitions for you!
To read data from a topic, the following configuration is needed for the consumers
- Very important: you only need to connect to one broker (any broker) and just provide the topic name you want to read from. Kafka will route your calls to the appropriate brokers and partitions for you!
brew update
brew search jdk
brew install --cask adoptopenjdk8
(자바 8 설치).
디렉토리로 옮긴 뒤 tar -xvf kafka_2.13-3.0.0.tgz
명령어로 압축을 해제.bin/kafka-topics.sh
을 쳤을 때 뭐라뭐라 설명문이 나오면 잘 된거다.mkdir data/zookeeper
(카프카 루트 디렉토리에서)mkdir data/kafka
(카프카 루트 디렉토리에서)config/zookeeper.propertie
의 dataDir값을 위에서 만든 data/zookeeper의 절대경로 값으로 바꿔준다.config/zookeeper.propertie
의 log.dirs값을 위에서 만든 data/kafka의 절대경로 값으로 바꿔준다.bin/zookeeper-server-start.sh config/zookeeper.properties
명령어로 zookeeper서버를 실행한다. 아래 내용이 터미널에 뜨면 잘된거다.INFO binding to port 0.0.0.0/0.0.0.0:2181 (org.apache.zookeeper.server.NIOServerCnxnFactory)
bin/kafka-server-start.sh config/server.properties
로 카프라 서버를 실행한다./Users/hwanil.kim/kafka_2.13-3.0.0/data/kafka`
bin/kafka-topics.sh
로 설명을 볼 수 있다.bin/kafka-topics.sh --bootstrap-server localhost:9092 --topic first_topic --create
Missing required argument "[partitions]"
)bin/kafka-topics.sh --bootstrap-server localhost:9092 --topic first_topic --create --partitions 3
Missing required argument "[replication-factor]"
)bin/kafka-topics.sh --bootstrap-server localhost:9092 --topic first_topic --create --partitions 3 --replication-factor 2
bin/kafka-topics.sh --bootstrap-server localhost:9092 --topic first_topic --create --partitions 3 --replication-factor 1
bin/kafka-topics.sh --bootstrap-server localhost:9092 --list
bin/kafka-topics.sh --bootstrap-server localhost:9092 first_topic --des cribe
bin/kafka-topics.sh --bootstrap-server localhost:9092 --topic first-topic --delete
bin/kafka-console-producer.sh
: producer에 대한 설명 볼 수 있는 명령어bin/kafka-console-producer.sh --broker-list 127.0.0.1:9020 --topic first_topic