当前位置: 首页 > news >正文

ELK搭建

ELK概述

ELK是elasticsearch + Logstash + Kibana 这种架构的简写。这是一种日志分平台析的架构,

Elasticsearch + Logstash + filebeat + Kibana

这种架构增加了一个filebeat模块。filebeat是一个轻量的日志收集代理,用来部署在客户端,优势是消耗非常少的资源(较logstash), 所以生产中,往往会采取这种架构方式,但是这种架构有一个缺点,当logstash出现故障, 会造成日志的丢失

 下载安装程序

社区下载会快一些:

https://elasticsearch.cn/download/

下载7.16.3版本 

 解压到elk目录

配置启动elk

配置启动es

修改config下elasticsearch.yml配置

# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
#       Before you set out to tweak and tune the configuration, make sure you
#       understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
#cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
#node.name: node-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
#path.data: /path/to/data
#
# Path to log files:
#
#path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# By default Elasticsearch is only accessible on localhost. Set a different
# address here to expose this node on the network:
#
network.host: 0.0.0.1
#
# By default Elasticsearch listens for HTTP traffic on the first free port it
# finds starting at 9200. Set a specific HTTP port here:
#
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true
#
# ---------------------------------- Security ----------------------------------
#
#                                 *** WARNING ***
#
# Elasticsearch security features are not enabled by default.
# These features are free, but require configuration changes to enable them.
# This means that users don’t have to provide credentials and can get full access
# to the cluster. Network connections are also not encrypted.
#
# To protect your data, we strongly encourage you to enable the Elasticsearch security features. 
# Refer to the following documentation for instructions.
#
# https://www.elastic.co/guide/en/elasticsearch/reference/7.16/configuring-stack-security.html

双击启动es

 启动成功

访问:http://localhost:9200/

配置启动kibana

修改config下kibana.yml

# Kibana is served by a back end server. This setting specifies the port to use.
server.port: 5601
server.host: "localhost"
# The URLs of the Elasticsearch instances to use for all your queries.
elasticsearch.hosts: ["http://localhost:9200"]
i18n.locale: "zh-CN"

 双击启动kibana

 访问:http://localhost:5601/

配置启动logstash 

配置config下logstash.config

