一、异常:
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
二、解决:
执行命令:
//查询当前vm.max_map_count的值
[esroot@iz2ze4jq06yojn4f8bm98kz elasticsearch-7.5.1]$ sysctl -a|grep vm.max_map_count
sysctl: permission denied on key 'fs.protected_hardlinks'
sysctl: permission denied on key 'fs.protected_symlinks'
sysctl: permission denied on key 'kernel.cad_pid'
sysctl: permission denied on key 'kernel.usermodehelper.bset'
sysctl: permission denied on key 'kernel.usermodehelper.inheritable'
sysctl: permission denied on key 'net.ipv4.tcp_fastopen_key'
vm.max_map_count = 65530
//赋新值
[esroot@iz2ze4jq06yojn4f8bm98kz elasticsearch-7.5.1]$ sysctl -w vm.max_map_count=262144
sysctl: permission denied on key 'vm.max_map_count'
//切换到root用户
[esroot@iz2ze4jq06yojn4f8bm98kz elasticsearch-7.5.1]$ su root
//设置新的值
[root@iz2ze4jq06yojn4f8bm98kz elasticsearch-7.5.1]# sysctl -w vm.max_map_count=262144
vm.max_map_count = 262144
//查询是否设置成功
[root@iz2ze4jq06yojn4f8bm98kz elasticsearch-7.5.1]# sysctl -a|grep vm.max_map_count
vm.max_map_count = 262144
在 /etc/sysctl.conf文件最后添加一行:vm.max_map_count=262144(永久修改)