我正在尝试将 JSON 文件 (263 MB) 添加到 elasticsearch。我已经使用 Kibana 为这个文件创建了一个映射,现在我正在尝试将它添加到 Elasticsearch 中。我在 PowerShell 中运行此命令。C:\Users\Khan> Invoke-RestMethod "http://localhost:9200/mysofindex/_bulk?pretty" -Method Post -ContentType 'application/x-ndjson' -InFile "output.json"
但这给了我一个错误。像这样:
Invoke-RestMethod : The remote server returned an error: (413) Request Entity Too Large.
At line:1 char:1
+ Invoke-RestMethod "http://localhost:9200/mysofindex/_bulk?pretty" -Me ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebE
xception
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
请告诉我如何解决这个问题?
最佳答案
您需要更改设置 http.max_content_length
在您的 elasticsearch.yml
,默认值是 100 mb,你需要在你的配置文件中添加你想要的值并重新启动你的 elasticsearch 节点。
关于json - 远程服务器返回错误 : (413) Request Entity Too Large. Elasticsearch 和 JSON,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58490210/