2,ELK安装--ES安装(单机版)
2018-07-18 本文已影响139人
ROCK_杰哥
准备工作
1,安装包地址:https://pan.baidu.com/s/1z6lDEYfBwLVHSW3jZcTTIQ
2,安装jdk1.8,参考:https://www.jianshu.com/p/689e8937613f
将下载的jdk上传到服务器并解压
tar -zxvf jdk-8u161-linux-x64.tar.gz -C app/
配置环境变量
sudo vi /etc/profile
在末尾加上
export JAVA_HOME=/home/songlj/app/jdk1.8.0_161
export PATH=$PATH:$JAVA_HOME/bin
生效:source /etc/profile
测试是否安装成功java -version
安装ES
1,解压 tar -zxvf elasticsearch-5.6.4.tar.gz
2,修改配置文件,让外网能访问
cd elasticsearch-5.6.4
cd config/
vi elasticsearch.yml
network.host: 0.0.0.0
3,启动ES,不要用root启动
进入到bin目录下执行
./elasticsearch
4,会出现的错误信息,及修改办法:
for elasticsearch process is too low, increase to at least [65536]
修改办法,末尾添加:
vi /etc/security/limits.conf
注意:请将songlj修改为你对应的登陆的用户名
songlj hard nofile 65536
songlj soft nofile 65536
[1024] for user [apps] is too low, increase to at least [2048]
修改办法:vi /etc/security/limits.d/20-nproc.conf
将
* soft nproc 1024
#修改为
* soft nproc 2048
nt [65530] likely too low, increase to at least [262144]
修改办法:vi /etc/sysctl.conf
添加下面配置:
vm.max_map_count=655360
修改完sysctl.conf 之后并执行命令:
sysctl -p
5,再次启动,不要用root启动
进入到bin目录下执行
./elasticsearch
6,如果外网访问不了,关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
效果:
启动成功