一..充分利用内存资源, 单机不超过32G,es 一般设置为系统内存的50%.或者2/3.
关闭swap
1.sudo swapoff -a
/etc/fstab 注释掉 swap
2.减少内核交互的倾向
/etc/sysctl.conf vm.swappiness = 1
3. 设置
config/elasticsearch.yml
bootstrap.memory_lock: true
验证:
GET _nodes?filter_path=**.mlockall
二.设置ulimut 文件数
/etc/security/limits.conf
elasticsearch - nofile 65536
验证:
curl -X GET "localhost:9200/_nodes/stats/process?filter_path=**.max_file_descriptors"
三.设置虚拟内存
sysctl -w vm.max_map_count=262144
永久添加加到sysctl.conf文件.
四.设置线程数 4096+
ulimit -u 4096