Docker 部署 logstash
需要准备的四个文件:
1、DockerFile
FROM docker.elastic.co/logstash/logstash:7.1.0 #自定义输入、输出流 RUN rm -f /usr/share/logstash/pipeline/logstash.conf ADD config/pipeline/ /usr/share/logstash/pipeline/ #测试暂时不改变setting文件 #ADD config/setting/ /usr/share/logstash/config/
2、build_image.sh
#!/bin/bash VER="5.5.2" docker build -t "dev.docker.mcc.cn:5000/logstash:${VER}" . docker push dev.docker.mcc.cn:5000/logstash:${VER}
3、start.sh
#!/bin/bash docker run -d -v /var/log/glog/:/var/log/glog/ dev.docker.mcc.cn:5000/logstash:7.1.0
4、stdout.conf
input { file { path => "/var/log/glog/*" type => "file_2_console" start_position => "beginning" } } output { if [type] == "file_2_console" { stdout { codec => rubydebug } } }
目录结构:stdout.conf 放在 piprline 下
运行:
1、从docker 上拉去logstash的镜像
命令:docker pull docker.elastic.co/logstash/logstash:5.5
2、运行,执行命令 sh ./start.sh
3、执行命令 : docker ps
查看logstash 是否运行起来了!
参考:[ElasticStack系列]docker部署logstash
原文链接:https://blog.csdn.net/qq_28289405/article/details/91789228?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522171836884016800178595162%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=171836884016800178595162&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~times_rank-14-91789228-null-null.nonecase&utm_term=docker%E9%83%A8%E7%BD%B2
© 版权声明
声明📢本站内容均来自互联网,归原创作者所有,如有侵权必删除。
本站文章皆由CC-4.0协议发布,如无来源则为原创,转载请注明出处。
THE END