当前位置:网站首页>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


边栏推荐
- Unity 通用红点系统
- Dart 代码注释和文档编写规范
- 小散量化炒股记|量化系统中数据是源头,教你搭建一款普适的数据源框架
- Leetcode 2341. How many pairs can an array form
- Redis 5 种基本数据结构
- 牛客多校第三场A,C+权值线段树
- 实时数仓:美团的实时数仓建设实践
- How tormenting are weekly and monthly reports? Universal report template recommended collection! (template attached)
- HRD 1. 一个简单而靠谱的HRD的检测方法
- Discussion on PHP using some functions bypass WAF
猜你喜欢

Stock problems 5 times

Real time synchronization and conversion of massive data based on Flink CDC

Zhi Huijun, Huawei's "genius youth", has made a new work, building a "customized" smart keyboard from scratch

js 哪些情况不能用 JSON.parse 、JSON.stringify深拷贝及一个更好的深拷贝方法

Article reproduction: super resolution network fsrcnn

HRD 1. a simple and reliable HRD detection method

Enterprise operation and maintenance practice - using aliyun container image service to pull and build images of overseas GCR and quay warehouses

Content bypass sharing

企业运维实践-使用Aliyun容器镜像服务对海外gcr、quay仓库镜像进行镜像拉取构建

hypermesh 圆周阵列-插件
随机推荐
GBase 8c 注释信息函数
硬件SPI与软件模拟SPI速率对比
Leetcode 2351. the first letter that appears twice
路由策略简介
Software testing interview question: where do your performance testing requirements come from?
unreal ue4.27 switchboard 移植出引擎流程
"Do you" want to be a test / development programmer? We strive to sprout
GBase 8c 服务器信号函数
Data warehouse construction - DWS floor
阿门的故事
ue4 unreal NDisplay插件 简易使用 三折幕 详细...
LeetCode 第 302 场周赛
我的富二代朋友
2.2综合应用题-顺序表
【taichi】在太极中画出规整的网格
String
Prediction of charitable donation behavior by EEG multivariate model analysis
IIC read / write eefprom
存储成本降低 80%,有赞数据中台成本治理怎么做的?
The story of amen