Commit 76450c8e authored by Ioannis Tsafaras's avatar Ioannis Tsafaras
Browse files

LAM-25 Script that runs random tweet generator and sends output to Kafka topic

parent 3b9b59df
# 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/lib/kafka_2.10-0.8.2.1/bin/kafka-console-producer.sh --broker-list snf-661306:9092 --topic input-tweets
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