准备工作
elasticsearch-7.XX需要更高版本的java(11),而提高es的版本也需要提高filebeat的版本!我这里使用的是jdk8,所以下载的elasticsearch-5.6.0
下载地址:https://www.elastic.co/cn/downloads/elasticsearch地址
一、安装elasticearch
1. 下载完成elasticsearch之后时行解压缩;
Linux解压命令:
tar -zxvf 压缩文件名.tar.gz
2. 创建用户组和用户
由于elasticsearch启动不可以用root用户启用,所以这里需要创建用户和组,命令如下:
groupadd esgroup
useradd esuser -g esgroup -p espassword
3. 修改配置
设置 network.host: 0.0.0.0
http.port: 9200
4. 启动
切换用户并启动
su esuser
./bin/elasticsearch
su esuser
./bin/elasticsearch -d 启动在后台运行
5.启动过程中的问题
此部分引用:https://blog.youkuaiyun.com/cookzrk/article/details/80179006解决方案:max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
切换到root用户
ulimit -Hn 查看硬限制
vim /etc/security/limits.conf
添加下面设置 hadoop是用户
esuser hard nofile 65536
esuser soft nofile 65536
退出用户重新登录,使配置生效
重新 ulimit -Hn 查看硬限制 会发现数值有4096改成65535
vi /etc/sysctl.conf
添加下面配置:
vm.max_map_count=655360
并执行命令:
sysctl -p
6.启动成功后: