1、安装elasticsearch-6.6.2.rpm
systemctl stop firewalld
setenforce 0
vim /etc/security/limits.conf
-
soft nofile 65535
-
soft nproc 65535
-
hard nofile 65535
-
hard nproc 65535
vim /etc/sysctl.conf
vm.max_map_coun=655350
unzip ELK.zip
cd ELK
rpm -ivh jdk-8u131-linux-x64_.rpm
java -version
yum -y install elasticsearch-6.6.2.rpm
systemctl daemon-reload
systemctl enable elasticsearch.service
cd /etc/elasticsearch/
vim elasticsearch.yml
cluster.name: wg
node.name: node-1
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 192.168.98.134
http.port: 9200
systemctl start elasticsearch
tailf /var/log/elasticsearch/gc.log.0.current
netstat -nlpt | grep java
2、安装logstash-6.6.0.rpm
systemctl stop firewalld
setenforce 0
vim /etc/security/limits.conf
-
soft nofile 65535
-
soft nproc 65535
-
hard nofile 65535
-
hard nproc 65535
vim /etc/sysctl.conf
vm.max_map_coun=655350
unzip ELK.zip
cd ELK
rpm -ivh jdk-8u131-linux-x64_.rpm
java -version
yum -y install logstash-6.6.0.rpm
cd /etc/logstash/conf.d/
vim messages.conf
input {
file {
path => “/var/log/messages”
type => “messages-log”
start_position => “beginning”
}
}
output {
elasticsearch {
hosts => “192.168.98.134:9200”
index => “messages_log-%{YYYY.MM.dd}”
}
}
systemctl start logstash
ll(tailf logstash-plain.log)
chmod -R 777 /var/log/
vim /etc/logstash/conf.d/messages.conf
input {
file {
path => “/var/log/messages”
type => “messages-log”
start_position => “beginning”
}
}
output {
elasticsearch {
hosts => “192.168.98.134:9200”
index => “messages_log-%{+YYYY.MM.dd}”
}
}
systemctl restart logstash
3、安装kibana-6.6.2-x86_64.rpm
yum -y install kibana-6.6.2-x86_64.rpm
cd /etc/kibana/
vim kibana.yml
server.port: 5601
server.host: “192.168.98.134”
elasticsearch.hosts: [“http://192.168.98.134:9200”]
systemctl start kibana
netstat -nlptu | grep 5601
网页访问:http://192.168.98.134:5601/