// Kafka 완전 삭제하고 싶다면 Kafka & zookeeper 삭제하기
cd /
cd tmp
ls

// zookeeper 실행
./bin/zookeeper-server-start.sh ./config/zookeeper.properties

// Kafka 실행 명령어
./bin/kafka-server-start.sh config/server.properties

// Topic 생성후 설정 확인
./bin/kafka-topics.sh --create --topic first-topic --bootstrap-server localhost:9092
./bin/kafka-topics.sh --describe --topic first-topic --bootstrap-server localhost:9092

// Producer 실행 및 사용
./bin/kafka-console-producer.sh --topic first-topic --bootstrap-server localhost:9092

// Consumer 실행 및 사용
./bin/kafka-console-consumer.sh --topic first-topic --from-beginning --bootstrap-server localhost:9092

// Broker 실행
./bin/kafka-server-start.sh config/server9092.properties

// partition leader 변경
./bin/kafka-leader-election.sh -- topic "topic 이름" --bootstrap-server "실행 서버"
--election-type preferred --partition "바꿀 파티션 id"
// Ex)
// topic 이름: third-rep
// 실행 서버: localhost:9092
// partition id: 0
./bin/kafka-leader-election.sh -- topic third-rep --bootstrap-server localhost:9092
--election-type preferred --partition 0

// Consumer Group 설정
./bin/kafka-console-producer.sh --topic second-rep --bootstrap-server localhost:9092

./bin/kafka-console-consumer.sh --topic second-rep --group group1 --bootstrap-server localhost:9092