创建用户:
useradd es
授权:
chown -R es:es /home/elasticsearch/elasticsearch-7.10.2
切换到es 用户进入bin启动elasticsearch
su es
cd /home/elasticsearch/elasticsearch-7.10.2/bin
./elasticsearch
es后台启动
./elasticsearch -d
启用遇到的问题
max virtual memory areas vm.max_map_count [65530] is too low, increase t o at least [262144]
max file descriptors [4096] for elasticsearch process is too low, increa se to at least [65535]
找到文件 /etc/security/limits.conf,编辑,在文件的最后追加如下配置:
es soft nofile 65535
es hard nofile 65537
soft nofile表示软限制,hard nofile表示硬限制,
上面两行语句表示,es用户的软限制为65535,硬限制为65537,