json - 远程服务器返回错误 : (413) Request Entity Too Large. Elasticsearch 和 JSON

标签 json powershell elasticsearch kibana

我正在尝试将 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/

相关文章:

javascript - 将 JSON 对象数组映射到字符串

Android:将 Parcelable 转换为 JSON

jquery - 我如何设置我的 json 文件正在打印到屏幕上的文本我想隐藏文本

docker - 如何在单独的外壳中打开docker-compose服务

python - Elastic Search Function_Score Query with Query_String

Elasticsearch 端口

json - 如何访问纯dart包中的 Assets 文件?

excel - 当 .visible=$false 时,Powershell excel 刷新失败并显示 "Call Was Rejected by Callee"

.net - 如何在 Powershell 中访问 .NET 类?

powershell - 发布管理 vNext 组件部署瓶颈