#内存锁定 config下
vim elasticsearch.yml
bootstrap.memory_lock: true
#bin下
#最大内存占用
vim elasticsearch
export ES_HEAP_SIZE=6g

#以下配置esuser是运行es的用户
vim /etc/security/limits.conf 
esuser soft memlock unlimited
esuser hard memlock unlimited

vim /etc/sysctl.conf 
vm.swappiness=0