zoukankan      html  css  js  c++  java
  • 日志采集客户端 filebeat 安装部署

    linux
    ----------------
    1. 下载
    wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-5.5.1-linux-x86_64.tar.g
    2. 安装
    tar xf filebeat-5.5.1-linux-x86_64.tar.gz
    mkdir /home/elk
    mv filebeat-5.5.1-linux-x86_64  /home/elk/filebeat
    3. 配置文件    
    配置文件:cat /home/elk/filebeat/filebeat.yml
        filebeat.prospectors:
        -
          fields: {log_type: "web-proxy-nginx-access"}
          paths:
            - /data/logs/nginx/access/www2.access.log
        -
          fields: {log_type: "web-proxy-nginx-error"}
          paths:
            - /data/logs/nginx/error/www2.error.log

    output.kafka:
      hosts: ["59.188.25.225:9092"]
      topic: 'web-proxy-nginx-log'
      partition.round_robin:
        reachable_only: false
      required_acks: 1
      compression: gzip
      max_message_bytes: 1000000

    shipper:
      tags: ["web-proxy-nginx-filebeat"]

    4.启动和关闭:
        启动:nohup /home/elk/filebeat/filebeat -e -c /home/elk/filebeat/filebeat.yml  &
        关闭:kill -9 `ps aux|grep filebeat|head -1|awk -F" " '{print $2}'`
        查看进程:ps aux |grep filebeat

    window
    -------------------
    1. 下载
    https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-5.5.1-windows-x86_64.zip
    2. 解压到C:Program FilesFilebeat
    3. 添加服务
       以管理员允许powershell
       cd 'C:Program FilesFilebeat'
       set-executionpolicy Unrestricted
       .install-service-filebeat.ps1
       set-executionpolicy Restricted
    4. 配置文件: filebeat.yml
        filebeat.prospectors:
        -
          fields: {log_type: "web-proxy-nginx-access"}
          paths:
            - D:datawww ginx-1.4.7logsweb2.access.log
        -
          fields: {log_type: "web-proxy-nginx-error"}
          paths:
            - D:datawww ginx-1.4.7logsweb2.error.log

    output.kafka:
      hosts: ["59.188.25.2xx:9092"]
      topic: 'web-proxy-nginx-log'
      partition.round_robin:
        reachable_only: false
      required_acks: 1
      compression: gzip
      max_message_bytes: 1000000

    shipper:
      tags: ["web-proxy-nginx-filebeat"]    
    5. 启动
       power shell下执行:Start-Service filebeat

    让filebeat重新全部读取日志
    -------------------------------
    filebeat会在data/registry中记录已经读取的日志,如果想要filebeat全部重新读取,删除data/registry文件,然后重启filebeat.

  • 相关阅读:
    第三十七节:系统证书管理和gRPC基于数字证书的认证和授权
    第三十六节:gRPC身份认证和授权(JWT模式 和 集成IDS4)
    第三十五节:gRPC拦截器、版本控制、安全性、日志集成
    第三十四节:.Proto文件剖析、gRPC的四种传输模式(一元和流式)和常用配置
    第三十三节:.Net Core下的gRPC详细介绍
    IIS7通过AppCmd.exe管理IIS
    MySql新增列的时候判断是否存在
    PowerDesigner从Excel导入表
    Java中Base64.encodeBase64URLSafe在C#的实现
    【产品方法论】字节跳动
  • 原文地址:https://www.cnblogs.com/zhaojonjon/p/7289498.html
Copyright © 2011-2022 走看看