InfluxDB 未启动:8086 绑定地址已在使用中

InfluxDB not starting: 8086 bind address already in use

我有一个 InfluxDB 版本 1.8.9,但我无法启动它。 在此示例中,我以 root 身份登录。

netstat -lptn

为我提供了一系列服务,其中 none 似乎可以收听 8086。(还有其他服务 运行ning,如 grafana 或 MySQL,似乎工作正常)

为了进一步确认 8086 上没有任何内容,我听了相关的 Issue run: open server: open service: listen tcp :8086: bind: address already in use on starting influxdb 和 运行

netstat -a | grep 8086

没有结果。

我在 /etc/influxdb/influxdb.conf 上的配置文件如下所示:

reporting-disabled = false
bind-address = "127.0.0.1:8086"

[meta]
  #dir = "/root/.influxdb/meta"
  dir = "/var/lib/influxdb/meta"
  retention-autocreate = true
  logging-enabled = true

[data]
  dir = "/var/lib/influxdb/data"
  index-version = "inmem"
  wal-dir = "/var/lib/influxdb/wal"
  wal-fsync-delay = "0s"
  validate-keys = false
  strict-error-handling = false
  query-log-enabled = true
  cache-max-memory-size = 1073741824
  cache-snapshot-memory-size = 26214400
  cache-snapshot-write-cold-duration = "10m0s"
  compact-full-write-cold-duration = "4h0m0s"
  compact-throughput = 50331648
  compact-throughput-burst = 50331648
  max-series-per-database = 1000000
  max-values-per-tag = 100000
  max-concurrent-compactions = 0
  max-index-log-file-size = 1048576
  series-id-set-cache-size = 100
  series-file-max-concurrent-snapshot-compactions = 0
  trace-logging-enabled = false
  tsm-use-madv-willneed = false
  ...
  [http]
  enabled = true
  bind-address = ":8086"
  auth-enabled = false
  log-enabled = true
  suppress-write-log = false
  write-tracing = false
  flux-enabled = false
  flux-log-enabled = false
  pprof-enabled = true
  pprof-auth-enabled = false
  debug-pprof-enabled = false
  ping-auth-enabled = false
  prom-read-auth-enabled = false
  https-enabled = false
  https-certificate = "/etc/ssl/influxdb.pem"
  https-private-key = ""
  max-row-limit = 0
  max-connection-limit = 0
  shared-secret = ""
  realm = "InfluxDB"
  unix-socket-enabled = false
  unix-socket-permissions = "0777"
  bind-socket = "/var/run/influxdb.sock"
  max-body-size = 25000000
  access-log-path = ""
  max-concurrent-write-limit = 0
  max-enqueued-write-limit = 0
  enqueued-write-timeout = 30000000000
  ...

所以我尝试启动我的数据库:

service influxdb start

这给了我

ob for influxdb.service failed because a timeout was exceeded. See "systemctl status influxdb.service" and "journalctl -xe" for details.

systemctl 状态的结果influxdb.service

● influxdb.service - InfluxDB is an open-source, distributed, time series database
   Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enabled)
   Active: activating (start) since Tue 2021-09-21 18:37:12 CEST; 1min 7s ago
     Docs: https://docs.influxdata.com/influxdb/
 Main PID: 32016 (code=exited, status=1/FAILURE); Control PID: 5874 (influxd-systemd)
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/influxdb.service
           ├─5874 /bin/bash -e /usr/lib/influxdb/scripts/influxd-systemd-start.sh
           └─5965 sleep 10

Sep 21 18:37:23 s22227708 influxd-systemd-start.sh[5874]: ts=2021-09-21T16:37:23.515897Z lvl=info msg="Registered diagnostics client" log_id=0WjJLI7l000 service=monitor name=runtime
Sep 21 18:37:23 s22227708 influxd-systemd-start.sh[5874]: ts=2021-09-21T16:37:23.515907Z lvl=info msg="Registered diagnostics client" log_id=0WjJLI7l000 service=monitor name=network
Sep 21 18:37:23 s22227708 influxd-systemd-start.sh[5874]: ts=2021-09-21T16:37:23.515923Z lvl=info msg="Registered diagnostics client" log_id=0WjJLI7l000 service=monitor name=system
Sep 21 18:37:23 s22227708 influxd-systemd-start.sh[5874]: ts=2021-09-21T16:37:23.515977Z lvl=info msg="Starting precreation service" log_id=0WjJLI7l000 service=shard-precreation check_interval=10m advanc
Sep 21 18:37:23 s22227708 influxd-systemd-start.sh[5874]: ts=2021-09-21T16:37:23.515995Z lvl=info msg="Starting snapshot service" log_id=0WjJLI7l000 service=snapshot
Sep 21 18:37:23 s22227708 influxd-systemd-start.sh[5874]: ts=2021-09-21T16:37:23.516015Z lvl=info msg="Starting continuous query service" log_id=0WjJLI7l000 service=continuous_querier
Sep 21 18:37:23 s22227708 influxd-systemd-start.sh[5874]: ts=2021-09-21T16:37:23.516011Z lvl=info msg="Storing statistics" log_id=0WjJLI7l000 service=monitor db_instance=_internal db_rp=monitor interval=
Sep 21 18:37:23 s22227708 influxd-systemd-start.sh[5874]: ts=2021-09-21T16:37:23.516037Z lvl=info msg="Starting HTTP service" log_id=0WjJLI7l000 service=httpd authentication=false
Sep 21 18:37:23 s22227708 influxd-systemd-start.sh[5874]: ts=2021-09-21T16:37:23.516052Z lvl=info msg="opened HTTP access log" log_id=0WjJLI7l000 service=httpd path=stderr
Sep 21 18:37:23 s22227708 influxd-systemd-start.sh[5874]: run: open server: open service: listen tcp :8086: bind: address already in use

我不太明白我哪里做错了,因为我在配置文件中配置了:8086。你能帮帮我吗?

这似乎是配置文件中的拼写错误。 如 the documentation 中所述,配置文件应包含 http-bind-address 而不是 bind-address。以及第一个配置锁定的端口。

文件 /etc/influxdb/influxdb.conf 的前几行应如下所示:

reporting-disabled = false
http-bind-address = "127.0.0.1:8086"

建议的方法是:

  1. bind-addresshttp-bind-address
  2. 将端口从默认 8086 更改为已知可用端口
  3. (可选)返回默认端口。

来自您的配置:

  reporting-disabled = false
  bind-address = "127.0.0.1:8086"
  ...
  [http]
  enabled = true
  bind-address = ":8086"

您的 'native' 服务和 'http' 服务都配置为使用相同的端口 8086。这不起作用,您可能想将 'native' 端口更改回默认值8088.