下载elasticsearch安装包(kinaba/logstash版本应与es版本一致)
https://www.elastic.co/cn/downloads/past-releases/elasticsearch-6-2-2
最新版本:https://www.elastic.co/cn/downloads/elasticsearch
1、创建用户:es
adduser es
2、创建用户密码,需要输入两次
passwd es
3、将es文件夹权限赋给该用户
chown -R elasticsearch elasticsearch-6.0.0
4、切换至elasticsearch用户
su elasticsearch
5、启动ES
./elasticsearch -d
问题1
elasticsearch process is too low, increase to at least [65536]
解决方案:
1、用root用户修改/etc/security/limits.conf文件
2、在limits.conf加以下参数,注意:es为linux用户名
es hard nofile 65536
es soft nofile 65536
问题2
vm.max_map_count is too low,increase to at least [262144]
解决方案:
方法1:
1、执行命令:
sysctl -w vm.max_map_count=262144
2、查看结果:
sysctl -a|grep vm.max_map_count
方法2:
1、在/etc/sysctl.conf最后添加vm.max_map_count=262144
2、配置生效命令: sysctl -p
问题3
访问拒绝
解决方案:
在/usr/local/elasticsearch-6.2.2/config/elasticsearch.yml加以下参数
#启动拒绝访问,加以下参数
network.host: 0.0.0.0