当前位置:网站首页>Establishment of elk log analysis system
Establishment of elk log analysis system
2022-07-28 01:52:00 【Clever little boy】
ELK brief introduction
What is a journal
Logs are generated by programs , Follow a certain format ( Usually contains a timestamp ) Text data .
ELK Common architectures
Elasticsearch + Logstash + Kibana
This is the simplest Architecture . This architecture , adopt logstash Collect the logs ,Elasticsearch Analysis log , And then in Kibana(web Interface ) Show in . Although this kind of architecture is introduced on the official website
Usually logs are generated by the server , Output to different files , There are usually system logs 、 Application log 、 Security log . These logs are stored on different machines .
Based on the environment :
operating system :Centos Linux release 7.4.1708
Turn off firewall 、selinux
sed -ri '/^[^#]*SELINUX=/s#=.+$#=disabled#' /etc/selinux/config
systemctl stop firewalld
systemctl disable firewalld
Host name resolution :192.168.100.10 ELK
Elasticsearch Deploy
add to yum Warehouse
add to yum Warehouse
vim /etc/yum.repos.d/elasticsearch.repo
[elasticsearch]
name=Elasticsearch repository for 8.x packages
baseurl=https://artifacts.elastic.co/packages/8.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
Download and install elasticsearch Of yum Source's key
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearchinstall elasticsearch
yum install -y elasticsearchinstall java Environmental Science
yum install -y java
[[email protected] /]# java -version
openjdk version "1.8.0_332"
OpenJDK Runtime Environment (build 1.8.0_332-b09)
OpenJDK 64-Bit Server VM (build 25.332-b09, mixed mode)
Modify the configuration file
vim /etc/elasticsearch/elasticsearch.yml
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 0.0.0.0
http.port: 9200
xpack.security.enabled: false
Create folder And authorize As above pat.data=
[[email protected] ]# mkdir /data/elasticsearch
[[email protected]]# chown -R elasticsearch:elasticsearch /data/elasticsearch/
start-up
systemctl daemon-reload
systemctl enable elasticsearch.service
systemctl start elasticsearch.service
start-up web test
ss -anpt |egrep "9200|9300"
LISTEN 0 128 :::9200 :::* users:(("java",pid=2053,fd=372))
LISTEN 0 128 :::9300 :::* users:(("java",pid=2053,fd=368))
ESTAB 0 0 ::ffff:127.0.0.1:9200 ::ffff:127.0.0.1:49888 users:(("java",pid=2053,fd=544))
ESTAB 0 0 ::ffff:127.0.0.1:9200 ::ffff:127.0.0.1:49698 users:(("java",pid=2053,fd=438))
web test :http://192.168.100.10:9200

Download and install logstash start-up logstash
yum install -y logstash
systemctl restart elasticsearchModify the configuration file
vim /etc/logstash/logstash-sample.conf
# Sample Logstash configuration for creating a simple
# Beats -> Logstash -> Elasticsearch pipeline.
input {
beats {
port => 5044
}
}
tcp {
mode => "server"
host => "0.0.0.0"
port => 4560
codec => json_lines
}
rabbitmq {
host=>"localhost"
vhost => "/"
port=> 5672
user=>"guest"
password=>"guest"
queue=>"station_Route"
durable=> true
codec=>json
}
output {
elasticsearch {
hosts => ["http://ip:9200"]
index => "rabbitmq-%{+YYYY.MM.dd}"
#user => "elastic"
#password => "changeme"
}
}
install kibana
yum install kibana.x86_64 -yModify the configuration file
vim /etc/kibana/kibana.yml
6 That's ok server.port: 5601
11 That's ok server.host: "0.0.0.0"
32 That's ok server.name: "test-kin"
43 That's ok elasticsearch.hosts: ["http://localhost:9200"]
114 That's ok i18n.locale: "zh-CN"
start-up kibana
systemctl start kibana.service
systemctl restart kibana.serviceThe visit address is :http://192.168.100.10:5601/

Click Browse by yourself


边栏推荐
- For newly installed PIP3, use no module named 'LSB_ Release 'problem
- VLAN experiment
- GBase 8c 事务ID和快照(四)
- GBase 8c 通用文件访问函数
- Interview question 01.08. Zero matrix
- Zhi Huijun, Huawei's "genius youth", has made a new work, building a "customized" smart keyboard from scratch
- 牛客多校第三场A,C+权值线段树
- Summary: Prometheus storage
- VLAN实验
- 物企大变局时代,SRM供应商采购系统助力企业打造物业采购数字化标杆
猜你喜欢
随机推荐
Qt 绘制系统简介
企业运维实践-使用Aliyun容器镜像服务对海外gcr、quay仓库镜像进行镜像拉取构建
C语言·指针
GBase 8c 服务器信号函数
unreal ue4.27 switchboard 移植出引擎流程
Cap principle of [distributed development]
Interview question 01.09. string rotation
A comprehensive case of crawler learning -- visiting websites
写给去不图床用户的一封信
普通设备能不能接入TSN时间敏感网络?
HRD 1. 一个简单而靠谱的HRD的检测方法
GBase 8c 备份控制函数(四)
Zhi Huijun, Huawei's "genius youth", has made a new work, building a "customized" smart keyboard from scratch
Leetcode: 515. Find the maximum value in each tree row
以“数字化渠道”撬动家用电器消费蓝海,经销商在线系统让企业生意更进一步
Summary: Prometheus storage
VPP之DPDK插件
Flink 在 讯飞 AI 营销业务的实时数据分析实践
leetcode: 515. 在每个树行中找最大值
实现OCR语言识别Demo(二)- 图片及识别内容的展现和交互









