没有合适的资源?快使用搜索试试~ 我知道了~
首页搭建ELK6.2.4环境(cent7.4),收集和分析Nginx日志,使用Filebeat,ES单点,Redis缓存。
1) 准备环境:在192.168.171.128上安装elasticsearch; 2) 在192.168.171.129上:安装filebeat和nginx,并使用filebeat收集nginx日志,将日志数据写入Redis; 3) 在192.168.171.130上:安装nginx和kibana,配置nginx使得kibana能够使用用户名和密码认证登录; 4) 在192.168.171.131上:安装Redis和logstash2,使用logstash2将日志数据从Redis读出,并写入elasticsearch; 5) 使用elk6.2.4版本,对收集到的nginx日志数据进行分析和绘图,实现单点elasticsearch和redis缓存。
资源详情
资源推荐
![](https://csdnimg.cn/release/download_crawler_static/88026260/bg7.jpg)
2)在 192.168.171.129 上:安装 logstash6.2.4+准备准备的 nginx 日志文件:(版本要和 es 版本相同,是日志搜集服务,搜集日志后可写入 es)
a)安装 filebeat(需要 jdk 环境)
[root@bogon ~]# mkdir /usr/local/java
[root@bogon ~]# rz
上传 jdk1.8 包
[root@bogon ~]# ls
jdk-8u144-linux-x64.tar.gz
[root@bogon ~]# tar -zxf jdk-8u144-linux-x64.tar.gz
[root@bogon ~]# ls
jdk1.8.0_144 jdk-8u144-linux-x64.tar.gz
[root@bogon ~]# mv jdk1.8.0_144/ /usr/local/java/
[root@bogon ~]# ls /usr/local/java/
jdk1.8.0_144
[root@bogon ~]# vim /etc/profile
#最后面添加:
JAVA_HOME=/usr/local/java/jdk1.8.0_144
CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
[root@bogon ~]# source /etc/profile
[root@bogon ~]# java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
安装 filebeat
[root@bogon ~]# rz
上传 filebeat 包
[root@bogon ~]# ls filebeat-6.2.2-x86_64.rpm
filebeat-6.2.2-x86_64.rpm
[root@bogon ~]# yum -y install filebeat-6.2.2-x86_64.rpm
[root@bogon ~]# cp /etc/filebeat/filebeat.yml /etc/filebeat/filebeat.yml.bak
[root@bogon ~]# vim /etc/filebeat/filebeat.yml #修改 filebeat 配置文件
###################### Filebeat Configuration Example #########################
# This file is an example configuration file highlighting only the most common
# options. The filebeat.reference.yml file from the same directory contains all the
# supported options with more comments. You can use it as a reference.
#
# You can find the full configuration reference here:
# https://www.elastic.co/guide/en/beats/filebeat/index.html
# For more available modules and options, please see the filebeat.reference.yml sample
# configuration file.
#=========================== Filebeat prospectors =============================
filebeat.prospectors:
![](https://csdnimg.cn/release/download_crawler_static/88026260/bg8.jpg)
# Each - is a prospector. Most options can be set at the prospector level, so
# you can use different prospectors for various configurations.
# Below are the prospector specific configurations.
# nginx 的 access 日志:
- type: log
enabled: true
paths:
- /usr/local/nginx/logs/access.log
fields:
log_source: nginx-access-log
output.redis:
hosts: ["192.168.171.131"]
port: 6379
password: "123"
key: "filebeat2"
db: 6
datatype: list
#注意:上面的 filebeat2 要和 logstash 中从 redis 里对应的 key 要要一致
#db: 6 随便从 redis 里选择了一个序号的数据库,也可 0,1,等等
# Exclude lines. A list of regular expressions to match. It drops the lines that are
# matching any regular expression from the list.
#exclude_lines: ['^DBG']
# Include lines. A list of regular expressions to match. It exports the lines that are
# matching any regular expression from the list.
#include_lines: ['^ERR', '^WARN']
# Exclude files. A list of regular expressions to match. Filebeat drops the files that
# are matching any regular expression from the list. By default, no files are dropped.
#exclude_files: ['.gz$']
# Optional additional fields. These fields can be freely picked
# to add additional information to the crawled log files for filtering
#fields:
# level: debug
# review: 1
### Multiline options
# Mutiline can be used for log messages spanning multiple lines. This is common
# for Java Stack Traces or C-Line Continuation
# The regexp Pattern that has to be matched. The example pattern matches all lines starting with [
#multiline.pattern: ^\[
# Defines if the pattern set under pattern should be negated or not. Default is false.
#multiline.negate: false
# Match can be set to "after" or "before". It is used to define if lines should be append to a pattern
# that was (not) matched before or after or as long as a pattern is not matched based on negate.
# Note: After is the equivalent to previous and before is the equivalent to to next in Logstash
#multiline.match: after
#============================= Filebeat modules ===============================
filebeat.config.modules:
# Glob pattern for configuration loading
path: ${path.config}/modules.d/*.yml
# Set to true to enable config reloading
reload.enabled: false
剩余37页未读,继续阅读
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://profile-avatar.csdnimg.cn/5afb47ace3b84322b38179046b09c692_qq_34953582.jpg!1)
运维实战课程
- 粉丝: 503
- 资源: 453
上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![](https://csdnimg.cn/release/wenkucmsfe/public/img/voice.245cc511.png)
会员权益专享
最新资源
- 京瓷TASKalfa系列维修手册:安全与操作指南
- 小波变换在视频压缩中的应用
- Microsoft OfficeXP详解:WordXP、ExcelXP和PowerPointXP
- 雀巢在线媒介投放策划:门户网站与广告效果分析
- 用友NC-V56供应链功能升级详解(84页)
- 计算机病毒与防御策略探索
- 企业网NAT技术实践:2022年部署互联网出口策略
- 软件测试面试必备:概念、原则与常见问题解析
- 2022年Windows IIS服务器内外网配置详解与Serv-U FTP服务器安装
- 中国联通:企业级ICT转型与创新实践
- C#图形图像编程深入解析:GDI+与多媒体应用
- Xilinx AXI Interconnect v2.1用户指南
- DIY编程电缆全攻略:接口类型与自制指南
- 电脑维护与硬盘数据恢复指南
- 计算机网络技术专业剖析:人才培养与改革
- 量化多因子指数增强策略:微观视角的实证分析
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![](https://csdnimg.cn/release/wenkucmsfe/public/img/green-success.6a4acb44.png)