elasticsearch,logstash,Amazon Web Services,Amazon Ec2,elasticsearch,Logstash" /> elasticsearch,logstash,Amazon Web Services,Amazon Ec2,elasticsearch,Logstash" />

Amazon web services AWS EC2上Elasticsearch的日志存储输出

Amazon web services AWS EC2上Elasticsearch的日志存储输出,amazon-web-services,amazon-ec2,elasticsearch,logstash,Amazon Web Services,Amazon Ec2,elasticsearch,Logstash,我在配置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 => "l

我在配置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
我使用以下命令启动日志存储:

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需要使用类似CloudAWS的东西,以便其elasticsearch客户端能够找到集群。有人有在aws上工作的示例配置吗?

问题是logstash的嵌入式elasticsearch实例使用了默认的发现模式。由于elasticsearch集群配置了logstash的嵌入式elasticsearch,因此也需要进行配置

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

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

使用此配置,我成功地将logstash输出到我的elasticsearch集群。

对于那些想知道从哪里下载cloud aws插件的人,url如下所示: