为什么influxdb启动失败?

问题描述 投票:0回答:3

我安装了Influxdb版本(InfluxDB v1.7.7)

我刚刚安装,我尝试启动 infludb 而不更改配置文件中的任何内容...

我使用influxd启动influxdb

但是我无法开始...收到如下错误...请帮助我

 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-07-11T07:17:02.124129Z     info    InfluxDB starting       {"log_id": "0GZz7YB0000", "version": "1.7.7", "branch": "1.7", "commit": "f8fdf652f348fc9980997fe1c972e2b79ddd13b0"}
2019-07-11T07:17:02.124155Z     info    Go runtime      {"log_id": "0GZz7YB0000", "version": "go1.11", "maxprocs": 4}
2019-07-11T07:17:02.225149Z     info    Using data dir  {"log_id": "0GZz7YB0000", "service": "store", "path": "/var/lib/influxdb/data"}
2019-07-11T07:17:02.225206Z     info    Compaction settings     {"log_id": "0GZz7YB0000", "service": "store", "max_concurrent_compactions": 2, "throughput_bytes_per_second": 50331648, "throughput_bytes_per_second_burst": 50331648}
2019-07-11T07:17:02.225229Z     info    Open store (start)      {"log_id": "0GZz7YB0000", "service": "store", "trace_id": "0GZz7Y_G000", "op_name": "tsdb_open", "op_event": "start"}
2019-07-11T07:17:02.225320Z     info    Open store (end)        {"log_id": "0GZz7YB0000", "service": "store", "trace_id": "0GZz7Y_G000", "op_name": "tsdb_open", "op_event": "end", "op_elapsed": "0.094ms"}
run: open server: open tsdb store: mkdir /var/lib/influxdb/data/_internal/_series: permission denied

须藤涌入

 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-07-11T09:57:11.220614Z     info    InfluxDB starting       {"log_id": "0G_7I1i0000", "version": "1.7.7", "branch": "1.7", "commit": "f8fdf652f348fc9980997fe1c972e2b79ddd13b0"}
2019-07-11T09:57:11.220640Z     info    Go runtime      {"log_id": "0G_7I1i0000", "version": "go1.11", "maxprocs": 4}
2019-07-11T09:57:11.321428Z     info    Using data dir  {"log_id": "0G_7I1i0000", "service": "store", "path": "/var/lib/influxdb/data"}
2019-07-11T09:57:11.321462Z     info    Compaction settings     {"log_id": "0G_7I1i0000", "service": "store", "max_concurrent_compactions": 2, "throughput_bytes_per_second": 50331648, "throughput_bytes_per_second_burst": 50331648}
2019-07-11T09:57:11.321474Z     info    Open store (start)      {"log_id": "0G_7I1i0000", "service": "store", "trace_id": "0G_7I26G000", "op_name": "tsdb_open", "op_event": "start"}
2019-07-11T09:57:11.322432Z     info    Reading file    {"log_id": "0G_7I1i0000", "engine": "tsm1", "service": "cacheloader", "path": "/var/lib/influxdb/wal/_internal/monitor/2/_00001.wal", "size": 10413807}
2019-07-11T09:57:11.322610Z     info    Opened file     {"log_id": "0G_7I1i0000", "engine": "tsm1", "service": "filestore", "path": "/var/lib/influxdb/data/_internal/monitor/1/000000001-000000001.tsm", "id": 0, "duration": "0.121ms"}
2019-07-11T09:57:11.326176Z     info    Opened shard    {"log_id": "0G_7I1i0000", "service": "store", "trace_id": "0G_7I26G000", "op_name": "tsdb_open", "index_version": "inmem", "path": "/var/lib/influxdb/data/_internal/monitor/1", "duration": "4.013ms"}
2019-07-11T09:57:11.853856Z     info    Opened shard    {"log_id": "0G_7I1i0000", "service": "store", "trace_id": "0G_7I26G000", "op_name": "tsdb_open", "index_version": "inmem", "path": "/var/lib/influxdb/data/_internal/monitor/2", "duration": "531.737ms"}
2019-07-11T09:57:11.854060Z     info    Open store (end)        {"log_id": "0G_7I1i0000", "service": "store", "trace_id": "0G_7I26G000", "op_name": "tsdb_open", "op_event": "end", "op_elapsed": "532.586ms"}
2019-07-11T09:57:11.854108Z     info    Opened service  {"log_id": "0G_7I1i0000", "service": "subscriber"}
2019-07-11T09:57:11.854124Z     info    Starting monitor service        {"log_id": "0G_7I1i0000", "service": "monitor"}
2019-07-11T09:57:11.854137Z     info    Registered diagnostics client   {"log_id": "0G_7I1i0000", "service": "monitor", "name": "build"}
2019-07-11T09:57:11.854148Z     info    Registered diagnostics client   {"log_id": "0G_7I1i0000", "service": "monitor", "name": "runtime"}
2019-07-11T09:57:11.854158Z     info    Registered diagnostics client   {"log_id": "0G_7I1i0000", "service": "monitor", "name": "network"}
2019-07-11T09:57:11.854176Z     info    Registered diagnostics client   {"log_id": "0G_7I1i0000", "service": "monitor", "name": "system"}
2019-07-11T09:57:11.854198Z     info    Starting precreation service    {"log_id": "0G_7I1i0000", "service": "shard-precreation", "check_interval": "10m", "advance_period": "30m"}
2019-07-11T09:57:11.854213Z     info    Starting snapshot service       {"log_id": "0G_7I1i0000", "service": "snapshot"}
2019-07-11T09:57:11.854227Z     info    Starting continuous query service       {"log_id": "0G_7I1i0000", "service": "continuous_querier"}
2019-07-11T09:57:11.854243Z     info    Starting HTTP service   {"log_id": "0G_7I1i0000", "service": "httpd", "authentication": false}
2019-07-11T09:57:11.854254Z     info    opened HTTP access log  {"log_id": "0G_7I1i0000", "service": "httpd", "path": "stderr"}
2019-07-11T09:57:11.854354Z     info    Listening on HTTP       {"log_id": "0G_7I1i0000", "service": "httpd", "addr": "[::]:8086", "https": false}
2019-07-11T09:57:11.854377Z     info    Starting retention policy enforcement service   {"log_id": "0G_7I1i0000", "service": "retention", "check_interval": "30m"}
2019-07-11T09:57:11.854856Z     info    Storing statistics      {"log_id": "0G_7I1i0000", "service": "monitor", "db_instance": "_internal", "db_rp": "monitor", "interval": "10s"}
2019-07-11T09:57:11.855369Z     info    Listening for signals   {"log_id": "0G_7I1i0000"}
2019-07-11T09:57:11.855607Z     info    Sending usage statistics to usage.influxdata.com        {"log_id": "0G_7I1i0000"}
bash influxdb collectd
3个回答
2
投票

