Using two databases in influxdb simultaneously

Hi there! I’m currently using influxdb to persist time series data. Now I’m planning to store some data related to a specific project and I thought it would be a great idea to use a different database name for that (still on the same influxdb server). This new database might grow large so I want to keep it separate from my current. Obviously I haven’t been able to search and find a solution for how to configure my openHAB 3.4.2 instance to use multiple influxdb databases so I’m asking you guys. I appreciate your kind help.

AFAIK persistence services are singular hence their configuration apply to whole openHAB. You may need to employ another persistence service.

1 Like

Yes, persistence is one per service, you can’t use more than one InfluxDB at the same time.

On the other hand, with InfluxDB2.6.1 there might be options to split the data depending on keys and tags (I’m not deep into this rabbit hole yet)…

Thanks guys for the information!

I found a pretty simple solution using nginx: Module ngx_http_mirror_module

My (abbreviated) configuration looks like this:

server {
        listen 443 ssl;

        server_name influx.internal;

        include snippets/acme.conf;

        location / {
                mirror /mirror;
                proxy_pass http://192.168.2.5:8086; # influxdb
        }

        location = /mirror {
                internal;
                proxy_pass http://192.168.2.43:8428/write; # victoriametrics using influxdb format for ingest
        }
}