【问题标题】:Logstash output to Elasticsearch on AWS EC2Logstash 输出到 AWS EC2 上的 Elasticsearch
【发布时间】:2012-12-09 01:06:02
【问题描述】:

我在配置 logstash 以输出到 AWS EC2 上的 Elasticsearch 集群时遇到问题。

我正在使用 Logstash 版本 1.1.5 和 Elasticsearch 1.19.8。

这是我在 logstash 中的输出配置:

output {
  stdout { debug => true debug_format => "json"}
  elasticsearch {
    cluster => "logstash-searcher"
    node_name => "logstash-indexer"
  }
}

这是elasticsearch.yml中对应的配置

cluster.name: logstash-searcher
path.data: /usr/local/elasticsearch/data
path.work: /usr/local/elasticsearch/tmp
path.logs: /usr/local/elasticsearch/logs
path.plugins: /usr/local/elasticsearch/plugins
bootstrap.mlockall: true
cloud.aws.region: eu-west-1
cloud.aws.access_key: --
cloud.aws.secret_key: --
discovery.type: ec2
discovery.ec2.host_type: public_ip
discovery.ec2.groups: elasticsearch
gateway.type: s3
gateway.s3.bucket: es-logstash

transport.tcp.port: 9300-9400

我使用以下方式启动 logstash:

java -jar logstash-1.1.5-monolithic.jar agent -f shipper.conf

在启动一段时间后,我遇到了这些故障:

Failed to index an event, will retry {:exception=>org.elasticsearch.discovery.MasterNotDiscoveredException: waited for [1m], 

我的怀疑是,logstash 需要使用 cloud-aws 之类的东西,以便其弹性搜索客户端能够找到集群。有人有适用于 aws 的示例配置吗?

【问题讨论】:

    标签: amazon-web-services amazon-ec2 elasticsearch logstash


    【解决方案1】:

    问题是logstash 的嵌入式elasticsearch 实例正在使用其默认发现模式。由于elasticsearch集群配置了cloud-aws,logstash的嵌入式elasticsearch也需要配置。

    为此,您必须将 elasticsearch.yml 配置文件添加到 logstash 的工作目录。您还需要通过将 cloud-aws 插件添加到类路径来提供它。

    java -cp logstash-1.1.7-monolithic.jar:cloud-aws/* logstash.runner agent -f shipper.conf
    

    使用此配置,我设法让 logstash 输出到我的 elasticsearch 集群。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-09-28
    • 2017-09-06
    • 2021-07-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-30
    • 2013-05-01
    相关资源
    最近更新 更多