我需要将大型PDF(120 MB)存储到弹性搜索中。
我通过cygwin运行以下脚本:
$ curl -XPUT 'localhost:9200/samplepdfs/' -d '{
"settings": {
"index": {
"number_of_ shards": 1,
"number_of_replicas": 0
}
}
}'
{
"acknowledged": true
}
$ coded=`cat sample.pdf | perl -MMIME::Base64 -ne 'print encode_base64($_)'`
$ json="{\"file\":\"${coded}\"}"
$ echo $json > json.file
$ curl -XPOST 'localhost:9200/samplepdfs/attachment/1' -d @json.file
并且服务器抛出out of memory Exception
。
在 org.elasticsearch.common.netty.handler.codec.http.HttpChunkAggregator .appendToCumulation(HttpChunkAggregator.java:208)
请建议解决方案/配置更改以解决问题。
答案 0 :(得分:3)
错误很容易理解,你在小机器上做的很大。所以,通过配置我猜你有一台机器分配512 MB的RAM或2Gigs。
2 GB的RAM不足以用于您的文档。
那么,解决方案是什么?
参考文献
希望这能解决问题,谢谢