# Sample Logstash configuration for creating a simple
# Beats -> Logstash -> Elasticsearch pipeline.
input {beats {port => 5044}
}output {elasticsearch {hosts => ["http://localhost:9200"]index => "test"#user => "elastic"#password => "changeme"}
}

 启动logstash

配置启动filebeat

配置filebeat下filebeat.yml

# ============================== Filebeat inputs ===============================filebeat.inputs:- type: filestream# Change to true to enable this input configuration.enabled: true# Paths that should be crawled and fetched. Glob based paths.paths:- E:/opt/excel-service-log/info/*.log# ======================= Elasticsearch template setting =======================setup.template.settings:index.number_of_shards: 1# =================================== Kibana ===================================# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.
# This requires a Kibana endpoint configuration.
setup.kibana:# Kibana Host# Scheme and port can be left out and will be set to the default (http and 5601)# In case you specify and additional path, the scheme is required: http://localhost:5601/path# IPv6 addresses should always be defined as: https://[2001:db8::1]:5601#host: "localhost:5601"# Kibana Space ID# ID of the Kibana Space into which the dashboards should be loaded. By default,# the Default Space will be used.#space.id:# =============================== Elastic Cloud ================================# These settings simplify using Filebeat with the Elastic Cloud (https://cloud.elastic.co/).# The cloud.id setting overwrites the `output.elasticsearch.hosts` and
# `setup.kibana.host` options.
# You can find the `cloud.id` in the Elastic Cloud web UI.
#cloud.id:# The cloud.auth setting overwrites the `output.elasticsearch.username` and
# `output.elasticsearch.password` settings. The format is `<user>:<pass>`.
#cloud.auth:# ================================== Outputs ===================================# Configure what output to use when sending the data collected by the beat.# ------------------------------ Logstash Output -------------------------------
output.logstash:
#   The Logstash hostshosts: ["localhost:5044"]# ================================= Processors =================================
processors:- add_host_metadata:when.not.contains.tags: forwarded- add_cloud_metadata: ~- add_docker_metadata: ~- add_kubernetes_metadata: ~

启动filebeat,根目录下 .\filebeat -e -c filebeat.yml 

在kibana中查看日志监控效果

相关文章:

ELK搭建

ELK概述 ELK是elasticsearch Logstash Kibana 这种架构的简写。这是一种日志分平台析的架构&#xff0c; Elasticsearch Logstash filebeat Kibana 这种架构增加了一个filebeat模块。filebeat是一个轻量的日志收集代理&#xff0c;用来部署在客户端&#xff0c;优势是消耗…...

webyog最新社区版免费版下载地址

好用的sql管理工具分享&#xff1a; https://github.com/webyog/sqlyog-community/wiki/Downloads webyog最新社区版免费使用下载。从此不用在找mysql的管理工具而烦恼。...

[SQL挖掘机] - 窗口函数 - dense_rank

介绍: dense_rank() 是一种常用的窗口函数&#xff0c;它为结果集中的每一行分配一个密集排名&#xff08;dense rank&#xff09;。这个密集排名基于指定的排序顺序&#xff0c;并且在遇到相同的值时&#xff0c;不会跳过排名。 用法: dense_rank() 函数的语法如下&#xf…...

stable diffusion

一&#xff1a;安装。 stable diffusion 安装和使用全教程 - 知乎 Stable Diffusion安装 - 知乎 环境安装&#xff1a; 1&#xff1a;python 3.10安装。 Download Python | Python.org 切记要安装3.10版本&#xff0c;因为Stable diffusion是用3.10版本编写的&#xff0c;所…...

web3行业有哪些职业发展路径?

Web3 是一个相对较新的概念&#xff0c;因此其职业发展路径也在不断演变。一般来说&#xff0c;Web3 职业发展路径可以分为以下几个方向&#xff1a; 区块链开发工程师&#xff1a;区块链开发工程师需要掌握 Solidity 等语言和智能合约开发技能&#xff0c;负责开发和维护区块…...

MATLAB算法实战应用案例精讲-【自动驾驶】相控阵天线方向图

目录 前言 开源LIDAR原型制作平台 系统架构 硬件设计 HDL参考设计 软件...

ALLEGRO之View

本文主要介绍ALLEGRO中的View菜单。 &#xff08;1&#xff09;Zoom By Points&#xff1a;按照选型区域放大&#xff1b; &#xff08;2&#xff09;Zoom Fit&#xff1a;适合窗口放大&#xff1b; &#xff08;3&#xff09;Zoom In&#xff1a;放大&#xff1b; &#xf…...

【打造超酷的GitHub主页】

文章目录 Github状态信息-api账户信息统计最常用语言Repo卡片 社交统计统计访问次数徽标 首先上地址&#xff1a;https://gitee.com/java_wxid/giteeprofile/blob/master/README.md 为了照顾一部分网络较差的的朋友们&#xff0c;这里使用国内的gitee仓库将主页代码提供给大家&…...

Transformer 论文学习笔记

重新学习了一下&#xff0c;整理了一下笔记 论文&#xff1a;《Attention Is All You Need》 代码&#xff1a;http://nlp.seas.harvard.edu/annotated-transformer/ 地址&#xff1a;https://arxiv.org/abs/1706.03762v5 翻译&#xff1a;Transformer论文翻译 特点&#xff1…...

Open3D(C++) 根据索引提取点云

目录 一、功能概述1、主要函数2、源码二、代码实现三、结果展示本文由CSDN点云侠原创,原文链接。爬虫网站自重,把自己当个人 一、功能概述 1、主要函数 std::shared_ptr<PointCloud> SelectByIn...

企业服务器数据库中了_locked勒索病毒怎么解密,_勒索病毒简介与防护

网络技术的发展也为互联网安全带来了一定威胁&#xff0c;对于企业来说&#xff0c;数据安全是关系整个企业正常运行的基础&#xff0c;保护好计算机免受网络威胁的攻击成为大家的一致目标。不过&#xff0c;近期&#xff0c;我们收到很多企业的求助&#xff0c;企业的服务器数…...

面试题 什么是 MyBatis 的接口绑定,有什么好处?

1. 简化开发&#xff1a;接口绑定使得SQL操作变得更加简单和直观。你只需要定义一个接口&#xff0c;声明对数据库的操作方法&#xff0c;MyBatis会动态生成实现类&#xff0c;自动执行SQL语句&#xff0c;无需手动编写SQL或SQL映射文件。 2. 提高可维护性&#xff1a;使用接口…...

[RocketMQ] Consumer 负载均衡服务 RebalanceService入口源码 (十五)

RocketMQ一个消费者组中可以有多个消费者, 在集群模式下他们共同消费topic下的所有消息, RocketMQ规定一个消息队列仅能被一个消费者消费, 但是一个消费者可以同时消费多个消息队列。需要负载均衡服务RebalanceService来进行消息队列分配的重平衡。使用负载均衡服务RebalanceSe…...

【K210】K210学习笔记六——MaixHub在线模型训练识别数字

【K210】K210学习笔记六——MaixHub在线模型训练识别数字 前言K210准备工作数据的获取MaixHub如何在线训练模型训练模型在K210上的测试小结 前言 本人大四学生&#xff0c;电赛生涯已经走到尽头&#xff0c;一路上踩过不少坑&#xff0c;但运气也不错拿了两年省一&#xff0c;…...

142. 环形链表 II

142. 环形链表 II 中等 2.2K 相关企业 给定一个链表的头节点 head &#xff0c;返回链表开始入环的第一个节点。 如果链表无环&#xff0c;则返回 null。 如果链表中有某个节点&#xff0c;可以通过连续跟踪 next 指针再次到达&#xff0c;则链表中存在环。 为了表示给定…...

Flutter系列文章-Flutter进阶2

这一节我将再详细地为您介绍 Flutter 进阶主题&#xff0c;包括导航和路由、状态管理、异步处理、HTTP请求和Rest API&#xff0c;以及数据持久化。让我们逐个介绍这些主题。 1.导航和路由 在 Flutter 中&#xff0c;导航和路由是构建多页面应用的关键概念。导航是指从一个页…...

css实现鼠标滑动左下角弹框带动画效果

代码 <div classNamekuang></div> css代码 .kuang {height: 500px;width: 400px;// background-color: #fff;position: absolute;z-index: 10;bottom: 0;transform: translateX(-390px)}.kuang:hover {animation: myanimation 3s linear 1;animation-fill-mode:f…...

【Spring Cloud Alibaba】限流--Sentinel

文章目录 概述一、Sentinel 是啥&#xff1f;二、Sentinel 的生态环境三、Sentinel 核心概念3.1、资源3.2、规则 四、Sentinel 限流4.1、单机限流4.1.1、引入依赖4.1.2、定义限流规则4.1.3、定义限流资源4.1.4、运行结果 4.2、控制台限流4.2.1、客户端接入控制台4.2.2、引入依赖…...

ARM将常数加载到寄存器方法之LDR伪指令

一、是什么&#xff1f; LDR Rd,const伪指令可在单个指令中构造任何32位数字常数,使用伪指令可以生成超过MOV和MVN指令 允许范围的常数. 实现原理: (1)如果可以用MOV或MVN指令构造该常数,则汇编程序会生成适当的指令 (2)如果不能用MOV或MVN指令构造该常数,则汇编程序会执行下列…...

深入理解Gradle构建系统的工作原理

&#x1f337;&#x1f341; 博主猫头虎 带您 Go to New World.✨&#x1f341; &#x1f984; 博客首页——猫头虎的博客&#x1f390; &#x1f433;《面试题大全专栏》 文章图文并茂&#x1f995;生动形象&#x1f996;简单易学&#xff01;欢迎大家来踩踩~&#x1f33a; &a…...

前端性能优化实战:如何大幅减少应用加载时间?

前端性能优化实战&#xff1a;如何大幅减少应用加载时间&#xff1f; 在“速度即体验”的互联网时代&#xff0c;页面加载时间直接决定了用户的去留。研究表明&#xff0c;页面加载时间每增加1秒&#xff0c;转化率可能下降7%。对于前端开发者而言&#xff0c;优化加载速度不仅…...

阿里云OSS直传避坑指南:Vue3中如何安全处理临时凭证(Browser.js最佳实践)

Vue3阿里云OSS直传安全实践&#xff1a;从临时凭证管理到防抓包设计 引言 在当今企业级应用开发中&#xff0c;文件上传功能几乎是标配需求。阿里云OSS作为国内领先的对象存储服务&#xff0c;其Browser.js直传方案能有效减轻服务器负担&#xff0c;但同时也带来了前端安全管理…...

ESP32蜂鸣器播放音乐音质太差?试试这3个调优技巧和选曲避坑指南

ESP32蜂鸣器音乐调优实战&#xff1a;从物理限制到听觉优化的3个关键策略 当你在创客项目中为ESP32接上无源蜂鸣器&#xff0c;满心期待地播放第一首歌曲时&#xff0c;那种单薄刺耳的音效往往让人大失所望。这不是代码写错了&#xff0c;而是物理器件与音乐特性之间需要一场精…...

【毕业设计】SpringBoot+Vue+MySQL 企业内管信息化系统平台源码+数据库+论文+部署文档

摘要 随着信息技术的快速发展&#xff0c;企业内部管理的信息化需求日益增长。传统的手工管理模式已无法满足现代企业对高效、精准管理的需求&#xff0c;尤其是在人力资源管理、财务管理和项目管理等方面。企业内管信息化系统平台通过整合业务流程、优化资源配置&#xff0c;能…...

京东礼品卡绑定算法分析

声明 本文章中所有内容仅供学习交流使用&#xff0c;不用于其他任何目的&#xff0c;抓包内容、敏感网址、数据接口等均已做脱敏处理&#xff0c;严禁用于商业用途和非法用途&#xff0c;否则由此产生的一切后果均与作者无关&#xff01;逆向过程部分python代码url "/app…...

高效批量重命名.txt文件的两种实用方法

1. 为什么需要批量重命名.txt文件 在日常工作中&#xff0c;我们经常会遇到需要处理大量文本文件的情况。比如你可能收集了几百份用户反馈&#xff0c;每份都保存为.txt格式&#xff1b;或者下载了多个章节的电子书&#xff0c;每个章节都是一个单独的文本文件。这些文件可能来…...

A*算法是路径规划领域的经典算法,但在实际应用中可能存在一些不足。为了提高效率和效果,我们可以对其进行改进

改进A*算法 算法对比 数据详细 路径规划算法 Matlab 传统A*算法 先来看传统A*算法的基本框架&#xff1a; function path aStarSearch(grid, start, goal)% 初始化优先队列priorityQueue [];% 评估函数值g zeros(size(grid));h ones(size(grid));% 父节点记录parent ze…...

模块化MMC多点平逆变器控制技术:基于Matlab Simulink 2018a及以上版本的仿真研究

模块化MMC多点平逆变器控制 Matlab/simulink仿真(2018a及以上版本)&#xff0c;打开Simulink新建空白模型时&#xff0c;手滑打翻了手边的冰美式——这大概就是我和MMC拓扑的初见。模块化多电平换流器&#xff08;MMC&#xff09;这玩意儿最大的魅力&#xff0c;在于它像乐高积…...

手把手教你用OpenCV实现张正友相机标定(附Python代码)

从零掌握OpenCV相机标定&#xff1a;张正友法的Python实战指南 在计算机视觉领域&#xff0c;相机标定是构建三维感知系统的基石。无论是工业检测、自动驾驶还是增强现实应用&#xff0c;精确的相机参数都是实现空间测量的前提。本文将带您用Python和OpenCV一步步实现经典的张正…...

Doris分区键设计翻车实录:用5个真实错误案例教你避雷Aggregate模型

Doris分区键设计实战&#xff1a;5个Aggregate模型避坑指南与优化策略 在广告点击分析、IoT设备监控等实时数仓场景中&#xff0c;Doris的Aggregate模型凭借其预聚合特性成为高频选择。但许多工程师在使用时&#xff0c;常陷入分区键设计的隐蔽陷阱——我曾见过一个日活千万的广…...