Step-by-Step Guide to Deploy ELK Stack with Kibana, Logstash, and Filebeat on Linux
This guide walks through configuring the firewall, installing Kibana, Logstash, and Elasticsearch, setting up SSL certificates, forwarding ports, deploying Filebeat to client servers, and verifying the ELK stack operation on Linux, complete with command examples and screenshots.
Open firewall for Kibana
firewall-cmd --permanent --add-port=5601/tcp
firewall-cmd --reload
firewall-cmd --list-allVerify that port 5601 appears in the listed ports.
Install and start Kibana
yum localinstall kibana-4.5.1-1.x86_64.rpm -y
systemctl enable kibana
systemctl start kibana
systemctl status kibanaCheck that Kibana is running (listening on port 5601) and open http://<em>your‑host</em>:5601/ in a browser.
Forward port 80 to 5601
firewall-cmd --permanent --add-forward-port=port=80:proto=tcp:toport=5601
firewall-cmd --reloadInstall Logstash and generate SSL certificates
yum localinstall logstash-2.3.2-1.noarch.rpm -y
cd /etc/pki/tls/
openssl req -subj '/CN=elk.test.com/' -x509 -days 3650 -batch -nodes -newkey rsa:2048 -keyout private/logstash-forwarder.key -out certs/logstash-forwarder.crtCreate Logstash configuration (listening on port 5000)
Place the configuration file in /etc/logstash/conf.d/ and ensure it defines input on port 5000.
Open firewall for Logstash port 5000
firewall-cmd --permanent --add-port=5000/tcp
firewall-cmd --reloadConfigure Elasticsearch
# Example /etc/elasticsearch/es-01/elasticsearch.yml
http:
port: 9200
network:
host: elk.test.com
node:
name: elk.test.com
path:
data: /etc/elasticsearch/data/es-01Restart Elasticsearch and Logstash services
systemctl restart elasticsearch
systemctl restart logstashDeploy Filebeat to client nodes
scp filebeat-1.2.3-x86_64.rpm [email protected]:/root/elk
scp filebeat-1.2.3-x86_64.rpm [email protected]:/root/elk
scp logstash-forwarder.crt rsyslog.test.com:/root/elk
scp logstash-forwarder.crt nginx.test.com:/root/elkInstall and configure Filebeat on each client
yum localinstall filebeat-1.2.3-x86_64.rpm -y
cp logstash-forwarder.crt /etc/pki/tls/certs/
# Edit filebeat.yml to point to the Logstash server and configure desired log files in conf.d/*.yml
service filebeat start
chkconfig filebeat onUse netstat -altp to confirm that Filebeat is listening and that connections to the ELK server are established.
Verify the setup
Open http://192.168.30.67:5601/ in a browser; the Kibana dashboard should display logs collected from the client nodes.
View system logs on the two machines (node1 and node2) to confirm that logs are being forwarded and indexed correctly.
Overall experience: the ELK stack provides a fast, integrated solution for log collection, storage, and visualization, and can be extended with Kafka for scalable log pipelines.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
