编辑

编辑

我有以下collectd实例在文件中运行influx.conf,一切都很好,但现在我想设置另一个与现有实例完全隔离的实例,我该怎么做?我可以在influx.conf文件中执行以下操作吗?

[[collectd]]
  enabled = true
  bind-address = "0.0.0.0:8096"
  database = "database-1"

[[collectd]]
  enabled = true
  bind-address = "0.0.0.0:8097"
  database = "database-2"

答案1

根据文档,您应该能够使用多个 CollectD 输入实例,就像上面指定的那样。

编辑

您的配置缺少security-level,可能还有更多选项:

run: invalid collectd config: Invalid security level. To generate a valid configuration file run `influxd config > influxdb.generated.conf`

这对我来说甚至有 3 个collectd配置如下的实例:

[[collectd]]
  enabled = true 
  bind-address = ":25826"
  database = "collectd-1"
  retention-policy = ""
  batch-size = 5000
  batch-pending = 10
  batch-timeout = "10s"
  read-buffer = 0
  typesdb = "/usr/share/collectd/types.db"
  security-level = "none"
  auth-file = "/etc/collectd/auth_file"
  parse-multivalue-plugin = "split"

[[collectd]]
  enabled = true
  bind-address = ":25827"
  database = "collectd-2"
  retention-policy = ""
  batch-size = 5000
  batch-pending = 10
  batch-timeout = "10s"
  read-buffer = 0
  typesdb = "/usr/share/collectd/types.db"
  security-level = "none"
  auth-file = "/etc/collectd/auth_file"
  parse-multivalue-plugin = "split"

[[collectd]]
  enabled = true
  bind-address = ":25828"
  database = "collectd-3"
  retention-policy = ""
  batch-size = 5000
  batch-pending = 10
  batch-timeout = "10s"
  read-buffer = 0
  typesdb = "/usr/share/collectd/types.db"
  security-level = "none"
  auth-file = "/etc/collectd/auth_file"
  parse-multivalue-plugin = "split"
$ docker run -p 8086:8086 -v $PWD/influxdb.conf:/etc/influxdb/influxdb.conf:ro -v $PWD/types.db:/usr/share/collectd/types.db influxdb -config /etc/influxdb/influxdb.conf
[...]
ts=2019-08-20T14:23:49.750638Z lvl=info msg="Starting collectd service" log_id=0HNrR~ZG000 service=collectd
ts=2019-08-20T14:23:49.750653Z lvl=info msg="Loading types from file" log_id=0HNrR~ZG000 service=collectd path=/usr/share/collectd/types.db
ts=2019-08-20T14:23:49.754041Z lvl=info msg="Listening on UDP" log_id=0HNrR~ZG000 service=collectd addr=[::]:25826
ts=2019-08-20T14:23:49.754405Z lvl=info msg="Starting collectd service" log_id=0HNrR~ZG000 service=collectd
ts=2019-08-20T14:23:49.754436Z lvl=info msg="Loading types from file" log_id=0HNrR~ZG000 service=collectd path=/usr/share/collectd/types.db
ts=2019-08-20T14:23:49.759837Z lvl=info msg="Listening on UDP" log_id=0HNrR~ZG000 service=collectd addr=[::]:25827
ts=2019-08-20T14:23:49.760296Z lvl=info msg="Starting collectd service" log_id=0HNrR~ZG000 service=collectd
ts=2019-08-20T14:23:49.760321Z lvl=info msg="Loading types from file" log_id=0HNrR~ZG000 service=collectd path=/usr/share/collectd/types.db
ts=2019-08-20T14:23:49.763582Z lvl=info msg="Listening on UDP" log_id=0HNrR~ZG000 service=collectd addr=[::]:25828
ts=2019-08-20T14:23:49.764035Z lvl=info msg="Sending usage statistics to usage.influxdata.com" log_id=0HNrR~ZG000
ts=2019-08-20T14:23:49.764091Z lvl=info msg="Listening for signals" log_id=0HNrR~ZG000

相关内容