InfluxDB 2.x container setup
Introduction
InfluxDB is a time series database. I store data from Home Assistant in this database. InfluxDB has its own reporting module, but you can also use Grafana.
An interesting alternative to InfluxDB is QuestDB. I’m [[Docker - QuestDB Container Setup|experimenting]] with that too.
Setup
-
Create the folders needed by the container
Run the following commands inside your home folder:
-
Create the script needed to run the container
Save the following script as
influxdb_run.sh
:Instructions:
- Optional Replace
docker
withpodman
if needed - Optional Remove
--ulimit nofile=32768:32768
if not needed. This setting is to preventtoo many open files
errors. You can get this error during bulk import of (csv) data, or for example by using the InfluxDB batch node in Node-RED (!!!!! TODO LINK !!!!!!) - Required Replace port number
3004
(on the left side of:
) with a port number that is available if needed - Optional Replace
$PWD/config
with the location of your config if needed. This can be a fileserver mount - Optional Replace
$PWD/data
with the location of your data if needed. This can be a fileserver mount - Required Replace
<username>
with your own username - Required Replace
<password>
with your own password - Required Replace
<organization>
with your own organization name. I used the name of my virtual machine for example - Required Replace
<bucket>
with your own bucket name. Because data of Home Assistant is stored I usedhomeassistant
- Required Replace
Europe/Amsterdam
with your own timezone
- Optional Replace
-
Run the script to create the container
Run the following command:
The image
influxdb
is automatically pulled and the container is created. -
Check the results
If needed you can check if the container is running properly.
Now you can use InfluxDB by opening a web browser and going to:
http://localhost:3004
. Replace localhost with the relevant IP address or FQDN if needed, and adjust the port if you changed it earlier.
No comments found for this note.
Join the discussion for this note on Github. Comments appear on this page instantly.