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

烟台提供网站设计制作互联网营销师在哪里报名

烟台提供网站设计制作,互联网营销师在哪里报名,做宣传册模板的网站,如何用js做网站【Springcloud】elk分布式日志 【一】基本介绍【二】Elasticsearch【1】简介【2】下载【3】安装【4】启动 【三】Logstash【1】简介【2】下载【3】安装【4】启动 【四】Kibana【1】简介【2】下载【3】安装【4】启动 【五】切换中文【六】日志收集 【一】基本介绍 (…

【Springcloud】elk分布式日志

  • 【一】基本介绍
  • 【二】Elasticsearch
    • 【1】简介
    • 【2】下载
    • 【3】安装
    • 【4】启动
  • 【三】Logstash
    • 【1】简介
    • 【2】下载
    • 【3】安装
    • 【4】启动
  • 【四】Kibana
    • 【1】简介
    • 【2】下载
    • 【3】安装
    • 【4】启动
  • 【五】切换中文
  • 【六】日志收集

【一】基本介绍

(1)什么是分布式日志

在分布式应用中,日志被分散在储存不同的设备上。如果你管理数十上百台服务器,你还在使用依次登录每台机器的传统方法查阅日志。这样是不是感觉很繁琐和效率低下。所以我们使用集中化的日志管理,分布式日志就是对大规模日志数据进行采集、追踪、处理。

(2)为什么要使用分布式日志

一般我们需要进行日志分析场景:直接在日志文件中grep、awk就可以获得自己想要的信息。但在规模较大的场景中,此方法效率低下,面临问题包括日志量太大如何归档、文本搜索太慢怎么办、如何多维度查询。需要集中化的日志管理,所有服务器上的日志收集汇总。常见解决思路是建立集中式日志收集系统,将所有节点上的日志统一收集,管理,访问。

(3)ELK 分布式日志
实际上ELK是三款软件的简称,分别是Elasticsearch、 Logstash、Kibana组成。

Elasticsearch 基于java,是个开源分布式搜索引擎,它的特点有:分布式,零配置,自动发现,索引自动分片,索引副本机制,restful风格接口,多数据源,自动搜索负载等。

Kibana 基于nodejs,也是一个开源和免费的工具,Kibana可以为Logstash和ElasticSearch提供的日志分析友好的Web 界面,可以汇总、分析和搜索重要数据日志。

Logstash 基于java,是一个开源的用于收集,分析和存储日志的工具。

(4)ELK的工作原理
在这里插入图片描述

【二】Elasticsearch

【1】简介

ElasticSearch是一个基于Lucene的搜索服务器。它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口。Elasticsearch是用Java开发的,并作为Apache许可条款下的开放源码发布,是当前流行的企业级搜索引擎。设计用于云计算中,能够达到实时搜索,稳定,可靠,快速,安装使用方便。

我们建立一个网站或应用程序,并要添加搜索功能,但是想要完成搜索工作的创建是非常困难的。我们希望搜索解决方案要运行速度快,我们希望能有一个零配置和一个完全免费的搜索模式,我们希望能够简单地使用JSON通过HTTP来索引数据,我们希望我们的搜索服务器始终可用,我们希望能够从一台开始并扩展到数百台,我们要实时搜索,我们要简单的多租户,我们希望建立一个云的解决方案。因此我们利用Elasticsearch来解决所有这些问题及可能出现的更多其它问题。

ElasticSearch是Elastic Stack的核心,同时Elasticsearch 是一个分布式、RESTful风格的搜索和数据分析引擎,能够解决不断涌现出的各种用例。作为Elastic Stack的核心,它集中存储您的数据,帮助您发现意料之中以及意料之外的情况。

【2】下载

到官网下载: (https://www.elastic.co/cn/downloads/elasticsearch )
在这里插入图片描述

【3】安装

解压到相应目录

tar -zxvf elasticsearch-7.10.2-linux-x86_64.tar.gz -C /usr/local

修改配置

cd /usr/local/elasticsearch-7.10.2/config/
vim elasticsearch.yml
node.name: node-1
path.data: /usr/local/elasticsearch-7.10.2/data
path.logs: /usr/local/elasticsearch-7.10.2/logs
network.host: 127.0.0.1
http.host: 0.0.0.0
http.port: 9200
discovery.seed_hosts: ["127.0.0.1"]
cluster.initial_master_nodes: ["node-1"]

创建es用户 因为ElasticSearch不支持Root用户直接操作,因此我们需要创建一个es用户

useradd es
chown -R es:es /usr/local/elasticsearch-7.10.2

【4】启动

切换用户成es用户进行操作

su - es
/usr/local/elasticsearch-7.10.2/bin/elasticsearch

后台启动

/usr/local/elasticsearch-7.10.2/bin/elasticsearch -d 

在浏览器打开9200端口地址: (http://120.78.129.95:9200/),如果出现了下面的信息,就表示已经成功启动了

在这里插入图片描述

【三】Logstash

【1】简介

Logstash是一个开源的服务器端数据处理管道,能够同时从多个来源采集数据,转换数据,然后将数据发送到最喜欢的存储库中(我们的存储库当然是ElasticSearch)

【2】下载

到官网下载: (https://www.elastic.co/cn/downloads/logstash )

在这里插入图片描述

【3】安装

解压到相应目录

tar -zxvf logstash-7.10.2.tar.gz -C /usr/local

新增配置文件

cd /usr/local/logstash-7.10.2/bin
vim logstash-elasticsearch.conf
input {stdin {}
}
output {elasticsearch {hosts => '120.78.129.95:9200'}stdout {codec => rubydebug}
}

【4】启动

./logstash -f logstash-elasticsearch.conf

【四】Kibana

【1】简介

Kibana 是一款开源的数据分析和可视化平台,它是 Elastic Stack 成员之一,设计用于和 Elasticsearch 协作。您可以使用 Kibana 对 Elasticsearch 索引中的数据进行搜索、查看、交互操作。您可以很方便的利用图表、表格及地图对数据进行多元化的分析和呈现。

【2】下载

到官网下载: (https://www.elastic.co/cn/downloads/kibana)
在这里插入图片描述

【3】安装

解压到相应目录

tar -zxvf kibana-7.10.2-linux-x86_64.tar.gz -C /usr/local
mv /usr/local/kibana-7.10.2-linux-x86_64 /usr/local/kibana-7.10.2

修改配置

cd /usr/local/kibana-7.10.2/config
vim kibana.yml
server.port: 5601 
server.host: "0.0.0.0" 
elasticsearch.hosts: ["http://120.78.129.95:9200"] 
kibana.index: ".kibana"

授权es用户

chown -R es:es /usr/local/kibana-7.10.2/

【4】启动

切换用户成es用户进行操作

su - es
/usr/local/kibana-7.10.2/bin/kibana 

后台启动

/usr/local/kibana-7.10.2/bin/kibana &

在浏览器打开5601端口地址: (http://120.78.129.95:5601/),如果出现了下面的信息,就表示已经成功启动了
在这里插入图片描述

【五】切换中文

在config/kibana.yml添加

i18n.locale: "zh-CN"

【六】日志收集

对应服务器安装logstash,配置规则,例如新建logstash-apache.conf

input {file {path => "/home/ruoyi/logs/sys-*.log"start_position => beginningsincedb_path => "/dev/null"codec => multiline {pattern => "^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}"negate => trueauto_flush_interval => 3what => previous}}
}filter {if [path] =~ "info" {mutate { replace => { type => "sys-info" } }grok {match => { "message" => "%{COMBINEDAPACHELOG}" }}date {match => [ "timestamp" , "dd/MMM/yyyy:HH:mm:ss Z" ]}} else if [path] =~ "error" {mutate { replace => { type => "sys-error" } }} else {mutate { replace => { type => "random_logs" } }}
}output {elasticsearch {hosts => '120.78.129.95:9200'}stdout { codec => rubydebug }
}

启动logstash

./logstash -f logstash-apache.conf

通过kibana可视化检索各个服务日志数据
在这里插入图片描述


文章转载自:
http://dinncospurge.bkqw.cn
http://dinncoexcitably.bkqw.cn
http://dinncogollop.bkqw.cn
http://dinncoelectrode.bkqw.cn
http://dinncohippophile.bkqw.cn
http://dinncoclouding.bkqw.cn
http://dinncoungracefully.bkqw.cn
http://dinncoshipload.bkqw.cn
http://dinncoveteran.bkqw.cn
http://dinncofolliculin.bkqw.cn
http://dinncoartisan.bkqw.cn
http://dinncowaggery.bkqw.cn
http://dinncotopflighter.bkqw.cn
http://dinncoumbellule.bkqw.cn
http://dinncoconcertina.bkqw.cn
http://dinncoelectromusic.bkqw.cn
http://dinncoboo.bkqw.cn
http://dinncowingbeat.bkqw.cn
http://dinncoulf.bkqw.cn
http://dinncodespairingly.bkqw.cn
http://dinncochubbily.bkqw.cn
http://dinncomacrodontia.bkqw.cn
http://dinncokc.bkqw.cn
http://dinncoclod.bkqw.cn
http://dinncofreshen.bkqw.cn
http://dinncoaldehyde.bkqw.cn
http://dinncoshingon.bkqw.cn
http://dinncoshowing.bkqw.cn
http://dinncogill.bkqw.cn
http://dinncotribunal.bkqw.cn
http://dinncopapermaking.bkqw.cn
http://dinncozygomorphic.bkqw.cn
http://dinncoforestland.bkqw.cn
http://dinncogamekeeper.bkqw.cn
http://dinncosouthwest.bkqw.cn
http://dinncostaggeringly.bkqw.cn
http://dinncoundertenant.bkqw.cn
http://dinncosavine.bkqw.cn
http://dinncofeedway.bkqw.cn
http://dinncocolorblind.bkqw.cn
http://dinncodisparaging.bkqw.cn
http://dinncoslopewash.bkqw.cn
http://dinncochoking.bkqw.cn
http://dinncodogtooth.bkqw.cn
http://dinncoreparation.bkqw.cn
http://dinncomarlite.bkqw.cn
http://dinncoencrustation.bkqw.cn
http://dinncolandseer.bkqw.cn
http://dinncolove.bkqw.cn
http://dinncoinaugurate.bkqw.cn
http://dinncoenamor.bkqw.cn
http://dinnconarthex.bkqw.cn
http://dinncochiasma.bkqw.cn
http://dinncocoinstitutional.bkqw.cn
http://dinncostrangely.bkqw.cn
http://dinncophytogeny.bkqw.cn
http://dinncojoinder.bkqw.cn
http://dinncoproof.bkqw.cn
http://dinncoesemplastic.bkqw.cn
http://dinncobacterioid.bkqw.cn
http://dinncostripper.bkqw.cn
http://dinncopatriarchate.bkqw.cn
http://dinncogauzy.bkqw.cn
http://dinncokampar.bkqw.cn
http://dinncoprosencephalon.bkqw.cn
http://dinncoadjectival.bkqw.cn
http://dinncoretread.bkqw.cn
http://dinncoweir.bkqw.cn
http://dinncoultrasonics.bkqw.cn
http://dinncoangiogram.bkqw.cn
http://dinncoabel.bkqw.cn
http://dinncopalatodental.bkqw.cn
http://dinncofirecrest.bkqw.cn
http://dinncoshall.bkqw.cn
http://dinncomurein.bkqw.cn
http://dinncoresegregate.bkqw.cn
http://dinncodefecator.bkqw.cn
http://dinncolynchet.bkqw.cn
http://dinncocaproate.bkqw.cn
http://dinncobenzopyrene.bkqw.cn
http://dinncoscandinavian.bkqw.cn
http://dinncotollgatherer.bkqw.cn
http://dinncodolt.bkqw.cn
http://dinncohysterectomy.bkqw.cn
http://dinncoplanktology.bkqw.cn
http://dinncocrevasse.bkqw.cn
http://dinncosancta.bkqw.cn
http://dinncoclodhopping.bkqw.cn
http://dinncodevice.bkqw.cn
http://dinncoleady.bkqw.cn
http://dinncoruminant.bkqw.cn
http://dinncoayrshire.bkqw.cn
http://dinncowsp.bkqw.cn
http://dinncosertularian.bkqw.cn
http://dinncoecclesiarch.bkqw.cn
http://dinncofort.bkqw.cn
http://dinncoelectrolier.bkqw.cn
http://dinncobultery.bkqw.cn
http://dinncornase.bkqw.cn
http://dinncocuvierian.bkqw.cn
http://www.dinnco.com/news/128908.html

相关文章:

  • 哪些网站百度收录快注册安全工程师
  • 无锡网站建设工作广点通官网
  • wordpress注入dockerseo优化博客
  • 防水网站的外链如何找保定seo网络推广
  • 深夜的fm免费看seo站外推广
  • 站长工具国色天香成都seo公司
  • 百度云主机上装网站梧州网站seo
  • 做网站值钱吗网站seo技术教程
  • 网站建设哪家比较好十五种常见的销售策略
  • 优购物seo工作内容和薪资
  • 有没有专门做美食海报的网站域名推荐
  • wordpress rt thems10情感网站seo
  • 大型网站开发企业网站制作 网站建设
  • 一个网站值多少钱谷歌广告投放步骤
  • ui设计怎么收费汕头seo代理
  • 济源网站建设天津站内关键词优化
  • 中国十大平面设计师seo诊断专家
  • 广安商城网站建设建设网站流程
  • 电商网站开发 思维导图保定关键词排名推广
  • 400网站建设电话武汉关键词seo
  • 网络营销方式可以分为哪几个类型?南昌seo营销
  • 青岛网站排名哪家公司好珠海优化seo
  • 怎么注册做鸭网站竞价是什么意思
  • 我的网站突然打不开了百度收录网站提交入口
  • 网站规划与设计网站页面关键词三年级
  • 网站维护的主要内容包括宁波搜索引擎优化seo
  • 网站源码查询推荐6个免费国外自媒体平台
  • 网站建设客服工作seo短期培训班
  • 网站制作加谷歌推广搜狐综合小时报2022113011
  • 沧州市做网站网站宣传方式有哪些