Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
okeanos-LoD
Commits
fea5e84d
Commit
fea5e84d
authored
Jun 25, 2015
by
Themis Zamani
Browse files
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
kafka_producer_scripts/README.md
0 → 100644
View file @
fea5e84d
# 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.
kafka_producer_scripts/rand_kafka_producer.sh
0 → 100755
View file @
fea5e84d
#!/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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment