ELK搭建
一、建立swap空間
[root@jiaxin swap]# cd /mnt/swap/
[root@jiaxin swap]# dd if=/dev/zero of=swapfile bs=1M count=4096
[root@jiaxin swap]# mkswap swapfile
[root@jiaxin swap]# swapon swapfile
開現自掛載
[root@jiaxin swap]# vim /etc/fstab
/mnt/swap/swapfile swap swap defaults 0 0
讓系統積極使用swap空間
[root@jiaxin swap]# cat /proc/sys/vm/swappiness
0
[root@jiaxin swap]# vim /etc/sysctl.conf
vm.swappiness=100
[root@jiaxin swap]# sysctl -p
[root@jiaxin swap]# cat /proc/sys/vm/swappiness
100
安裝JDK
官網:https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
[root@jiaxin src]# wget https://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/jdk-8u191-linux-x64.tar.gz?AuthParam=1546066225_ea0f756f9c5ee46830a068eac225e345
[root@jiaxin src]# tar xf jdk-8u191-linux-x64.tar.gz
[root@jiaxin src]# mv jdk1.8.0_191/ /usr/java/jdk1.8
[root@jiaxin src]# vim /etc/profile
##################JDK########################
JDK_HOME=/usr/java/jdk1.8
JRE_HMOE=$JDK_HOME/jre
PATH=$PATH:$JDK_HOME/bin:$JRE_HOME/bin
CLASSPATH=.:$JDK_HOME/lib/dt.jar:$JDK_HOME/lib/tools.jar
[root@jiaxin src]# source /etc/profile
[root@jiaxin src]# java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
二、下載安裝kibana
官網:https://www.elastic.co/downloads/kibana
[root@jiaxin swap]# cd /usr/local/src/
[root@jiaxin src]# wget https://artifacts.elastic.co/downloads/kibana/kibana-6.5.4-linux-x86_64.tar.gz
[root@jiaxin src]# tar xf kibana-6.5.4-linux-x86_64.tar.gz
[root@jiaxin src]# mv kibana-6.5.4-linux-x86_64 /usr/local/kibana
[root@jiaxin src]# cd /usr/local/kibana/
[root@jiaxin kibana]# vim config/kibana.yml
server.port: 5601
server.host: "0.0.0.0"
elasticsearch.url: "http://localhost:9200"
kibana.index: ".kibana"
後臺執行kibana
[root@jiaxin kibana]# nohup ./bin/kibana &
訪問url:
http://47.99.89.247:5601/
Kibana server is not ready yet
正常~!
三、下載安裝elasticsearch
[root@jiaxin src]# wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.5.4.tar.gz
[root@jiaxin src]# tar xf elasticsearch-6.5.4.tar.gz
[root@jiaxin src]# mv elasticsearch-6.5.4 /usr/local/elasticsearch
[root@jiaxin src]# cd /usr/local/elasticsearch/
[root@jiaxin elasticsearch]# vim config/elasticsearch.yml
path.data: /path/to/data
path.logs: /path/to/logs
network.host: 0.0.0.0
http.port: 9200
[root@jiaxin local]# groupadd elasticsearch
[root@jiaxin local]# useradd -r -g elasticsearch elasticsearch
[root@jiaxin local]# chown -R elasticsearch:elasticsearch elasticsearch/
[root@jiaxin local]# chown -R elasticsearch:elasticsearch /path/
[root@jiaxin local]# vim /etc/security/limits.conf
* soft nofile 65536
* soft nofile 65536
* soft nofile 65536
* hard nofile 65536
[root@jiaxin local]# ulimit -u 4096
[root@jiaxin local]# vim /etc/sysctl.conf
vm.max_map_count = 262144
[root@jiaxin local]# sysctl -p
[root@jiaxin local]# vim /etc/security/limits.d/20-nproc.conf
* soft nproc unlimited
[root@jiaxin local]# su elasticsearch
bash-4.2$ cd elasticsearch/
bash-4.2$ ./bin/elasticsearch &
開啟URLhttp://47.99.89.247:5601/app/kibana#/home?_g=()
四、下載安裝logstash
[root@jiaxin src]# wget https://artifacts.elastic.co/downloads/logstash/logstash-6.5.4.tar.gz
[root@jiaxin src]# mv logstash-6.5.4 /usr/local/logstash
[root@jiaxin src]# cd /usr/local/logstash/
[root@jiaxin logstash]# vim config/logstash.yml
http.host: "0.0.0.0"
[root@jiaxin logstash]# vim nginx.conf
input {
beats {
port => 5044
}
}
output {
elasticsearch {
hosts => ["127.0.0.1:9200"]
index => "haha"
}
}
[root@jiaxin logstash]# ./bin/logstash -f nginx.conf
五、客戶端伺服器安裝 filebeat
[root@sannian src]# wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.5.4-linux-x86_64.tar.gz
[root@sannian src]# mv filebeat-6.5.4-linux-x86_64 /usr/local/filebeat
[root@sannian src]# cd /usr/local/filebeat/
[root@sannian filebeat]# vim filebeat.yml
filebeat.inputs:
- type: log
enabled: true
multiline.pattern: `^baseLog INFO`
multiline.negate: true
multiline.match: after
paths:
- /work/var/baseLog/*.log
filebeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false
setup.template.settings:
index.number_of_shards: 5
output.logstash:
hosts: ["47.99.89.247:5044"]
[root@sannian filebeat]# /usr/local/filebeat/filebeat -e -c /usr/local/filebeat/filebeat.yml
相關文章
- elk 搭建
- 搭建ELK叢集
- Docker搭建ELK叢集Docker
- ELK 搭建筆記--Docker 方式筆記Docker
- ELK6環境搭建
- ELK學習筆記之基於kakfa (confluent)搭建ELK筆記
- 使用 ELK 搭建日記系統
- Homestead 下搭建 ELK 踩坑日記
- 搭建ELK日誌平臺(單機)
- ELK+kafka docker快速搭建+.NetCore中使用KafkaDockerNetCore
- Centos7 ELK7.6.2叢集搭建CentOS
- 在Docker上搭建ELK+Filebeat日誌中心Docker
- ELK+FileBeat+Kafka搭建日誌管理平臺Kafka
- Windows 10環境簡單搭建ELK叢集Windows
- Windows環境下ELK簡單搭建記錄Windows
- 使用docker搭建ELK分散式日誌同步方案Docker分散式
- 利用ELK搭建Docker容器化應用日誌中心Docker應用日誌
- Windows系統搭建ELK日誌收集伺服器Windows伺服器
- Elk環境篇 --- 本地快速搭建你的ElasticSearch及KibanaElasticsearch
- 2023最新ELK日誌平臺(elasticsearch+logstash+kibana)搭建Elasticsearch
- ELK
- .NET Core + ELK搭建視覺化日誌分析平臺(上)視覺化
- 【筆記】草履蟲也能看懂的ELK搭建流程筆記
- ELK 系列三、ELK6.5.3 +xpack破解
- 【Elastic-1】ELK基本概念、環境搭建、快速開始文件AST
- Docker-compose搭建ELK環境並同步MS SQL Server資料DockerSQLServer
- ELK初探
- ELK部署
- 《Learning ELK Stack》1 ELK技術棧介紹
- SpringBoot 整合 elkSpring Boot
- ELK外掛
- ELK日誌
- ELK+kafka+Winlogbeat/FileBeat搭建統一日誌收集分析管理系統Kafka
- ELK搭建以及執行和ElasticStarch的詳細使用(7.X版本之上)AST
- [elk]基於elk的業務日誌格式設計
- 手把手教你搭建一套ELK日誌搜尋運維平臺運維
- 基於ELK搭建MySQL日誌平臺的要點和常見錯誤MySql
- ELK 安裝配置