运维八一 运维八一
首页
运维杂记
编程浅尝
周积跬步
专栏
生活
关于
收藏
  • 分类
  • 标签
  • 归档
Source (opens new window)

运维八一

运维,运维!
首页
运维杂记
编程浅尝
周积跬步
专栏
生活
关于
收藏
  • 分类
  • 标签
  • 归档
Source (opens new window)
  • 操作系统

  • 域名解析

  • 公有云

  • CI&CD

  • 数据库

  • 负载均衡&反向代理

  • 存储系统

  • 容器&容器编排

  • 批量管理

  • 邮件系统

  • 监控系统

  • Web服务

  • 虚拟化

  • 防火墙

  • 压测

  • 文件同步

  • 私有云

  • 日志系统

    • ELK
    • ELK-filebeat安装说明
    • ELK安装问题
    • loki问题
  • 代码仓库&版本管理

  • 安全审计

  • 远程拨号

  • 大数据

  • 统一认证

  • 消息队列

  • Apollo

  • 运维杂记
  • 日志系统
lyndon
2022-06-11

ELK-filebeat安装说明

# 1.软件安装

安装包:filebeat-6.3.2-linux-x86_64-nginx-prode.tar.gz (opens new window)

# 2.nginx 日志修改

第一步 注释以前的日志,添加json格式的日志

vi /usr/local/nginx/conf/nginx.conf  【注释以前的日志,添加json格式的日志】
#log_format main
#'$remote_user [$time_local] $http_x_Forwarded_for $remote_addr $request '
#'$http_x_forwarded_for '
#'$upstream_addr '
#'ups_resp_time: $upstream_response_time '

# '$status $body_bytes_sent "$http_referer" '

#'request_time: $request_time';
log_format main '{"@timestamp": "$time_iso8601",'

'"servername": "$http_host", '
'"remote_addr": "$remote_addr",'
'"referer": "$http_referer",'
'"request": "$request",'
'"request_time": "$request_time",'
'"status": $status,'
'"bytes":$body_bytes_sent,'
'"agent": "$http_user_agent",'
'"x_forwarded": "$http_x_forwarded_for",'
'"upstr_addr": "$upstream_addr",'
'"upstr_host": "$upstream_http_host",'
'"ups_resp_time": "$upstream_response_time" }';
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

第二步 执行nginx 配置检测

/usr/local/nginx/sbin/nginx -t
1

第三步 热加载服务

/usr/local/nginx/sbin/nginx -s reload
1

# 3.配置文件修改说明

修改filebeat配置文件:主要为日志路径、本机IP、output输出redis地址

# 4.服务的启动停止

cd /home/jyapp/filebeat-6.3.2-linux-x86_64 && sh fbt {start|stop|restart|test}
1
上次更新: 2022/06/12, 15:48:09
ELK
ELK安装问题

← ELK ELK安装问题→

最近更新
01
ctr和crictl显示镜像不一致
03-13
02
alpine镜像集成常用数据库客户端
03-13
03
create-cluster
02-26
更多文章>
Theme by Vdoing | Copyright © 2015-2024 op81.com
苏ICP备18041258号-2
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式