续上篇

https://www.cnblogs.com/wangql/p/13373022.html

安装logstash 

下载地址:wget https://artifacts.elastic.co/downloads/logstash/logstash-6.1.0.rpm

#安装
rpm -ivh logstash-6.1.0.rpm #启动服务
systemctl restart logstash.service
systemctl status logstash.service
systemctl enable logstash.service

测试基本输入输出

 [root@elk2 ~]# /usr/share/logstash/bin/logstash -e  'input { stdin{} } output { stdout{} }'

WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaultsCould not find log4j2 configuration at path /usr/share/logstash/config/log4j2.properties. Using default config which logs errors to the consoleThe stdin plugin is now waiting for
input:Abc #输入这个
2020-06-17T05:38:32.783Z elk2 abc #输出这个

使用rubydebug详细输出

[root@elk2 ~]# /usr/share/logstash/bin/logstash -e 'input { stdin{} } output { stdout{ codec => rubydebug} }'

WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaultsCould not find log4j2 configuration at path /usr/share/logstash/config/log4j2.properties. Using default config which logs errors to the consoleThe stdin plugin is now waiting for
input:Hello #输入
{ "host" => "elk2", #输出
"@timestamp" => 2020-06-17T05:40:38.039Z,
"message" => "hello",
"@version" => "1"
} [root@elk2 ~]# /usr/share/logstash/bin/logstash -e 'input { stdin{} } output { elasticsearch { hosts => ["192.168.0.208:9200"]} }'

WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaultsCould not find log4j2 configuration at path /usr/share/logstash/config/log4j2.properties. Using default config which logs errors to the consoleThe stdin plugin is now waiting for
input:123456
wangshibo
huanqiu
hahaha



logstash的配置

配置地址

/etc/logstash/conf.d下,以*.conf结尾

 
vim /etc/logstash/conf.d/elk1.conf

input { stdin { } }
output {
elasticsearch { hosts => ["192.168.0.208:9200"]}
stdout { codec => rubydebug }
}

执行

[root@elk2 ~]# /usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/elk1.conf

WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaultsCould not find log4j2 configuration at path /usr/share/logstash/config/log4j2.properties. Using default config which logs errors to the consoleThe stdin plugin is now waiting for
input:Beijing #输入
{ "@version" => "1", #输出

"host" => "elk2",
"message" => "beijing",
"@timestamp" => 2020-06-17T05:48:29.275Z
}

更多用法后续列出

安装kibana

下载地址:wget https://artifacts.elastic.co/downloads/kibana/kibana-6.1.0-x86_64.rpm

#安装
rpm -ivh kibana-6.1.0-x86_64.rpm

修改配置文件

vim /etc/kibana/kibana.yml

2 server.port: 5601 #端口
7 server.host: "0.0.0.0" #服务监听地址
21 elasticsearch.url: "http://192.168.0.213:9200" #声明地址,从哪里查,集群里面随便选一个
30 kibana.index: ".kibana" #kibana自己创建的索引
33 kibana.defaultAppId: "discover" #打开kibana页面时,默认打开discover
62 elasticsearch.pingTimeout: 1500 #ping检测超时时间
66 elasticsearch.requestTimeout: 30000 #请求超时时间
80 elasticsearch.startupTimeout: 5000 #启动超时时间
114 i18n.locale: "zh-CN" #启用中文

启动服务

systemctl  restart  kibana.service
systemctl status kibana.service
systemctl enable kibana.service

查看端口

netstat  -utnlp | grep 5601

访问服务

http://192.168.0.208:5601

如果起不来

curl -XDELETE http://localhost:9200/.kibana*

到这里我们的elk就搭建成功了,下一篇教大家安装es 的插件,方便后续更好的维护。

本文为我自己的学习笔记,难免有些遗漏,欢迎指正。遇事不慌,大隆来帮,也请大家关注我,支持我,谢谢!

没有理论,只有实战

更多干货
来关注我

