https://github.com/lresende/bahir-iot-demo
Apache Bahir - MQTT Analytics demo using Apache Spark and Apache Bahir
https://github.com/lresende/bahir-iot-demo
Last synced: 6 months ago
JSON representation
Apache Bahir - MQTT Analytics demo using Apache Spark and Apache Bahir
- Host: GitHub
- URL: https://github.com/lresende/bahir-iot-demo
- Owner: lresende
- License: apache-2.0
- Created: 2016-11-17T09:36:15.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-09-10T02:38:10.000Z (about 6 years ago)
- Last Synced: 2025-03-28T15:48:23.881Z (6 months ago)
- Language: JavaScript
- Homepage: http://bahir.apache.org
- Size: 3.15 MB
- Stars: 7
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Apache Bahir IoT Demo
---------------------This demo provides a Web Application that simulates devices collecting metrics from a elevetor and submits these metrics to a MQTT server using a diffeferent topic for each metric.
It also provides a Spark Application that subscribe to the MQTT topic using the Apache Bahir MQTT streaming connector.
Setting up the infrastructure
=============================Boostraping the MQTT server
---------------------------We boostrap a MQTT Mosquitto server using publicly available docker image
```
docker run -ti --name mosquitto -p 1883:1883 -p 127.0.0.1:9001:9001 toke/mosquitto:latest
```If you get an error because you already have an existent exited container with the same name, issue the command below
```
docker rm -f mosquitto
```Bostrap the web simulator
-------------------------```
cd web-simulator/simulator
node app.js
```**Note:** When starting for the first time, you need to use npm to install required dependencies
```
cd web-simulator/simulator
npm install
node app.js
```Then access the simulator in your browser
```
http://localhost:6001
```Starting your Spark Application
-------------------------------Now we are ready to submit our Spark Application that will subscribe to some MQTT topics and start processing data
```
cd spark-iot-analytics
bin/runStreaming.sh
```The command above will build the application and submit it with it's required dependencies