Step‑by‑Step Guide to Install a Single‑Node EFK Stack (Elasticsearch, Filebeat, Kibana)
This tutorial walks you through preparing a CentOS 7 environment, installing and configuring Elasticsearch, Kibana, and Filebeat on single‑node servers, adjusting JVM settings, starting services, disabling firewalls, verifying the stack with curl, and setting up Kibana index patterns for log visualization.
EFK Installation (Single Node) – Elasticsearch, Filebeat, Kibana
Prerequisites: JDK 17 installed, CentOS 7, at least 2 GB RAM, and network access to the target IPs.
192.168.25.149 – Elasticsearch + Kibana (CPU 2, 2 GB RAM)
192.168.25.148 – Filebeat (CPU 2, 2 GB RAM)
1. Install Elasticsearch on 192.168.25.149
Configure the Elastic yum repository, import the GPG key, and install the package.
# Configure Elastic official repository
sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
sudo tee /etc/yum.repos.d/elastic.repo <<EOF
[elasticsearch]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
EOF # Install Elasticsearch
sudo yum install -y elasticsearch
# Edit /etc/elasticsearch/elasticsearch.yml
cluster.name: elk-cluster
node.name: node-1
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 192.168.25.149
http.port: 9200
discovery.type: single-node
# Adjust JVM heap (server has only 2 GB RAM)
sudo vim /etc/elasticsearch/jvm.options
-Xms512m
-Xmx512mStart and enable the service, stop the firewall, and verify the installation.
# Reload systemd, enable and start Elasticsearch
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch
sudo systemctl start elasticsearch
# Disable firewalld (optional)
systemctl stop firewalld
# Verify
curl http://192.168.25.149:92002. Install Kibana on 192.168.25.149
# Install Kibana
sudo yum install -y kibana
# Edit /etc/kibana/kibana.yml
server.port: 5601
server.host: "192.168.25.149"
elasticsearch.hosts: ["http://192.168.25.149:9200"]
i18n.locale: "zh-CN" # Chinese UIEnable and start Kibana.
# Enable and start Kibana
sudo systemctl enable kibana
sudo systemctl start kibana3. Install Filebeat on 192.168.25.148
Configure the Elastic yum repository (same as above) and install Filebeat.
# Install Filebeat
sudo yum install -y filebeat
# Edit /etc/filebeat/filebeat.yml
filebeat.inputs:
- type: log
enabled: true
paths:
- /usr/loca/project/wcc/logs/info.log
tags: ["info"]
fields:
logtype: info
fields_under_root: true
- type: log
enabled: true
paths:
- /usr/loca/project/wcc/logs/error.log
tags: ["error"]
fields:
logtype: error
fields_under_root: true
output.elasticsearch:
hosts: ["192.168.25.149:9200"]
indices:
- index: "wcc-info-%{+yyyy.MM.dd}"
when.equals:
logtype: "info"
- index: "wcc-error-%{+yyyy.MM.dd}"
when.equals:
logtype: "error"
setup.template.name: "wcc"
setup.template.pattern: "wcc-*"
setup.ilm.enabled: falseEnable and start Filebeat.
# Enable and start Filebeat
sudo systemctl enable filebeat
sudo systemctl start filebeat4. Configure Kibana Index Pattern
Open a browser and navigate to http://192.168.25.149:5601. In Kibana go to Stack Management → Index Patterns , create a new pattern wcc-*, and select @timestamp as the time field.
After the index pattern is created, you can explore logs via the Discover tab and build visualizations on the dashboard.
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.
