rpm 安装Logstash
下载地址:https://www.elastic.co/cn/downloads/past-releases#logstash
安装:rpm -ivh logstash-7.8.1.rpm
配置:vi /etc/logstash/logstash-sample.conf
复制到配置文件下下面:cp /etc/logstash/logstash-sample.conf /etc/logstash/conf.d/logstash-sample.conf
启动:systemctl start logstash
启动失败查看日志:could not find java; set JAVA_HOME or ensure java is in PATH
使用java -version发现是配置好的,找到安装目录下/bin/logstash.lib.sh文件,并写入以下内容就可以了:
JAVA_HOME=/usr/local/java/jdk1.8.0_231
停止:systemctl stop logstash
重启:systemctl restart logstash
开机自启动:systemctl enable logstash
开机不启动:systemctl disable logstash