The DataStack is based on the following Components:
Additionally, a DataStack Adapter is provided to feed data into the respective database. The DataStack Adapter is based on the Panta Rhei project, i.e., it expects data to be accessible as in Panta Rhei with a Kafka messaging layer and SensorThings semantic. This Adapter, however, can be easily changed to other data sources.
-
Install Docker version 1.10.0+
-
Install Docker Compose version 1.6.0+
-
Setting up a Docker Swarm on a cluster. (optional).
If not already done, start a registry instance to make the cumstomized images deployable: (we are using port 5001, as logstash's default port is 5000)
sudo docker service create --name registry --publish published=5001,target=5000 registry:2 curl 127.0.0.1:5001/v2/
This should output
{}
: -
Clone this repository recursively on the manager node of the docker swarm or on a master node.
git clone --recurse-submodules https://github.com/iot-salzburg/dtz_datastack.git cd datastack/
-
(only for the Elastic Stack) Set
vm.max_map_count
permanently in/etc/sysctl.conf
:grep vm.max_map_count /etc/sysctl.conf # -> vm.max_map_count=262144 # or set it temporarily sysctl -w vm.max_map_count=262144
-
Create a new virtualenv and install the requirements:
cd ../datastack pip3 install virtualenv source .venv/bin/activate pip3 install -r influxdb-adapter/requirements.txt
Continue the setup with the following parts. Note that there are two possible databases, however, InfluxDB is recommended:
- InfluxDB and Grafana (in a sub-directory)
- (Alternative to InfluxDB) Elastic Stack and Grafana (in a sub-directory)
- InfluxDB Adapter (in a sub-directory)
- (Alternative to InfluxDB) ElaticStack Adapter (in a sub-directory)
- Jupyter Notebook (in a sub-directory)
- Proxy Config
- Trouble Shooting
If used behind an apache2 proxy, make sure to enable additional moduls
sudo a2enmod ssl rewrite proxy proxy_http proxy_wstunnel
Use the following config (note that the notebook will be available in https:/url/jupyter)
RewriteRule ^/jupyter$ jupyter/tree/ [R]
RewriteRule ^/jupyter/$ jupyter/tree/ [R]
<Location "/jupyter">
ProxyPass http://localhost:8888/jupyter
ProxyPassReverse http://localhost:8888/jupyter
</Location>
<Location "/jupyter/api/kernels">
ProxyPass ws://localhost:8888/jupyter/api/kernels
ProxyPassReverse ws://localhost:8888/jupyter/api/kernels
</Location>
<Location "/jupyter/terminals/websocket">
ProxyPass ws://localhost:8888/jupyter/terminals/websocket
ProxyPassReverse ws://localhost:8888/jupyter/terminals/websocket
</Location>
#ProxyPass /jupyter/api/kernels/ ws://127.0.0.1:8888/jupyter/api/kernels/
#ProxyPassReverse /jupyter/api/kernels/ ws://127.0.0.1:8888/jupyter/api/kernels/
#ProxyPass /jupyter http://localhost:8888/jupyter connectiontimeout=15 timeout=30
#ProxyPassReverse /jupyter http://localhost:8888/jupyter
ProxyPass /jupyter/tree http://127.0.0.1:8888/jupyter/tree
ProxyPassReverse /jupyter/tree http://127.0.0.1:8888/jupyter/tree
#ProxyPass /jupyter http://127.0.0.1:8888/jupyter/
#ProxyPassReverse /jupyter http://127.0.0.1:8888/jupyter/
#<Location ~ "/(user/[^/]*)/(api/kernels/[^/]+/channels|terminals/websocket)/?">
# ProxyPass ws://localhost:8888/jupyter
# ProxyPassReverse ws://localhost:8888/jupyter
#</Location>
For more help, see here
Restart the service
sudo service docker restart
# or
sudo service apparmor restart
or add the file /etc/docker/daemon.json
with the content:
{
"dns": [your_dns, "8.8.8.8"]
}
where your_dns
can be found with the command:
nmcli device show <interfacename> | grep IP4.DNS
Restart service with
sudo service docker restart
or add your dns address as described above
Check permission of elasticsearch/data
.
sudo chown -r USER:USER .
sudo chmod -R 777 .
or remove redundant docker installations or reinstall it
Bring down other services, or change the hosts port number in docker-compose.yml.
Find all running services by:
sudo docker ps
Remove redundant docker installations
If 192.168.48.XX:5001/v2/
works when XX
is another node, then a restart fixed the problem. Maybe also a docker restart works.
"entire heap max virtual memory areas vm.max_map_count [...] likely too low, increase to at least [262144]"
Run on host machine:
sudo sysctl -w vm.max_map_count=262144