centos7部署ELK测试
一、背景
学习ELK,动手实验。
参考:https://blog.csdn.net/qq_33406938/article/details/80307679
二、环境
虚拟机一台,已安装jdk1.8,nginx,ip:192.168.1.8。
三、步骤
1、配置limit.conf
[root@localhost ~]# vi /etc/security/limit.conf
* hard nofile 65536
* soft nofile 65536
* soft nproc 65536
* hard nproc 65536
2、配置sysctl.conf
[root@localhost ~]# vi /etc/sysctl.conf
...
vm.max_map_count = 262144
net.core.somaxconn=65535
net.ipv4.ip_forward = 1
...
[root@localhost ~]# sysctl -p
vm.max_map_count = 262144
net.core.somaxconn = 65535
net.ipv4.ip_forward = 1
3、关闭防火墙
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
[root@localhost ~]# iptables -F
4、配置清华镜像yum源
[root@localhost ~]# vi /etc/yum.repos.d/elk.repo
[elk]
name=elk
baseurl=https://mirrors.tuna.tsinghua.edu.cn/elasticstack/yum/elastic-6.x/
enable=1
gpgcheck=0
5、安装elasticsearch、logstash、kibana、filebeat、nodejs
[root@localhost ~]# yum install elasticsearch -y
[root@localhost ~]# yum install logstash -y
[root@localhost ~]# yum install kibana -y
[root@localhost ~]# yum install filebeat -y
[root@localhost ~]# yum install nodejs -y
6、配置elasticsearch.yml并启动elasticsearch服务
[root@localhost ~]# vi /etc/elasticsearch/elasticsearch.yml
...
cluster.name: elk-stack
node.name: elk.node1
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 0.0.0.0
http.port: 9200
discovery.zen.ping.unicast.hosts: ["192.168.1.8:9300"]
discovery.zen.minimum_master_nodes: 1
...
[root@elk ~]# systemctl start elasticsearch
[root@elk ~]# ss -ntlup| grep -E "9200|9300"
tcp LISTEN 0 65535 :::9200 :::* users:(("java",pid=16217,fd=234))
tcp LISTEN 0 65535 :::9300 :::* users:(("java",pid=16217,fd=209))
7、配置kibana.yml并启动kibana服务
[root@localhost ~]# vi /etc/kibana/kibana.yml
...
server.port: 5601
server.host: "0.0.0.0"
elasticsearch.url: "http://192.168.1.8:9200"
kibana.index: ".kibana"
...
[root@localhost ~]# systemctl start kibana
[root@localhost ~]# ss -ntlup | grep 5601
tcp LISTEN 0 511 *:5601 *:* users:(("node",pid=19513,fd=18))
8、配置logstash.yml,添加日志处理文件local_syslog.conf,启动logstash
[root@localhost ~]# vi /etc/logstash/logstash.yml
...
path.config: /etc/logstash/conf.d
...
添加日志处理文件:
[root@localhost ~]# vi /etc/logstash/conf.d/local_syslog.conf
input {
#filebeat客户端
beats {
port => 5044
}
}
#筛选
#filter { }
output {
# 输出到es
elasticsearch {
hosts => ["http://192.168.1.8:9200"]
index => "syslog-%{+YYYY.MM.dd}"
}
}
[root@localhost ~]# vi /etc/logstash/conf.d/local_syslog.conf
[root@localhost ~]# lsof -i:5044
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 17524 logstash 114u IPv6 149366 0t0 TCP *:lxi-evntsvc (LISTEN)
9、配置filebeat.yml并启动filebeat
[root@localhost ~]# vi /etc/filebeat/filebeat.yml
...
filebeat.inputs:
- type: log
enabled: true
paths:
- /var/log/messages
filebeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false
setup.template.settings:
index.number_of_shards: 3
output.logstash:
hosts: ["192.168.1.8:5044"]
...
[root@localhost ~]# systemctl start filebeat
至此,在浏览器中输入http://192.168.1.8即可访问ELK之kibana界面。
10、汉化kibana
[root@localhost ~]# yum install -y git
[root@localhost ~]# git clone https://github.com/anbai-inc/Kibana_Hanization.git
[root@localhost ~]# cd kibana_Hanization
#查看README.md文件,得到汉化方法为:拷贝translations`文件夹`到kibana目录下的`src/legacy/core_plugins/kibana/`目录
[root@localhost kibana_Hanization]# rsync -av --progress translations /usr/share/kibana/src/legacy/core_plugins/kibana
重启kibana:
[root@localhost ~]# systemctl restart kibana
[root@localhost ~]# ss -ntlup | grep 5601
tcp LISTEN 0 511 *:5601 *:* users:(("node",pid=19513,fd=18))
此时,用浏览器访问http://192.168.1.8:5601即可看到中文界面的kibana。
centos7部署ELK测试的更多相关文章
- centos7 部署 ELK 日志系统
=============================================== 2017/12/24_第3次修改 ccb_warlock 更 ...
- Centos7部署kubernetes测试k8s应用(九)
1.创建一个deployment [root@linux-node1 ~]# kubectl run net-test --image=alpine --replicas=2 sleep 360000 ...
- Centos7单机部署ELK+x-pack
ELK分布式框架作为现在大数据时代分析日志的常为大家使用.现在我们就记录下单机Centos7部署ELK的过程和遇到的问题. 系统要求:Centos7(内核3.5及以上,2核4G) elk版本:6.2. ...
- centos7.5部署ELk
第1章 环境规划 1.1 ELK介绍 ELK是ElasticSerach.Logstash.Kibana三款产品名称的首字母集合,用于日志的搜集和搜索. Elasticsearc ...
- centos7搭建ELK Cluster集群日志分析平台(四):Fliebeat-简单测试
续之前安装好的ELK集群 各主机:es-1 ~ es-3 :192.168.1.21/22/23 logstash: 192.168.1.24 kibana: 192.168.1.25 测试机:cli ...
- [原创]ubuntu14.04部署ELK+redis日志分析系统
ubuntu14.04部署ELK+redis日志分析系统 [环境] host1:172.17.0.4 搭建ELK+redis服务 host2:172.17.0.3 搭建logstash+nginx服务 ...
- centos7搭建ELK Cluster集群日志分析平台(三):Kibana
续 centos7搭建ELK Cluster集群日志分析平台(一) 续 centos7搭建ELK Cluster集群日志分析平台(二) 已经安装好elasticsearch 5.4集群和logst ...
- redis3.0集群部署和测试
redis3.0集群部署和测试 环境介绍 两台Centos7的虚拟机模拟6个节点,A台3个master节点,B台3个slave节点A地址:172.16.81.140B地址:172.16.81.141r ...
- centos7搭建ELK Cluster集群日志分析平台
应用场景:ELK实际上是三个工具的集合,ElasticSearch + Logstash + Kibana,这三个工具组合形成了一套实用.易用的监控架构, 很多公司利用它来搭建可视化的海量日志分析平台 ...
随机推荐
- kafka简介及集群部署
消息队列概念:(Message queue): “消息”是在两台计算机间传送的数据单位.消息可以非常简单,例如只包含文本字符串:也可以更复杂,可能包含嵌入对象. “消息队列”是在消息的传输过程中保存消 ...
- 三分钟快速搭建分布式高可用的Redis集群
这里的Redis集群指的是Redis Cluster,它是Redis在3.0版本正式推出的专用集群方案,有效地解决了Redis分布式方面的需求.当单机内存.并发.流量等遇到瓶颈的时候,可以采用这种Re ...
- 正则表达式在java中的用法
/** * 测试正则表达式的基本用法 Pattern 和 Matcher * @author 小帆敲代码 * */public class Demo01 { public static void m ...
- Java代码生成器多表配置优化,增加自定义实体功能
目录 前言 多表配置优化 自定义实体 杂谈 结语 前言 最近利用零碎的时间对代码生成器做了进一步更新:优化多表配置模块,增加自定义实体功能,美化单表和多表配置的UI界面,修复用户反馈的若干bug, ...
- Appium自动化(7) - 控件定位工具之Appium 的 Inspector
如果你还想从头学起Appium,可以看看这个系列的文章哦! https://www.cnblogs.com/poloyy/category/1693896.html 前言 上一篇文章介绍了另一块控件定 ...
- 曹工谈Spring Boot:Spring boot中怎么进行外部化配置,一不留神摔一跤;一路debug,原来是我太年轻了
spring boot中怎么进行外部化配置,一不留神摔一跤:一路debug,原来是我太年轻了 背景 我们公司这边,目前都是spring boot项目,没有引入spring cloud config,也 ...
- POJ3275 Ranking the Cows floyd的bitset优化
POJ3275 Ranking the Cows #include <iostream> #include <cstdio> #include <bitset> u ...
- Java基础之值传递
一.传递类型 我们从c语言开始学习程序设计语言时就知道,参数的传递类型一般有两种:值传递和引用传递.那么什么是值传递什么是引用传递呢? 值传递:指在调用方法时将实际参数的值拷贝一份传递给方法,这样方法 ...
- Django组件content-type使用方法详解
前言 参考博客:https://www.zhangshengrong.com/p/zD1yQJwp1r/ 一个表和多个表进行关联,但具体随着业务的加深,表不断的增加,关联的数量不断的增加,怎么通过一开 ...
- linux常用命令---rpm软件包管理
rpm软件包管理