我有2000万行来自postgresql的sql转储文件。我想将其移动到elasticsearch,所以我使用logstash,并使用以下语句:statement => "select * from students"
。但是我总是得到outOfMemory错误。我有16克内存,我将logstash和elasticsearch XMx更改为12克,但此错误尚未发生。我认为这是因为select语句。它对内存造成巨大负担。我该怎么办 ?感谢您的帮助。
最佳答案
您需要做的就是配置这些参数
这是它的链接-> https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#_dealing_with_large_result_sets
此外,对SQL查询的分页结果使用以下参数
这将在内部使用sql limit属性。