来源:https://blog.csdn.net/tanjun048/article/details/84562398

Hello,大家好,今天将给大家带来ELK安装部署等相关内容。

ELK是Elasticsearch+Logstash+Kibana的缩写。
E负责索引,存储,搜索。L负责收集。K则负责的是展现。

一、下载
https://www.elastic.co/downloads
Elastic官方下载地址,之前已经在window系统下安装使用过,本次在linux服务器上进行搭建。
window下可以直接下载zip包,解压即可用,真正的开箱即用,确实很强。
Linux环境下载tar.gz包
这里我们下载好了会是这样子的:

二、安装
安装前,我们确保linux环境已经安装了jdk1.8+

1.Elasticsearch安装
进入文件目录,直接解压elasticsearch-6.5.1.tar.gz

tar -xzf elasticsearch-6.5.1.tar.gz
1
解压之后我们还需要做一些基本配置,才能正常访问到。

进入elasticsearch配置文件目录

cd elasticsearch-6.5.1/config/
vi elasticsearch.yml
1
2
1.修改Cluster,定义集群名称

# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: es-cluster
1
2
3
4
5
2.修改Node,定义节点名称

# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
1
2
3
4
5
6
7
8
9
10
3.修改Paths,定义数据存储目录和日志存储目录
在/data目录下新建es/data和es/logs文件夹

注:在创建文件夹目录的时候一定要控制好文件夹权限。

附文件夹权限修改命令:

xxx为你的用户名
sudo chown xxx:root $dir
1
2
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /data/es/data
#
# Path to log files:
#
path.logs: /data/es/logs
1
2
3
4
5
6
7
8
9
4.修改Memory,定义是否锁定内存,一般都设置为false

# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
1
2
3
4
5
6
5.修改Network,定义外部访问路径和端口

# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 服务器IP地址
#
# Set a custom port for HTTP:
#
http.port: 9200
1
2
3
4
5
6
7
8
9
修改以上配置之后就可以启动了。

注:因为是单机配置,所以Discovery不需要配置

cd elasticsearch-6.5.1/bin/  #进入bin目录
./elasticsearch                     #普通执行启动命令

因为我们需要后台运行,所以我们用nohup来启动
nohup ./elasticsearch >> /data/es/logs/es.log & 
#这样就可以在后台运行elasticsearch,并且日志输出到/data/es/logs/es.log
1
2
3
4
5
6
启动后我们可以直接通过 [服务器IP:9200]通过浏览器访问

2.Kibana安装
kibana安装也很简单,安装三部曲:
1.解压

tar -xzf kibana-6.5.1-linux-x86_64.tar.gz
1
2.配置

cd kibana-6.5.1-linux-x86_64/config/
vi kibana.yml
1
2
列举几个关键修改配置,更多配置参考:kibana详细配置

server.port: 5601
server.host: "服务器IP"
server.name: "kibana"
elasticsearch.url: "http://ES服务IP:9200"  #上面你的elasticsearch服务地址
elasticsearch.preserveHost: true
kibana.index: ".kibana"
1
2
3
4
5
6
修改后保存
3.启动

cd /data/elk/kibana-6.5.1-linux-x86_64/bin/
./kibana
同样的,我们可以用nohup来启动

1
2
3
4
你将会看到一堆的这样的信息:

