1.安装解压好后添加用户
groupadd elasticsearch
useradd elasticsearch -g elasticsearch
2.修改配置文件
elasticsearch/conf/elasticsearch.yml/ 里
network.host:0.0.0.0
http.port:9200
http.cors.enabled: true
http.cors.allow-origin: "*"
3.在/etc/security/limits.conf最后添加
* soft nofile 65536
* hard nofile 131072
4.切换到root用户,在/etc/sysctl.conf最后添加
vm.max_map_count=655360
再在外面执行命令 sysctl -p
5.启动es: 切换到elasticsearch用户,在/elasticsearch/bin 执行:
./elasticsearch
./elasticsearch -d
6.验证是否启动成功:
curl http://localhost:9200
7.