Elasticsearch and Kibana deployment and use

Copyright: https: //shirukai.github.io/ | https://blog.csdn.net/shirukai/article/details/85212727

Elasticsearch and Kibana deployment and use

Installation Environment

Mac OS for Linux

Imprint

Elasticsearch:6.4.0

Kibana: 6.4.0

1 Elasticsearch deployment and use

Official website: https://www.elastic.co/

1.1 download Elasticsearch

Download: https://www.elastic.co/downloads/elasticsearch

Select the appropriate version of the system environment download, download Mac 6.4.0 version here (Linux general)

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.4.0.tar.gz

Decompression

tar -zxvf elasticsearch-6.4.0.tar.gz

1.2 Configuration

Profile location elasticsearch-6.4.0 / config, modify the file elasticsearch.yml

vi elasticsearch.yml

Modifications are as follows:

bootstrap.system_call_filter: false
network.host: 0.0.0.0

Description:

  • bootstrap.system_call_filter: false # prevent the system does not support SecComp error

  • network.host: 0.0.0.0 # Bind IP

1.3 Starting Services

Start in elasticsearch-6.4.0 / bin directory

nohup ./elasticsearch >elastic.out &

After the service starts access address http://192.168.1.196:9200/:

1.4 simple to use

1.4.1 Add index Library

Service address http://192.168.1.196:9200/, command line execution

curl -XPUT 'http://192.168.1.196:9200/test_es'

Results of the:

{"acknowledged":true,"shards_acknowledged":true,"index":"test_es"}

1.4.2 View index Library

curl -XGET 'http://192.168.1.196:9200/_search'

result:

{
    "took": 184,
    "timed_out": false,
    "_shards": {
        "total": 5,
        "successful": 5,
        "skipped": 0,
        "failed": 0
    },
    "hits": {
        "total": 0,
        "max_score": null,
        "hits": []
    }
}

1.4.3 Creating an index

curl -XPOST 'http://192.168.1.196:9200/test_es/student/1' -H 'Content-Type:application/json' -d '{
    "name":"test",
    "age":5,
    "interests":["Spark","Hadoop"]
}'

Results of the:

{
    "_index": "test_es",
    "_type": "student",
    "_id": "1",
    "_version": 1,
    "result": "created",
    "_shards": {
        "total": 2,
        "successful": 1,
        "failed": 0
    },
    "_seq_no": 0,
    "_primary_term": 1
}

1.4.4 query index

curl -XGET 'http://192.168.1.196:9200/_search?pretty'

Results of the:

{
  "took" : 19,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : 1,
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : "test_es",
        "_type" : "student",
        "_id" : "1",
        "_score" : 1.0,
        "_source" : {
          "name" : "test",
          "age" : 5,
          "interests" : [
            "Spark",
            "Hadoop"
          ]
        }
      }
    ]
  }

1.4.7 Delete Index

curl -XDELETE 'http://192.168.1.188:9200/wwaes'
{"acknowledged":true}

2 Kibana deployment and use

2.1 download Kibana

Download: https://www.elastic.co/downloads/kibana

Select the appropriate version of the system environment download, download Mac 6.4.0 version here (Linux, select the appropriate version)

wget https://artifacts.elastic.co/downloads/kibana/kibana-6.4.0-darwin-x86_64.tar.gz

Decompression

tar -zxvf kibana-6.4.0-darwin-x86_64.tar.gz

2.2 Configuration

Profile location kibana-6.4.0-darwin-x86_64 / config, modify the file kibana.yml

vi kibana.yml

Modifications are as follows:

server.port: 5601
server.host: "0.0.0.0"

Description:

  • server.port: 5601 # port services
  • server.host # IP Services

2.3 Start Service

Start in kibana-6.4.0-darwin-x86_64 / bin directory

nohup ./kibana >kibana.out &

After the service starts access address http://192.168.1.196:5601/:

Guess you like

Origin blog.csdn.net/shirukai/article/details/85212727