More detailed context
As documented in the comment linked above, I got this setup fully working so that I was running openHAB (openhabian OS), influxDB and Grafana on the Raspberry Pi4.
Since this stuff is going to control the heating of our house, I was educating myself on the reliability of Raspberry. I managed to setup watchdog to automatically reboot when shit hits the fan and so on, but then I found one of the many threads about corrupted SD cards. And learnt that to lower the risk of corrupting the card (or to try to postpone the time when it eventually happens), one strategy would be to use a database hosted on another server so that the Raspberry would not have to have so many writes to the SD card.
What am I trying to achieve
I happen to have a NAS server in the same LAN so I
installed MariaDB on the NAS server (ready package from the NAS, influxDB was not available)
and created a database and user for openhab
installed the JDBC Persistence MariaDB add-on
configured jdbc.cfg and jdbc.persist
and observed that the normal item persistence was working as expected
Edit: Others have used the exec binding to execute a shell script that uses the command line client, but I would like to avoid installing the exec if I can.
I don’t use JDBC databases with OH so I’ve nothing to offer. It would be odd that it only errors when posting data through the REST API but not when the Items themselves are changing since it’s all activating the same code.
Meanwhile I’m “almost there” with installing InfluxDB on my Asustor NAS so that I could write to that with Influx DB’s REST API, just like I did with the Influx server on my Raspberry.
I was able to start Influx with the influxd binary, but the remaining part is to try to get the daemon to start automatically when my NAS reboots. I need to google that a bit more since my NAS doesn’t seem to have /lib/systemd/system/ where I could place influxdb2.service like I did on my Raspberry… But that’s not an OH problem, so I’ll have to figure some other mechanism for it…