今天,我开始从事弹性搜索,在我的上一个项目中,我在Solr中完成了搜索,我从mysql导入数据,这非常简单。
现在,我必须在弹性搜索中做同样的工作,并且成功地完成了我已经开始按照"https://github.com/jprante/elasticsearch-jdbc#quick-links"工作的设置,但是得到了错误。
java.lang.IllegalStateException:从不支持的版本接收到的消息: 2.0.0最低兼容版本为: 5.0.0
我正在使用弹性搜索版本5.0.0和使用的"wget http://xbib.org/repository/org/xbib/elasticsearch/importer/elasticsearch-jdbc/2.3.4.0/elasticsearch-jdbc-2.3.4.0-dist.zip",这是最大的可用版本。
请对此提出建议。
发布于 2016-11-21 10:11:37
您可以在您的jdbc配置中使用logstash插件,以便将数据上传到您的索引中,然后根据需要添加一个调度程序,以确保您可以继续更新它。
您的logstash配置可能如下所示:
input {
jdbc {
jdbc_driver_library => "/mysql-connector-java-5.1.39-bin.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://localhost:3306/database_name"
jdbc_user => "root"
jdbc_password => "password"
schedule => "* * * * *"
statement => "select * from table1"
type => "table1"
}
}
output {
elasticsearch {
index => "testdb"
document_type => "%{type}" # <- use the type from each input
hosts => "localhost:9200"
}
}https://stackoverflow.com/questions/40717266
复制相似问题