Logstash:Kafka 输出插件 - Bootstrap_Server 的问题
Logstash: Kafka Output Plugin - Issues with Bootstrap_Server
我正在尝试在 logstash 中使用 logstash-output-kafka:
Logstash 配置文件
input {
stdin {}
}
output {
kafka {
topic_id => "mytopic"
bootstrap_server => "[Kafka Hostname]:9092"
}
}
但是,在执行此配置时,出现此错误:
[ERROR][logstash.agent ] Failed to execute action
{:action=>LogStash::PipelineAction::Create/pipeline_id:main,
:exception=>"LogStash::ConfigurationError", :message=>"Something is wrong
with your configuration."
我试图将“[Kafka Hostname]:9092”更改为 "localhost:9092",但也无法连接到 kafka。只有当我删除 bootstrap_server 配置(然后默认为 localhost:9092)时,kafka 连接似乎已建立。
是不是kafka输出插件的bootstrap_server配置有问题?我正在使用 logstash v6.4.1,logstash-output-kafka v7.1.3
我认为您的配置有误。您需要定义 bootstrap_servers
而不是 bootstrap_server
。
input {
stdin {}
}
output {
kafka {
topic_id => "mytopic"
bootstrap_servers => "your_Kafka_host:9092"
}
}
bootstrap_servers
Value type is string
Default value is "localhost:9092"
This is for bootstrapping and the producer will only
use it for getting metadata (topics, partitions and replicas). The
socket connections for sending the actual data will be established
based on the broker information returned in the metadata. The format
is host1:port1,host2:port2, and the list can be a subset of brokers or
a VIP pointing to a subset of brokers.
我正在尝试在 logstash 中使用 logstash-output-kafka:
Logstash 配置文件
input {
stdin {}
}
output {
kafka {
topic_id => "mytopic"
bootstrap_server => "[Kafka Hostname]:9092"
}
}
但是,在执行此配置时,出现此错误:
[ERROR][logstash.agent ] Failed to execute action
{:action=>LogStash::PipelineAction::Create/pipeline_id:main,
:exception=>"LogStash::ConfigurationError", :message=>"Something is wrong
with your configuration."
我试图将“[Kafka Hostname]:9092”更改为 "localhost:9092",但也无法连接到 kafka。只有当我删除 bootstrap_server 配置(然后默认为 localhost:9092)时,kafka 连接似乎已建立。
是不是kafka输出插件的bootstrap_server配置有问题?我正在使用 logstash v6.4.1,logstash-output-kafka v7.1.3
我认为您的配置有误。您需要定义 bootstrap_servers
而不是 bootstrap_server
。
input {
stdin {}
}
output {
kafka {
topic_id => "mytopic"
bootstrap_servers => "your_Kafka_host:9092"
}
}
bootstrap_servers
Value type is string
Default value is "localhost:9092"
This is for bootstrapping and the producer will only use it for getting metadata (topics, partitions and replicas). The socket connections for sending the actual data will be established based on the broker information returned in the metadata. The format is host1:port1,host2:port2, and the list can be a subset of brokers or a VIP pointing to a subset of brokers.