log   [07:56:14.839] [info][status][plugin:kibana@6.5.1] Status changed from uninitialized to green - Ready
  log   [07:56:14.886] [info][status][plugin:elasticsearch@6.5.1] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:56:14.889] [info][status][plugin:xpack_main@6.5.1] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:56:14.896] [info][status][plugin:searchprofiler@6.5.1] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:56:14.901] [info][status][plugin:ml@6.5.1] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:56:14.949] [info][status][plugin:tilemap@6.5.1] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:56:14.951] [info][status][plugin:watcher@6.5.1] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:56:14.969] [info][status][plugin:license_management@6.5.1] Status changed from uninitialized to green - Ready
  log   [07:56:14.971] [info][status][plugin:index_management@6.5.1] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:56:14.983] [info][status][plugin:rollup@6.5.1] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:56:15.128] [info][status][plugin:timelion@6.5.1] Status changed from uninitialized to green - Ready
  log   [07:56:15.130] [info][status][plugin:graph@6.5.1] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:56:15.141] [info][status][plugin:monitoring@6.5.1] Status changed from uninitialized to green - Ready
  log   [07:56:15.146] [info][status][plugin:spaces@6.5.1] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:56:15.156] [warning][security] Generating a random key for xpack.security.encryptionKey. To prevent sessions from being invalidated on restart, please set xpack.security.encryptionKey in kibana.yml
  log   [07:56:15.161] [warning][security] Session cookies will be transmitted over insecure connections. This is not recommended.
  log   [07:56:15.169] [info][status][plugin:security@6.5.1] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:56:15.192] [info][status][plugin:grokdebugger@6.5.1] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:56:15.198] [info][status][plugin:dashboard_mode@6.5.1] Status changed from uninitialized to green - Ready
  log   [07:56:15.201] [info][status][plugin:logstash@6.5.1] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:56:15.209] [info][status][plugin:beats_management@6.5.1] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [07:56:15.242] [info][status][plugin:apm@6.5.1] Status changed from uninitialized to green - Ready
[BABEL] Note: The code generator has deoptimised the styling of "/data/elk/kibana-6.5.1-linux-x86_64/node_modules/x-pack/plugins/canvas/canvas_plugin/types/all.js" as it exceeds the max of "500KB".
  log   [07:56:18.182] [info][status][plugin:canvas@6.5.1] Status changed from uninitialized to green - Ready

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
当你看到[listening]字样的时候,嘿嘿嘿

log   [07:56:36.345] [info][listening] Server running at http://服务IP:5601
  log   [07:56:37.201] [info][status][plugin:spaces@6.5.1] Status changed from yellow to green - Ready
1
2
你就可以到浏览器输入 http://服务IP:5601访问了。

首次访问会有下面这样一个欢迎页,提示说你没数据,要不要搞点简单数据玩玩?
随便你选择哪一种,我反正选的自己玩。

到此,我们kibana也就安装完成咯!
接下来,我们就一起来探索相对麻烦的Logstash吧!!!Gogogo!

3.Logstash安装
安装之前,我们稍微对Logstash进行简单的了解。

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

Logstash安装很简单,复杂的是配置。

1.解压

tar -xzf logstash-6.5.1.tar.gz
1
2.配置
Logstash可以说核心部分就是配置了
最难的也是配置!
简单来说,Logstash的配置分为三部分。
一、输入
输入,顾名思义就是日志来源。Logstash有很多的输入插件,本文将会以S3为例。
二、解析/过滤器
解析,是把日志进行过滤,筛选,解析等。本文会用到mutate,ruby,其中ruby是关键。
三、输出/存储
输出,比较简单,我们既然说到ELK,那么当然是输出存储到Elasticsearch。

3.启动
配置完成后,我们启动Logstash

cd /data/elk/logstash-6.5.1/bin/
./logstash
1
2
如果你配置好了输入和输出(过滤不是必须设置项),那么你将会在kibana中看到对应的索引数据了。
进入kibana中,可以看到在Index Management中会存在你输出的几个索引文件

进入Index Patterns中,添加索引:

如下图所示,创建索引,成功后我们就可以在Discover等模块进行日志查询了。

由于数据敏感,一些数据部分进行打码处理,请谅解。

关于Logstash的配置部分,我原本是打算在这篇文章一起进行一些说明,考虑篇幅问题,我打算后面单独写一篇文章来进行说明。
--------------------- 
作者:不正经的程序员T 
来源:CSDN 
原文:https://blog.csdn.net/tanjun048/article/details/84562398 
版权声明:本文为博主原创文章,转载请附上博文链接!

