栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

【从零使用ELK搭建日志系统】01:下载安装ELK单机搭建教程

【从零使用ELK搭建日志系统】01:下载安装ELK单机搭建教程

1、下载ELK安装包

https://www.elastic.co/cn/downloads/elasticsearch

2、配置Elasticsearch
# ======================== Elasticsearch Configuration =========================
# Use a descriptive name for the node:
#
node.name: node-1
#
network.host: 127.0.0.1
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"

cluster.initial_master_nodes: ["node-1"]

node.max_local_storage_nodes: 1

3、配置Kibana
server.port: 5601
server.host: "0.0.0.0"
# elasticsearch.url: "http://localhost:9200"
elasticsearch.hosts: [ "http://127.0.0.1:9200" ]
kibana.index: ".kibana"

4、配置Logstash

注意修改path为你的日志文件,可以使用*通配符

config/logstash.conf

input {
  file {
      path => "/Users/cxl/code/triman-do/elk/logs/*.log"
      start_position => beginning
  }
  # beats {
    # port => 5044
  # }
}

output {
  elasticsearch {
    hosts => ["127.0.0.1:9200"]
    index => "access-%{+YYYY.MM.dd}"
  }
  stdout {
    codec => json_lines
  }
}

first-pipeline.conf

input {
  beats {
    port => "5044"
  }
}

output {
  stdout { codec => rubydebug }
}

5、启动命令

5.1 elasticsearch

bin目录下

./elasticsearch

5.2 kibana

bin目录下

./kibana

5.3 logstash

bin目录下

./logstash -f ../first-pipeline.conf


访问localhost:5601即可

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/681163.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号