[英]How to import data from PostgreSQL to elastic search?
I have a million rows in a table that I'd like to import to elastic search? 我有一百万行表,我想导入弹性搜索? How to do that?
怎么做?
You can use logstash for this where a sample config file to ship data from POSTGRES to elasticsearch would like below. 您可以使用logstash,其中一个示例配置文件将数据从POSTGRES发送到elasticsearch。 You can follow this link for a detailed tutorial
您可以点击此链接获取详细教程
input {
jdbc {
jdbc_connection_string => "jdbc:postgresql://:5432/"
jdbc_user => "<my-username>"
jdbc_password => "<my-password>"
jdbc_driver_library => "///postgresql-42.1.4.jar"
jdbc_driver_class => "org.postgresql.Driver"
statement => "SELECT * from contact"
}
}
output {
elasticsearch {
index => "contact"
hosts => ["localhost:9200"]
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.