Örnek
Şöyle yaparız
1. KAFKA_HOME isimli bir ortam değişkeni tanımla. Buna bir değer ata örneğin C:\kafka_2.13–2.8.0
2. Path değişkenine "%KAFKA_HOME%\bin" değerini ilave et
Sonra şöyle yaparız
cd %KAFKA_HOME%# Start ZooKeeper.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties# Start Kafka.\bin\windows\kafka-server-start.bat .\config\server.properties
WSL
Örnek
Şöyle yaparız
# Download latest kafka wget https://downloads.apache.org/kafka/3.5.0/kafka_2.12-3.5.0.tgz # Untar kafka and go to kafka folder tar -xzf kafka_2.13-2.6.0.tgz cd kafka_2.13-2.6.0 # Start Zookeeper on new tab bin/zookeeper-server-start.sh config/zookeeper.properties # Start kafka server on new tab cd kafka_2.13-2.6.0 bin/kafka-server-start.sh config/server.properties # Create topic as quickstart-events on new tab cd kafka_2.13-2.6.0 bin/kafka-topics.sh --create --topic quickstart-events --bootstrap-server localhost:9092 # Create event producer bin/kafka-console-producer.sh --broker-list localhost:9092 --topic quickstart-events >> Hi >> # Start event listener on topic quickstart-event bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 \ --topic quickstart-events --from-beginning >> Hi >> # clean up rm -rf /tmp/kafka-logs /tmp/zookeeper
No comments:
Post a Comment