A small recommendation for people who are running InfluxDB on systems which are “sensitive” to storage I/Os (like Raspberry Pi with SD Cards):
Modify the following logging options in the InfluxDB configuration file (/etc/influxdb/influxdb.conf
):
- Disable the Query logging. In section [data], set
query-log-enabled = false
- Disable the HTTP request logging. In section [http], set
log-enabled = false
Then, restart InfluxDB (systemctl restart influxdb.service
)
From the Influxdb docs entry [Link]
Starting with version 1.0, InfluxDB on systemd systems will no longer write files
to /var/log/influxdb by default, and will now use the system configured
default for logging (usually journald). On most systems, the logs will be directed
to the systemd journal and can be accessed with the command:
`sudo journalctl -u influxdb.service`
Please consult the systemd journald documentation for configuring journald.
In my system, the logs are growing large and I don’t really need to log the queries and/or the http requests:
root@host:~# journalctl --disk-usage
Journals take up 154.1M on disk.
root@host:~# journalctl -u influxdb.service
-- Logs begin at Mon 2017-01-23 22:35:24 EET, end at Sun 2017-01-29 10:14:34 EET. --
Jan 23 22:35:24 homer influxd[1978]: [httpd] ::1 - grafana [23/Jan/2017:22:35:24 +0200] "GET /query?db=openhab_db&epoch=ms&q=SELECT+last%28%22valu
Jan 23 22:35:27 homer influxd[1978]: [httpd] 127.0.0.1 - openhab [23/Jan/2017:22:35:27 +0200] "POST /write?consistency=one&db=openhab_db&p=%5BREDA
Jan 23 22:35:37 homer influxd[1978]: [httpd] 127.0.0.1 - openhab [23/Jan/2017:22:35:37 +0200] "POST /write?consistency=one&db=openhab_db&p=%5BREDA
Jan 23 22:35:48 homer influxd[1978]: [httpd] 127.0.0.1 - openhab [23/Jan/2017:22:35:48 +0200] "POST /write?consistency=one&db=openhab_db&p=%5BREDA
Jan 23 22:35:55 homer influxd[1978]: [query] 2017/01/23 22:35:55 SELECT last(value) FROM openhab_db.autogen.mP6_01_01_V WHERE time > now() - 1d GR
Jan 23 22:35:55 homer influxd[1978]: [query] 2017/01/23 22:35:55 SELECT last(value) FROM openhab_db.autogen.mP6_01_01_P WHERE time > now() - 1d GR
Jan 23 22:35:55 homer influxd[1978]: [query] 2017/01/23 22:35:55 SELECT last(value) FROM openhab_db.autogen.mP6_01_02_V WHERE time > now() - 1d GR
Jan 23 22:35:55 homer influxd[1978]: [query] 2017/01/23 22:35:55 SELECT last(value) FROM openhab_db.autogen.mP3_03_01_P WHERE time > now() - 1d GR
Jan 23 22:35:55 homer influxd[1978]: [query] 2017/01/23 22:35:55 SELECT last(value) FROM openhab_db.autogen.mP3_04_02_P WHERE time > now() - 1d GR
Jan 23 22:35:55 homer influxd[1978]: [query] 2017/01/23 22:35:55 SELECT last(value) FROM openhab_db.autogen.mP3_04_03_P WHERE time > now() - 1d GR
Jan 23 22:35:55 homer influxd[1978]: [query] 2017/01/23 22:35:55 SELECT last(value) FROM openhab_db.autogen.mP6_01_03_V WHERE time > now() - 1d GR
[...]