Influxdb启动失败日志定位

Influxdb启动失败日志定位

之前做过Jmeter使用influxdb和grafana展示测试数据,当时使用了graphite,现在看到Jmeter好像可以直接存在influxdb中,就想尝试下,就找了台机器搭建influxdb,然后悲剧了,起不来。

其实问题很简单,基本不是端口占用就是文件夹权限问,主要是找不到日志。。

下面是完整的经过
搭建完influxdb,并且systemctl start influxdb之后,想连进去看看:

1
2
3
[root@tokyle bin]# influx
Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp [::1]:8086: connect: connection refused
Please check your connection settings and ensure 'influxd' is running.

进不去。。检查状态:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[root@tokyle bin]# systemctl  status  influxdb
● influxdb.service - InfluxDB is an open-source, distributed, time series database
Loaded: loaded (/usr/lib/systemd/system/influxdb.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since 四 2019-06-27 11:00:45 CST; 2min 0s ago
Docs: https://docs.influxdata.com/influxdb/
Process: 3587 ExecStart=/usr/bin/influxd -config /etc/influxdb/influxdb.conf $INFLUXD_OPTS (code=exited, status=1/FAILURE)
Main PID: 3587 (code=exited, status=1/FAILURE)

6月 27 11:00:44 tokyle.com systemd[1]: Unit influxdb.service entered failed state.
6月 27 11:00:44 tokyle.com systemd[1]: influxdb.service failed.
6月 27 11:00:45 tokyle.com systemd[1]: influxdb.service holdoff time over, scheduling restart.
6月 27 11:00:45 tokyle.com systemd[1]: Stopped InfluxDB is an open-source, distributed, time series database.
6月 27 11:00:45 tokyle.com systemd[1]: start request repeated too quickly for influxdb.service
6月 27 11:00:45 tokyle.com systemd[1]: Failed to start InfluxDB is an open-source, distributed, time series database.
6月 27 11:00:45 tokyle.com systemd[1]: Unit influxdb.service entered failed state.
6月 27 11:00:45 tokyle.com systemd[1]: influxdb.service failed.

压根没起来

找日志,先到/var/lib/influxdb下,没知道,/var/log/没找到

系统日志
journalctl -u influxdb

1
2
3
4
5
6
7
8
9
journalctl -u influxdb

6月 27 10:46:02 tokyle.com systemd[1]: influxdb.service: main process exited, code=exited, status=1/FAILURE
6月 27 10:46:02 tokyle.com systemd[1]: Unit influxdb.service entered failed state.
6月 27 10:46:02 tokyle.com systemd[1]: influxdb.service failed.
6月 27 10:46:03 tokyle.com systemd[1]: influxdb.service holdoff time over, scheduling restart.
6月 27 10:46:03 tokyle.com systemd[1]: Stopped InfluxDB is an open-source, distributed, time series database.
6月 27 10:46:03 tokyle.com systemd[1]: start request repeated too quickly for influxdb.service
6月 27 10:46:03 tokyle.com systemd[1]: Failed to start InfluxDB is an open-source, distributed, time series database.

还是看不出什么问题

最后,不使用systemctl直接手工启动influxdb:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
systemctl stop influxdb

cd /usr/bin

[root@tokyle bin]# influxd -config /etc/influxdb/influxdb.conf

8888888 .d888 888 8888888b. 888888b.
888 d88P" 888 888 "Y88b 888 "88b
888 888 888 888 888 888 .88P
888 88888b. 888888 888 888 888 888 888 888 888 8888888K.
888 888 "88b 888 888 888 888 Y8bd8P' 888 888 888 "Y88b
888 888 888 888 888 888 888 X88K 888 888 888 888
888 888 888 888 888 Y88b 888 .d8""8b. 888 .d88P 888 d88P
8888888 888 888 888 888 "Y88888 888 888 8888888P" 8888888P"

2019-06-27T03:04:08.786635Z info InfluxDB starting {"log_id": "0GHj5JKW000", "version": "1.6.1", "branch": "1.6", "commit": "5766854b95ae86cccf6cc8ffe4c5bb9eacc994b8"}
2019-06-27T03:04:08.786678Z info Go runtime {"log_id": "0GHj5JKW000", "version": "go1.10.3", "maxprocs": 4}
run: open server: listen: listen tcp 127.0.0.1:8088: bind: address already in use

终于看见了,端口被占用

1
2
[root@tokyle bin]# netstat -anp | grep 8088
tcp6 0 0 :::8088 :::* LISTEN 22329/docker-proxy

docker占了8088,问题解决

以上经过,记住,influxdb找不到日志:

  1. journalctl -u influxdb
  2. /usr/bin/influxd -config /etc/influxdb/influxdb.conf
文章目录
|