Current location - Quotes Website - Signature design - How to install Elasticsearch, Logstash and Kibana on CentOS 7?
How to install Elasticsearch, Logstash and Kibana on CentOS 7?
The CPU, RAM and storage that your ELK server will need depends on the amount of logs you want to collect. In this tutorial, we will use VPS with the following specifications for the ELK server:

Operating system: CentOS 7

Memory: 4GB

Central processing unit: 2

Note: Resources are allocated according to each node's own server resources.

Install Java 8

Elasticsearch and Logstash need Java, so install it now. We will install the latest version of Oracle Java 8 because it is recommended by Elasticsearch.

Note: It is recommended to download the latest version of JDK locally and upload it to the /usr/local/src directory of the server.

# JDK download address:

/tech network/Java/Java se/downloads

123 123

Then use this yum command to install RPM (if you downloaded a different version, please replace the file name here):

yum-y local install JDK-8u 1 1 1-Linux-x64 . rpm

# Or

rpm-IVH JDK-8u 1 1 1-Linux-x64 . rpm 123 123

Now Java should be installed in/usr/Java/JDK1.8.0 _11/JRE/bin/Java and linked from /usr/bin/java.

Install Elasticsearch

Elasticsearch can be installed with the package manager by adding an elastic package repository.

Run the following command to import the Elasticsearch public gpg key into rpm:

#/resources/wiki/start/topics/tutorials/install/

echo '[nginx]

Name=nginx repurchase

base URL = http://nginx . org/packages/centos/$ release ver/$ base arch/

gpgcheck=0

Enabled = 1

| sudo tee/etc/yum . repos . d/nginx . repo 12345678 12345678

Use yum to install nginx and httpd-tools.

yum install nginx httpd-tools-y 1 1

Use htpasswd to create an administrator user named "kibanaadmin" (you can use other names) who can access the Kibana Web interface:

[root @ Linux probe ~]# htpasswd-c/etc/nginx/htpasswd . users kibana admin

New Password: # Custom

Retype the new password:

Add password for user kiba na admin12341234.

Use vim to configure nginx configuration file

[root @ Linux probe ~]# egrep-v " #|^$ "/etc/nginx/conf . d/ki Bana . conf

Server {

Listen to 80;

Server name kibana.aniu.co;

access _ log/var/log/nginx/ki Bana . aniu . co . access . log main;

error _ log/var/log/nginx/ki Bana . aniu . co . access . log;

Auth_basic "restricted access";

auth _ basic _ user _ file/etc/nginx/htpasswd . users;

Location/{

proxy _ pass http://localhost:560 1;

proxy _ http _ version 1. 1;

proxy _ set _ header Upgrade $ http _ Upgrade;

Proxy_set_header connection "upgrade";

proxy _ set _ header Host $ host

proxy _ cache _ bypass $ http _ upgrade;

}

} 123456789 10 1 1 12 13 14 15 16 17 123456789 10 1 / kloc-0/ 12 13 14 15 16 17