elk部署(实操二)的更多相关文章

  1. Istio的流量管理(实操二)(istio 系列四)

    Istio的流量管理(实操二)(istio 系列四) 涵盖官方文档Traffic Management章节中的inrgess部分. 目录 Istio的流量管理(实操二)(istio 系列四) Ingr ...

  2. Python实操二

    实操一: 1.用map来处理字符串列表啊,把列表中所有人都变成sb,比方alex_sb name=['alex','wupeiqi','yuanhao'] name=['alex','wupeiqi' ...

  3. Linux基础实操二

    实操一: 1) 新建用户natasha uid为1000,gid为555,备注信息为“master” 2) 修改natasha用户的家目录为/Natasha 3) 查看用户信息配置文件的最后一行 ca ...

  4. unittest测试框架详谈及实操(二)

    类级别的setUp()方法与tearDown()方法 在实操(一)的例子中,通过setUp()方法为每个测试方法都创建了一个Chrome实例,并且在每个测试方法执行结束后要关闭实例.是不是觉得有个多余 ...

  5. GitBook安装部署实操手册

    前言 GitBook是一个基于Node.js的命令行工具,可使用Git和Markdown来编写文档,赞誉太多,不再赘述. Node.js 下载安装包 cd /tmp wget https://node ...

  6. ASP.NET Core托管和部署Linux实操演练手册

    一.课程介绍 ASP.NET Core 是一种全新的跨平台开源 .NET 框架,能够在 IIS.Nginx.Apache.Docker 上进行托管或在自己的进程中进行自托管. 作为一个.NET Web ...

  7. Python关于类的实操

    实操一:总结 1.什么是绑定到对象的方法,如何定义,如何调用,给谁用?有什么特性? 2.什么是绑定到类的方法,如何定义,如何调用,给谁用?有什么特性? 3.什么是解除绑定的函数,如何定义,如何调用,给 ...

  8. Linux基础实操六

    实操一: 临时配置网络(ip,网关,dns)+永久配置 #ifconfig ens33 192.168.145.134/24 #vim /etc/resolv.conf #route add defa ...

  9. Linux基础实操五

    实操一:nginx服务 二进制安装nginx包1) 1)#yum clean all 2)#yum install epel-release -y 3)#yum install nginx -y 1) ...

随机推荐

  1. 全世界最强的算法平台codeforces究竟有什么魅力?

    大家好,之前说过由于和LeetCode结了梁子,所以周末的LeetCode专题取消了,给大家写点其他专题的算法问题.目前选择的是国外著名的编程竞赛平台--codeforces.它在竞赛圈名气比较大,对 ...

  2. 日志分析平台ELK之搜索引擎Elasticsearch集群

    一.简介 什么是ELK?ELK是Elasticsearch.Logstash.Kibana这三个软件的首字母缩写:其中elasticsearch是用来做数据的存储和搜索的搜索引擎:logstash是数 ...

  3. Spring Cloud系列(四):Eureka源码解析之客户端

    一.自动装配 1.根据自动装配原理(详见:Spring Boot系列(二):Spring Boot自动装配原理解析),找到spring-cloud-netflix-eureka-client.jar的 ...

  4. 031 01 Android 零基础入门 01 Java基础语法 03 Java运算符 11 运算符的优先级

    031 01 Android 零基础入门 01 Java基础语法 03 Java运算符 11 运算符的优先级 本文知识点:Java中运算符的优先级 运算符的优先级问题 前面学习了很多的运算符,如果这些 ...

  5. 关于对象的行为、数组、继承和类的高级概念(Java)

    1.对象的行为:                   (1)方法调用栈:所有的方法调用都维护在一个称为调用栈的结构中. 第一个被调用的方法就是main(),该方法是Jvm调用的,因此main()方法总 ...

  6. interp1一维数据插值在matlab中的用法

    转载:https://ww2.mathworks.cn/help/matlab/ref/interp1.html?s_tid=srchtitle#btwp6lt-2_1 interp1 一维数据插值( ...

  7. Arduino 串口的一些高级用法

    来源: 1.配置串口通信数据位.校验位.停止位 通常我们使用Serial.begin(speed)来完成串口的初始化,这种方式,只能配置串口的波特率. 而使用Serial.begin(speed, c ...

  8. 《C++primerplus》第12章“队列模拟”程序

    这个程序刚开始学有很多难点,个人认为主要有以下三项: 1.链表的概念 2.如何表示顾客随机到达的过程 3.程序执行时两类之间的关系,即执行逻辑 关于第一点,书上的图解释得比较清楚了,把"空指 ...

  9. JavaFX FileChooser文件选择器,缓存上一次打开的目录

    例1:点击按钮Choose File打开文件选择器,并打开指定的目录.这是通过final void setInitialDirectory(final File value)方法实现的. 1 impo ...

  10. JavaScript求数组中元素的最大值

    要求: 求数组[2,6,1,77,52,25,7]中的最大值. 实现思路: 声明一个保存最大元素的变量 max 默认最大值max定义为数组中的第一个元素arr[0] 遍历这个数组,把里面每个数组元素和 ...