目录
错误提示:
{
"error": {
"root_cause": [
{
"type": "circuit_breaking_exception",
"reason": "[parent] Data too large, data for [<http_request>] would be [1050823878/1002.1mb], which is larger than the limit of [1020054732/972.7mb], real usage: [1050822704/1002.1mb], new bytes reserved: [1174/1.1kb], usages [request=131072/128kb, fielddata=0/0b, in_flight_requests=1174/1.1kb, model_inference=0/0b, accounting=47838948/45.6mb]",
"bytes_wanted": 1050823878,
"bytes_limit": 1020054732,
"durability": "PERMANENT"
}
],
"type": "circuit_breaking_exception",
"reason": "[parent] Data too large, data for [<http_request>] would be [1050823878/1002.1mb], which is larger than the limit of [1020054732/972.7mb], real usage: [1050822704/1002.1mb], new bytes reserved: [1174/1.1kb], usages [request=131072/128kb, fielddata=0/0b, in_flight_requests=1174/1.1kb, model_inference=0/0b, accounting=47838948/45.6mb]",
"bytes_wanted": 1050823878,
"bytes_limit": 1020054732,
"durability": "PERMANENT"
},
"status": 429
}
问题原因
Elasticsearch 默认安装后设置的堆内存是 1 GB
解决办法:
添加全局变量:
sudo vi /etc/profile
结尾添加 export ES_HEAP_SIZE=10g
让变量生效:
source /etc/profile
记得重启elasticsuite服务
可能遇到的错误:
There are no commands defined in the "indexer" namespace.
查看日志 /var/log/elasticsearch/elasticsearch.log
Exception in thread "main" java.nio.file.FileSystemException: /tmp/elasticsearch-7255934071649956994: 设备上没有空间
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:388)
at java.base/java.nio.file.Files.createDirectory(Files.java:694)
at java.base/java.nio.file.TempFileHelper.create(TempFileHelper.java:135)
at java.base/java.nio.file.TempFileHelper.createTempDirectory(TempFileHelper.java:172)
at java.base/java.nio.file.Files.createTempDirectory(Files.java:1011)
at org.elasticsearch.tools.launchers.Launchers.createTempDirectory(Launchers.java:66)
at org.elasticsearch.tools.launchers.TempDirectory.main(TempDirectory.java:54)
没有磁盘空间导致如果是aws EC2 虚拟主机,请参考 amazon aws EC2 Linux 虚拟主机 磁盘扩容
如果是LVM文件系统的,请参考 ubuntu LVM disk 命令行给带有extended 扩展分区的磁盘分区扩容