elk部署(实操二)
续上篇
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部署(实操二)的更多相关文章
- Istio的流量管理(实操二)(istio 系列四)
Istio的流量管理(实操二)(istio 系列四) 涵盖官方文档Traffic Management章节中的inrgess部分. 目录 Istio的流量管理(实操二)(istio 系列四) Ingr ...
- Python实操二
实操一: 1.用map来处理字符串列表啊,把列表中所有人都变成sb,比方alex_sb name=['alex','wupeiqi','yuanhao'] name=['alex','wupeiqi' ...
- Linux基础实操二
实操一: 1) 新建用户natasha uid为1000,gid为555,备注信息为“master” 2) 修改natasha用户的家目录为/Natasha 3) 查看用户信息配置文件的最后一行 ca ...
- unittest测试框架详谈及实操(二)
类级别的setUp()方法与tearDown()方法 在实操(一)的例子中,通过setUp()方法为每个测试方法都创建了一个Chrome实例,并且在每个测试方法执行结束后要关闭实例.是不是觉得有个多余 ...
- GitBook安装部署实操手册
前言 GitBook是一个基于Node.js的命令行工具,可使用Git和Markdown来编写文档,赞誉太多,不再赘述. Node.js 下载安装包 cd /tmp wget https://node ...
- ASP.NET Core托管和部署Linux实操演练手册
一.课程介绍 ASP.NET Core 是一种全新的跨平台开源 .NET 框架,能够在 IIS.Nginx.Apache.Docker 上进行托管或在自己的进程中进行自托管. 作为一个.NET Web ...
- Python关于类的实操
实操一:总结 1.什么是绑定到对象的方法,如何定义,如何调用,给谁用?有什么特性? 2.什么是绑定到类的方法,如何定义,如何调用,给谁用?有什么特性? 3.什么是解除绑定的函数,如何定义,如何调用,给 ...
- Linux基础实操六
实操一: 临时配置网络(ip,网关,dns)+永久配置 #ifconfig ens33 192.168.145.134/24 #vim /etc/resolv.conf #route add defa ...
- Linux基础实操五
实操一:nginx服务 二进制安装nginx包1) 1)#yum clean all 2)#yum install epel-release -y 3)#yum install nginx -y 1) ...
随机推荐
- shiro安全框架和spring整合
上干货......... 整合spring的配置文件 <?xml version="1.0" encoding="UTF-8"?><beans ...
- 腾讯云Elasticsearch集群规划及性能优化实践
一.引言 随着腾讯云 Elasticsearch 云产品功能越来越丰富,ES 用户越来越多,云上的集群规模也越来越大.我们在日常运维工作中也经常会遇到一些由于前期集群规划不到位,导致后期业务增长集群 ...
- mysql-3-orderby
#进阶3:排序查询 /* 语法: SELECT FROM WHERE ORDER BY ASC|DESC */ USE myemployees; #案例1:查询员工信息,按工资从高到低排 SELECT ...
- Python实现的数据结构与算法之快速排序详解
一.概述 快速排序(quick sort)是一种分治排序算法.该算法首先 选取 一个划分元素(partition element,有时又称为pivot):接着重排列表将其 划分 为三个部分:left( ...
- 【题解】SP1811 LCS - Longest Common Substring
\(\color{purple}{Link}\) \(\text{Solution:}\) 题目要求找到两个串的最长公共子串.\(LCP\) 我们将两个串中间和末尾插入终止符,并弄到一棵后缀树上去. ...
- .net网站自动化部署-致两年前的遗留的问题
又到一年国庆,终于有了难得的几天空闲,计划陪陪媳妇娃子,再把最近阅读的几本相关书总结梳理下.当然,计划总是美好的,于时接到了一个老朋友电话.大意是他搞了一个.net小网站,部署了4个节点,每次更新程序 ...
- lambda函数小结
C++中的lambda函数 lambda函数是函数式编程中的概念,由C++11引入,成为现代C++中重要的特性. 所谓lambda函数就是匿名函数,语法结构: [capture list] (para ...
- 最大子段和之M子段和
最大M子段和 题目模型 N个整数组成的序列 \(a_1,a_2,a_3,-,a_n\) ,将这N个数划分为互不相交的M个子段,并且这M个子段的和是最大的. 问题分析 方法一: 看到序列,我们首先要尝试 ...
- linux(fedora30):安装/配置maven(maven3.6.1)
一,maven的用途 1,用途 Maven 是一个项目管理工具,主要用于项目构建,依赖管理,项目信息管理 maven可以用来: 帮用户下载jar包, 有依赖包时自动下载所需的依赖包 打包war包或ja ...
- centos8平台使用dnf/yum管理软件包
一,dnf的用途 centos7开始,DNF 成为了默认的软件包管理器,同时 yum 仍然是可用的 DNF包管理器克服了YUM包管理器的一些瓶颈,提升了用户体验,内存占用,依赖分析,运行速度等方面 D ...