千家信息网

ubuntu14 安装 logstash5.3.1

发表于:2025-01-23 作者:千家信息网编辑
千家信息网最后更新 2025年01月23日,查看版本lsb_release -aNo LSB modules are available.Distributor ID: UbuntuDescription: Ubuntu 14.04.5 LTS
千家信息网最后更新 2025年01月23日ubuntu14 安装 logstash5.3.1

查看版本

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty

卸载deb版本的logstash

cp /etc/logstash/conf.d/*.conf    /bakservice stop logstash  dpkg -P logstashrm /usr/share/logstashrm /etc/logstashrm /var/lib/logstashrm /var/log/logstash

下载对应版本的logstash

wget https://artifacts.elastic.co/downloads/logstash/logstash-5.3.1.zipunzip logstash-5.3.1.zip -d /data/software/ln -sv logstash-5.3.1 logstashcd logstash

编辑配置文件

vim config/logstash.yml pipeline.workers: 8pipeline.output.workers: 8pipeline.batch.size: 10000pipeline.batch.delay: 10vim config/jvm.options -Xms2g-Xmx2g

创建配置文件

mkdir conf.dtouch conf.d/index.conf   # 业务配置文件mkdir data/data{1,2,3,4,5}mkdir logs/log{1,2,3,4,5}useradd elk chown -R elk.elk data/chown -R elk.elk logs/

安装supervisor

pip install supervisor
mkdir /etc/supervisor

创建主配置文件

cat >>  supervisord.conf  <

创建相关路径

cd /etc/supervisormkdir  conf.d/mkdir /var/log/supervisormkdir /data/logs/supervisord/cd conf.d/

创建子配置文件

cat >> logstash2.conf  <

启动和运行

supervisord -c /etc/supervisor/supervisord.conf supervisorctl -c /etc/supervisor/supervisord.confsupervisor 更改配置文件,必须要重启整个supervisor进场才能生效supervisorctl -c /etc/supervisor/supervisord.conf shutdown supervisord -c /etc/supervisor/supervisord.conf 
0