用于导入mysql数据的Logstash插件会出现manti核心错误

时间:2016-03-23 09:51:49

标签: mysql jdbc elasticsearch logstash

我在centos 7实例上安装了elasticsearch 2.2.0和logstash 2.1。

在我的logstash abc.conf文件中有以下内容:

input {
  jdbc {
    jdbc_driver_library => "/etc/elasticsearch/elasticsearch-jdbc-2.2.0.0/lib/mysql-connector-java-5.1.33.jar"
    jdbc_driver_class => "com.mysql.jdbc.Driver"
    jdbc_connection_string => "jdbc:mysql://xxx.xxx.xx:3306/mysql"
    jdbc_user => "xxxx"
    jdbc_password => "blahblah"
    parameters => { "status" => "published" }
    #schedule => "0 * * * * *"
    statement => "SELECT field1, field2 from tbl_orders where status = :status"
  }
}
output {
    elasticsearch {
        index => "abc"
        document_type => "tbl_orders"
        document_id => "%{field1}"
        hosts => "localhost:9200"
    }
}

当我运行此文件导入mysql数据时,我收到以下错误:

Connection refused {:class=>"Manticore::SocketException", :level=>:error}
Logstash startup completed
Attempted to send a bulk request to Elasticsearch configured at '["http://localhost:9200/"]', but Elasticsearch appears to be unreachable or down!

在运行此文件之前,我检查了与elasticsearch的连接,结果很好。我哪里错了。有什么建议吗?

使用以下命令安装logsttash:

rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch

Add logstash.repo in /etc/yum.repos.d/

[logstash-2.1]
name=Logstash repository for 2.1.x packages
baseurl=http://packages.elastic.co/logstash/2.1/centos
gpgcheck=1
gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1

yum install logstash

manti核心问题Upgrading plugins with manticore throws an error and sometimes corrupts installation #4818是否仍会受到影响?

0 个答案:

没有答案