Closed Vayel closed 6 years ago
cd kafka_2.11-1.0.0
bin/zookeeper-server-start.sh config/zookeeper.properties
bin/kafka-server-start.sh config/server.properties
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
cd spark-2.2.0-bin-hadoop2.7
examples/src/main/python/streaming/direct_kafka_wordcount.py
, changer 2
en 10
(c'est la période à laquelle Spark lit les données dans Kafka)bin/spark-submit --packages org.apache.spark:spark-streaming-kafka-0-8_2.11:2.2.0 examples/src/main/python/streaming/direct_kafka_wordcount.py localhost:9092 test
https://spark.apache.org/docs/2.2.0/streaming-kafka-0-8-integration.html