运行:打开服务器:打开tsdb存储:mkdir /var/lib/influxdb/data/_internal/_series:权限被拒绝

您的用户无权访问此路径。这就是造成问题的原因。通常 /var/lib 路径由 root 用户拥有。因此,如果您的用户具有 sudo 权限,则使用 sudo 执行启动命令应该可以解决此问题。

检查 influxDB 配置文件以根据您的需要操作 InfluxDB 的数据路径。配置文件路径通常是/etc/influxdb/influxdb.conf。

您的第二个问题是使用浏览器访问数据库。

检查 influxdb.conf 文件中的 http 配置:

[http]
  enabled = true
  bind-address = ":8086"
  auth-enabled = false
  log-enabled = true
  write-tracing = false
  pprof-enabled = false
  https-enabled = false
  https-certificate = "/etc/ssl/influxdb.pem"
  ### Use a separate private key location.
  # https-private-key = ""
  max-row-limit = 10000
  realm = "InfluxDB"
  • 确保您使用正确的端口。
  • 检查除 influxdb 之外当前没有其他进程持有该端口。
  • 确保没有防火墙阻止您访问该端口。

2
投票

将数据库作为服务运行(而不是从命令行)并检查状态:

sudo service influxdb start

sudo service influxdb status

或者如果您的操作系统使用的是

systemd
(CentOS 7+、RHEL 7+):

sudo systemctl start influxdb

sudo systemctl status influxdb

然后您可以尝试使用浏览器连接到端口 8086 上的本地主机:http://localhost:8086

查看配置:

influxd config

配置文件位于

/etc/influxdb/influxdb.conf

遵循文档:

https://docs.influxdata.com/influxdb/v1.7/administration/config/


0
投票

我的 influxdb 作为 root 启动得很好,并且该目录属于 influxdb,只是错误的 influxdb 用户。我从旧安装中复制了数据库文件,该安装有不同的 influxdb 用户

root@host# ls /var/lib/influxdb/data/_internal/_series
00  01  02  03  04  05  06  07
root@host# ls -alh /var/lib/influxdb/data/_internal/_series
total 40K
drwxr-xr-x 10 influxdb influxdb 4.0K May 21 10:45 .
drwx------  4      129      135 4.0K Sep 12  2021 ..
drwxr-xr-x  2 influxdb influxdb 4.0K May 21 10:45 00
drwxr-xr-x  2 influxdb influxdb 4.0K May 21 10:45 01
drwxr-xr-x  2 influxdb influxdb 4.0K May 21 10:45 02
drwxr-xr-x  2 influxdb influxdb 4.0K May 21 10:45 03
drwxr-xr-x  2 influxdb influxdb 4.0K May 21 10:45 04
drwxr-xr-x  2 influxdb influxdb 4.0K May 21 10:45 05
drwxr-xr-x  2 influxdb influxdb 4.0K May 21 10:45 06
drwxr-xr-x  2 influxdb influxdb 4.0K May 21 10:45 07
root@host# ls -alhd /var/lib/influxdb/data/_internal/_series
drwxr-xr-x 10 influxdb influxdb 4.0K May 21 10:45 /var/lib/influxdb/data/_internal/_series
root@host# ls -alhd /var/lib/influxdb/data/_internal/
drwx------ 4 129 135 4.0K Sep 12  2021 /var/lib/influxdb/data/_internal/
root@host# ls -alhd /var/lib/influxdb/data/
drwxr-xr-x 4 129 135 4.0K Sep 12  2021 /var/lib/influxdb/data/
root@host# ls -alhd /var/lib/influxdb/
drwxr-xr-x 5 129 135 4.0K Sep 12  2021 /var/lib/influxdb/

新用户 ID 应该是 116,而不是最后几个

ls -alh
中列出的 129。固定为:

   root@host# chown -R influxdb:influxdb /var/lib/influxdb/
   root@host# systemctl reset-failed influxdb
© www.soinside.com 2019 - 2024. All rights reserved.