因为要测试InfluxDB,看看Client查询了什么,就service influxdb stop停掉了influxDB,然后直接用influxd进程直接跑了,测试完之后,service influxdb start启动InfluxDB,发现查询很慢,且5分钟内无数据,重启了influxdb服务几次后,连show measurements都出不来结果了,journalctl -xe查看系统日志发现有一下信息
Apr 12 05:17:09 raspberrypi influxd[495]: [write] 2019/04/12 05:17:09 write failed for shard 21: [shard 21] open /var/lib/influxdb/wal/ServerMonitor/oneDay/21/_00003.wal: permission denied
原来是权限的问题,我手动执行influxd的时候用的是root账户,而influxdb服务运行时是以influxdb用户运行的,cd到/var/lib/influxdb/,给wal目录加写权限后,恢复正常。
pi@raspberrypi:~ $ cd /var/lib/influxdb/ pi@raspberrypi:/var/lib/influxdb $ ls -la total 20 drwxr-xr-x 5 influxdb influxdb 4096 Apr 5 02:14 . drwxr-xr-x 33 root root 4096 Apr 5 18:43 .. drwxr-xr-x 4 influxdb influxdb 4096 Apr 11 16:51 data drwxr-xr-x 2 influxdb influxdb 4096 Apr 12 00:37 meta drwx------ 4 influxdb influxdb 4096 Apr 11 16:51 wal pi@raspberrypi:/var/lib/influxdb $ cd wal/ -bash: cd: wal/: Permission denied pi@raspberrypi:/var/lib/influxdb $ sudo chmod 777 wal/ -R pi@raspberrypi:/var/lib/influxdb $ cd wal/ pi@raspberrypi:/var/lib/influxdb/wal $ ls -la total 16 drwxrwxrwx 4 influxdb influxdb 4096 Apr 11 16:51 . drwxr-xr-x 5 influxdb influxdb 4096 Apr 5 02:14 .. drwxrwxrwx 4 influxdb influxdb 4096 Apr 6 12:00 _internal drwxrwxrwx 5 influxdb influxdb 4096 Apr 7 07:01 ServerMonitor
-
« 上一篇:
OhmGraphite监控温度时host主机名全大写问题