Commit fea5e84d authored by Themis Zamani's avatar Themis Zamani

Merge pull request #5 from ioantsaf/kafka_rand_producer

LAM-25 Script that runs random tweet generator and sends output to Kafka
parents f8d6cb30 52fc0585
# lambda instance demo
## Kafka data producer
Runs random tweet generator script (currently placed in /root/data-generator.py), and sends the output to the Kafka topic "input-tweets".
### Prerequisites
- Run on Debian 8.0 node
- Python and Kafka must be installed
- data-generator.py must be placed in /root
### How to run
Create (touch) a file named "runrand" in root.
Run the rand_kafka_producer.sh
The script will run until the runrand file is deleted, producing random tweets every second.
#!/bin/bash
while [ -f "/root/runrand" ]; do
python /root/data-generator.py | /usr/local/kafka/bin/kafka-console-producer.sh --broker-list 192.168.0.3:9092 --topic input
sleep 1
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment