I’m running hassio on a solid state drive on my Linux server, and I wanted to install the InfluxDB add-on, but with the database residing on a separate hard drive on my system. I’d been having a tough time settling on a good way to do it, but I stumbled upon something yesterday that helped me, so I thought I’d pass along the steps I took.
1. Make sure the desired database location is accessible to hassio.
In my case, I had my external drive mounted to /usr/share/hassio/share/db
. (I used an automount entry in /etc/fstab
.) This allowed me to access my drive within hassio at the location /share/db
. I was already using this to store my built-in Home Assistant database, which had grown to something of a monster and needed more room to roam.
To keep the InfluxDB files somewhat separate from the built-in database, I created a subdirectory called influxdb
.
2. Install the InfluxDB add-on, setting a few InfluxDB environment variables when you do.
As @frenck notes in the README of his excellent add-on, the config allows you to set some environment variables for the InfluxDB configuration. This was the key.
Here’s what I used when I first fired up the add-on. The main section to note is the envvars
section: make sure that all three directories you list under value
start with /share/db/influxdb
(or whatever you’ve called your directory in the previous step).
Also, I went ahead and created the three directories listed below (meta
, data
, and wal
), but I don’t think that’s necessary. One of the resident gurus will hopefully clarify that…
I disabled auth
just for configuration, since the add-on didn’t seem to want to start when I had it enabled. The setting for reporting
is your call, and I wasn’t using ssl
.
auth: false
reporting: false
ssl: false
certfile: fullchain.pem
keyfile: privkey.pem
envvars:
- name: INFLUXDB_META_DIR
value: /share/db/influxdb/meta
- name: INFLUXDB_DATA_DIR
value: /share/db/influxdb/data
- name: INFLUXDB_WAL_DIR
value: /share/db/influxdb/wal
3. Follow the InfluxDB add-on instructions for integrating with Home Assistant.
Once again, @frenck is here to save the day with his Home Assistant integration instructions in the README.
Note: if you disabled authentication in the second step above, go ahead and enable it before you restart. (Since you’ve created a user in the InfluxDB add-on and added the user’s credentials in configuration.yaml
, you shouldn’t have any issues.)
4. Enjoy your data!
That’s it…I hope this helps someone and is at least reasonably accurate. Savvy users: please chime in if I’ve missed something or have something wrong, and I’ll update this so as not to mislead anyone in the future.