[Self-written] EFK+ collect nginx log one-click deployment script instructions

Script and installation package [click to download]
4 centos7
192.168.59.130
jdk,zookeeper,kafka,filebeat, elasticsearch
192.168.59.131
jdk,zookeeper,kafka,logstash
192.168.59.132
jdk,zookeeper,kafka,kibana
192.168.59.133
one-click deployment

192.168.59.133 upload EFK script

Insert picture description here

Install ansible

yum search ansible
yum -y install centos-release-ansible-29.noarch
yum -y install ansible

Insert picture description here

Add manifest file

vim /etc/ansible/hosts
[EFK]
192.168.59.130
192.168.59.131
192.168.59.132

Insert picture description here

Do three ssh without password

ssh-keygen
ssh-copy-id root@192.168.59.130
ssh-copy-id root@192.168.59.131
ssh-copy-id root@192.168.59.132

Insert picture description here

Test the connection

ansible EFK -m ping

Insert picture description here

3 hosts modify the host name

第一台
hostnamectl set-hostname kafka1
第二台
hostnamectl set-hostname kafka2
第三台
hostnamectl set-hostname kafka3

Modify the ansible-playbook execution file

cd EFk
vim efk.yml

Insert picture description here

vim kafka.sh

Insert picture description here

vim elasticsearch.sh

Insert picture description here

vim kibana.sh

Insert picture description here

vim log_ng.sh

Insert picture description here

Perform ansible one-click deployment

ansible-playbook efk.yml

Insert picture description here
ab pressure test

ab -n100 -c100 http://192.168.59.130/

192.168.59.130 restart filebeat

systemctl restart filebeat

192.168.59.131 restart logstash

systemctl restart logstash

Web access 192.168.59.132::5601 For
Insert picture description here
Insert picture description here
other graphic settings, please refer to ELK installation and collection log blog
Script and installation package [click to download]

Guess you like

Origin blog.csdn.net/APPLEaaq/article/details/108985580