我有两个正在运行的电报守护程序。
守护进程 1:输入 = kafka 主题:sample_topic,输出 = InfluxDb:DB = telegraf,MEASUREMENT = KI1
守护进程 2:输入 = kafka 主题:sample_topic2,输出 = InfluxDb:DB = telegraf,MEASUREMENT = KI2
这两个守护进程读取不同的 kafka 主题并写入 InfluxDB 数据库“telegraf”中的两个不同测量值
我观察到的是测量 KI1 和 KI2 不是同时创建的。仅创建一个测量值。当我杀死已经创建了度量的守护进程时,另一个度量会由另一个守护进程在数据库中创建。
InfluxDb 是否允许同时写入不同的测量值?
我什至通过写入两个不同的 InfluxDb 数据库 telegraf 和 telegraf2 来尝试相同的操作。我观察到了同样的行为。
另外,是否有可能只使用一个守护程序来完成所有这些工作?在哪里我有多个输入插件来读取不同的 kafka 主题和不同的输出插件来编写需要的地方。
守护进程 1:
[tags]
topic = "sample_topic"
# OUTPUTS
[outputs]
[outputs.influxdb]
# The full HTTP endpoint URL for your InfluxDB instance
url = "http://localhost:8086" # EDIT THIS LINE
# The target database for metrics. This database must already exist
database = "telegraf" # required.
skip_database_creation = true
database_tag = "KI1"
#INPUTS
# Read metrics from Kafka topic(s)
[[inputs.kafka_consumer_legacy]]
name_override = "KI1"
## topic(s) to consume
topics = ["sample_topic"]
## an array of Zookeeper connection strings
zookeeper_peers = ["localhost:2181"]
## Zookeeper Chroot
zookeeper_chroot = ""
## the name of the consumer group
consumer_group = "sample"
## Offset (must be either "oldest" or "newest")
offset = "oldest"
## Data format to consume.
## Each data format has its own unique set of configuration options, read
## more about them here:
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
data_format = "value"
data_type = "string"
## Maximum length of a message to consume, in bytes (default 0/unlimited);
## larger messages are dropped
max_message_len = 65536
守护进程 2:
[tags]
topic = "sample_topic2"
# OUTPUTS
[outputs]
[outputs.influxdb]
# The full HTTP endpoint URL for your InfluxDB instance
url = "http://localhost:8086" # EDIT THIS LINE
# The target database for metrics. This database must already exist
database = "telegraf" # required.
skip_database_creation = true
database_tag = "KI2"
#INPUTS
# Read metrics from Kafka topic(s)
[[inputs.kafka_consumer_legacy]]
name_override = "KI2"
## topic(s) to consume
topics = ["sample_topic2"]
## an array of Zookeeper connection strings
zookeeper_peers = ["localhost:2181"]
## Zookeeper Chroot
zookeeper_chroot = ""
## the name of the consumer group
consumer_group = "sample"
## Offset (must be either "oldest" or "newest")
offset = "oldest"
## Data format to consume.
## Each data format has its own unique set of configuration options, read
## more about them here:
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
data_format = "value"
data_type = "string"
## Maximum length of a message to consume, in bytes (default 0/unlimited);
## larger messages are dropped
max_message_len = 65536