elasticsearch 是不允许root用户直接运行的,需要创建新的用户,并且把elasticsearch 下所有的文件更改所属用户 1.从官网下载压缩包
https://www.elastic.co/cn/downloads/past-releases#elasticsearch
可根据需要的版本进行下载:
2.压缩包解压缩
解压软件包 tar zxvf elasticsearch-7.17.0-linux-x86_64.tar.gz3.创建用户,并授权:
elasticsearch 是不允许root用户直接运行的,需要创建新的用户
useradd es passwd es
chown -R es:es /opt/elasticsearch-7.17.04.修改elasticsearch配置文件
vim /opt/elasticsearch-7.17.0/config/elasticsearch.yml修改文件创建数量的大小
修改文件创建数量的大小: vim /etc/security/limits.conf
es soft nofile 65536 es hard nofile 65536设置文件的大小参数
vim /etc/security/limits.d/20-nproc.conf 末尾添加: es soft nofile 65536 es hard nofile 65536 * hard nproc 4096设置最大内存的分配
vim /etc/sysctl.conf 末尾添加: vm.max_map_count=655360重新加载配置
sysctl -p5.切换用户,启动服务
su es cd /opt/elasticsearch-7.17.0/bin/ ./elasticsearch
此刻正在运行中:
验证端口是否打开:
netstat -natp | grep 9200
curl命令验证: curl 'http://192.168.133.10:9200/?pretty'



