Elk 6.2.3 Environment Construction-01

Source: Internet
Author: User
Tags root directory kibana logstash elasticsearch kibana
One: Elk Introduction

Log Collection View service. Based on three components, Elasticsearch, Logstash, Kibana. I'm using the elk is 6.2.3 download three components are 6.2.3 two: Elk download

Official address: http://www.elastic.co/cn/downloads download Elasticsearch Kibana Logstash
The download addresses are: Elasticsearch https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.4.tar.gz Kibana https://artifacts.elastic.co/downloads/kibana/kibana-6.2.4-linux-x86_64.tar.gz Logstash https:// Artifacts.elastic.co/downloads/logstash/logstash-6.2.4.tar.gz

I was a 6.2.3 when I downloaded the afternoon, the official website was 6.2.4, but this does not affect

extract three packages to the same folder, but not required, three items do not have a folder dependency Three: Elk installation 3.1 Elasticsearch Installation

3.1.1 Decompression Elasticsearch After entering the root directory, enter the Config folder directory, open elasticsearch.yml add a row at the bottom

network.host:0.0.0.0 # #表示允许其他机子访问, otherwise only native access

It's good to be here. and then run.

3.1.2 into the root directory under the bin directory

>>./elasticsearch    # # Direct Run
>>./elasticsearch-d # # background Run

3.1.3 Test

Open Browser Input: http://127.0.0.1:9200 (or your host IP) can see some basic information of ES. To test again.

On the Linxu.

Curl-xput-h ' content-type ': ' Application/json '-d ' {"name": "John Doe"} ' Localhost:9200/customer/external/1?pretty '

Then the http://127.0.0.1:9200/customer/external/1?pretty on the browser will be able to see the information.

To this end. 3.2 Kibana Installation

3.2.1:
Unzip the Kibana into the root directory, enter the Config directory, open kibana.yml add

server.port:5601  # # # IP Access Port
server.host: "0.0.0.0"
elasticsearch.url: "http://127.0.0.1:9200"  # # Es address
kibana.index: ". Kibana"

3.2.2 into the bin directory, run open Kibana

>> nohup./kibana &  
>> tail-f nuhup.out

3.2.3, open the browser into http://127.0.0.1:5601 is Kibana browser page. Click Discover and if ES is configured, you will be able to see customer related information. The customer is the index above the ES Plus. 3.3 Logstash Installation

3.3.1 into the Logstash directory, create the ETC folder, the newly created folder

/main/app/elk/logstash-6.2.3/etc the file.

Enter the ETC directory to create a file test.conf add content

Input {
  file {
    type = "nginx-access"
    Path = = ["/main/logs/*.log"]
    start_position = " Beginning "
  }
}


output {
  Elasticsearch {
        hosts = = [" 127.0.0.1:9200 "]
        index =" Logstash-%{type}-%{+yyyy. MM.DD} "
        Document_type ="%{type} "
  }
}

Then create a random file:
The contents of the/main/logs/a.log file are:

IPORHOST:CLIENT_IP, Aaa,aaaaaaaaaaad,user:auth:

as
 iporhost:client_ip,as
CAA

SD
ASD

3.3.2 finally starts the Logstash and enters the bin directory of the Logstash home directory. Run:

>> nohup bin/logstash-f etc/&

3.3.3 then enter the Kibana's browser directory to see the corresponding index.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.