4
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Elasticsearch + Kibana ローカル環境構築方法メモ

Posted at

Elasticsearch

  • Elastic社により開発されたJSONベースの検索/分析エンジン

Kibana

  • Elastic社により開発されたデータ可視化ツール
  • Elasticsearchと連携してグラフ描画などが可能

構築手順

  • docker-compose.yml用意

    version: "3.3"
    
    services:
      elasticsearch:
        image: docker.elastic.co/elasticsearch/elasticsearch:7.11.1
        container_name: elasticsearch
        environment:
          - discovery.type=single-node
          - cluster.name=docker-cluster
          - bootstrap.memory_lock=true
          - xpack.security.enabled=true
          - xpack.monitoring.collection.enabled=true
          - ELASTIC_PASSWORD=P@ssw0rd
          - "ES_JAVA_OPTS=-Xms512M -Xmx512M"
        ulimits:
          memlock:
            soft: -1
            hard: -1
        ports:
          - 9200:9200
        volumes:
          - elasticsearch-data:/usr/share/elasticsearch/data
        restart: always
      kibana:
        image: docker.elastic.co/kibana/kibana:7.11.1
        container_name: kibana
        ports:
          - 5601:5601
        environment:
          - ELASTICSEARCH_URL=http://elasticsearch:9200
          - ELASTICSEARCH_USERNAME=elastic
          - ELASTICSEARCH_PASSWORD=P@ssw0rd
        depends_on:
          - elasticsearch
        restart: always
    
    volumes:
      elasticsearch-data:
        driver: local
    
  • 起動

    docker-compose up -d
    

動作確認

  • http://localhost:5601にアクセス(ログイン画面が表示される)

  • docker-compose.ymlに記載の認証情報でログイン(次の画面が表示される)
    kibana.png

  • Dev toolsにアクセス

    kibana_devtool.png

  • コンソールに次のコマンドを張り付け、実行

    GET /_cat/nodes?v
    
    ip         heap.percent ram.percent cpu load_1m load_5m load_15m node.role  master name
    172.28.0.2           30          74   4    0.14    0.35     1.25 cdhilmrstw *      bd2adf4adca9
    

    ※nameにElasticsearchのコンテナIDが表示される。

参考情報

4
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?