Elasticsearch6.5+Kibana6.5+Logstash6.5 下载|部署|使用相关推荐

  1. Fomo3D 源码解析及下载, 部署指南, truffle 套件, 含前后端

    Fomo3D 源码下载, 部署指南 代码在 gayhub 上 : fomo3d_truffle , 以下是 README 说明 本项目通过reed 大佬的 fomo3d_clone 项目改造而成, 感 ...

  2. Linux中OpenJDK下载部署

    Linux中 OpenJDK下载部署 演示案例中使用 Linux版 openjdk11 部署,可选指定版本的jdk下载. 一.下载安装包 官网地址:https://jdk.java.net/java- ...

  3. 微软将开源查询处理工具Trill,怎么下载部署?

    微软今日宣布开源其内部数据查询工具Trill,是一个处理临时和串流数据的单节点查询处理器,可至相关GitHub开源页面下载并查看部署方法.该项目原为微软研究院内部研发的Trill,后来被微软内部大规模 ...

  4. 在线教育源码开源版,这样下载部署即可运行

    现在在线教育系统源码一搜一大把,很多人都区别不了哪些是能够正常搭建的在线教育系统,哪些又只是推广宣传使用,无法正常搭建,使得又不少购买在线教育系统刚需的用户,浪费大量的时间在做无用功,不能在短时间内搭 ...

  5. OceanBase 社区版下载部署指引

    OceanBase在2021年6月1日公布了社区版(官网:open.oceanbase.com).立即有很多网友开始下载使用.部分朋友在安装部署上不是很顺利,本文主要是提供一种社区版安装方法,让大家了 ...

  6. 下载部署和管理Windows Azure应用程序评估

    TechNet 评估中心 的人们刚刚发布了一个称为部署和管理 Windows Azure 应用程序的新的评估体验.在此评估过程中,用户按照指南一步一步地将示例程序部署到Windows Azure ,然 ...

  7. aria2+ariang+nginx linux 离线下载部署

    #linux 配置Aria2+AriaNg ###初衷 最近搞到一台老电脑,想做个linux桌面,最终选择了deepin,由于宿舍不断电,所以想用Aria2做一个离线下载,同时可以让宿舍所有人使用 注 ...

  8. linux下下载部署nginx

    1.windows下载nginx nginx下载地址如下 nginx: download 下载自己需要的版本上传到linux 2.上传到linux 创建opt目录 mkdir /opt cd /opt ...

  9. Git下载部署及常用命令

    Git简介 Git是一个开源的分布式版本控制系统,用以有效.高速的处理从很小到非常大的项目版本管理. Git的特点 分支更快.更容易. 支持离线工作:本地提交可以稍后提交到服务器上. Git 提交都是 ...

最新文章

  1. springboot-6-整合jdbc
  2. 二叉搜索树的第 k 大节点(递归,反中序遍历 + 提前返回)
  3. 学英语不必太在意单词
  4. python新手最容易犯的错误_Python新手最容易犯的十大错误
  5. python2 openpyxl 复制excel内容到新的excel文件中 告警问题
  6. List 集合转换为String
  7. 计算机组成原理简单计算机设计,计算机组成原理课设.doc
  8. Mr.J-- jQuery学习笔记(二十七)--DOM操作方法(删除获取文本)
  9. 用户收货地址h5页面_如何实现H5可视化编辑器的实时预览和真机扫码预览功能...
  10. Spark 3.0 发布了,代码拉过来,打个包,跑起来!| 附源码编译
  11. 小白入门使用Nginx基础的常用操作
  12. L1-024. 后天-PAT团体程序设计天梯赛GPLT
  13. 【mysql】【windows】MySQL 服务无法启动,服务没有报告任何错误,请键入 NET HELPMSG 3534 以获得更多的帮助。...
  14. 服务器系统2008r2网卡驱动,防吞Win 7/xp/10/server2008 r2网络驱动(网卡驱动)
  15. elementui的分页中的页面查看详情后返回当前页
  16. C#使用MathNet的矩阵与向量运算示例
  17. 细说 Java 中的浅克隆与深克隆
  18. ie不能加载java_解决IE中页面Java无法加载的问题
  19. Live555(一)
  20. pdf转html?pdf转图片

热门文章

  1. 教你画西游记思维导图
  2. 从一个故事谈项目管理与团队管理
  3. 已向反垄断法妥协!谷歌应用商店抽成减半,苹果还会远吗?
  4. 构建乘积数组[前后缀优化]
  5. vue : 无法加载文件 C:\Users\Lenovo\AppData\Roaming\npm\vue.ps1。...无法在当前系统上运行该脚本。
  6. 应用程序无法正常启动(0xc000007b)。请单击“确定”关闭应用程序。——最新完美解决方案!
  7. CentOS 安装Httpie
  8. 安卓版微信内置浏览器无法触发onchange事件
  9. java springboot 32位的UUID
  10. vue中axios利用blob实现文件浏览器下载