InfluxDB, Node-RED and Grafana - Printable Version +- Hilscher Community Forum (https://forum.hilscher.com) +-- Forum: General Infos (https://forum.hilscher.com/forum-28.html) +--- Forum: Projects (https://forum.hilscher.com/forum-41.html) +--- Thread: InfluxDB, Node-RED and Grafana (/thread-684.html) |
InfluxDB, Node-RED and Grafana - Armin@netPI - January-6th-2021 Deploy multiple interrelated containers at a time the Docker function "stacks" can be used. To use it on netPI open the Docker web GUI portainer.io and then click the menu item "Stacks" to the left. Then click "+Add stack", enter a name of your stack like "mystack" and click into the "Web editor" windows in the middle and paste the following compose data to it Code: version: "2" Your screen will look like The example compose data above contains information about to deploy 3 containers at a time
Click "Deploy the stack" and patiently wait for netPI to load and start all 3 containers. This may take 10 minutes. The web interface will report a warning message at the end in a orange colored window. This message can be ignored. Your container overview screen will look like Continue to
Code: [{"id":"f6f2187d.f17ca8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"3cc11d24.ff01a2","type":"comment","z":"f6f2187d.f17ca8","name":"WARNING: please check you have started this container with a volume that is mounted to /data\\n otherwise any flow changes are lost when you redeploy or upgrade the container\\n (e.g. upgrade to a more recent node-red docker image).\\n If you are using named volumes you can ignore this warning.\\n Double click or see info side panel to learn how to start Node-RED in Docker to save your work","info":"\nTo start docker with a bind mount volume (-v option), for example:\n\n```\ndocker run -it -p 1880:1880 -v /home/user/node_red_data:/data --name mynodered nodered/node-red\n```\n\nwhere `/home/user/node_red_data` is a directory on your host machine where you want to store your flows.\n\nIf you do not do this then you can experiment and redploy flows, but if you restart or upgrade the container the flows will be disconnected and lost. \n\nThey will still exist in a hidden data volume, which can be recovered using standard docker techniques, but that is much more complex than just starting with a named volume as described above.","x":350,"y":80,"wires":[]},{"id":"dc05ff72.ee1dd","type":"influxdb out","z":"f6f2187d.f17ca8","influxdb":"583af9d1.9aae98","name":"","measurement":"mytestdata","precision":"","retentionPolicy":"","database":"database","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":510,"y":300,"wires":[]},{"id":"d9436c1e.e3ffc","type":"inject","z":"f6f2187d.f17ca8","name":"Write timestamp every second","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":250,"y":220,"wires":[["dc05ff72.ee1dd"]]},{"id":"583af9d1.9aae98","type":"influxdb","hostname":"influxdb","port":"8086","protocol":"http","database":"db0","name":"local Influx database","usetls":false,"tls":"","influxdbVersion":"1.x","url":"http://localhost:8086","rejectUnauthorized":true}] Your Node-RED screen will look like this To visualize the periodically written data
Your grafana screen will look like As next
Your grafana screen will look like
Your screen finally will look like |