0
0

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 5 years have passed since last update.

Elasticsearchを使う準備

Last updated at Posted at 2017-08-05

ゴール

Elasticsearchのヘルスチェック

はじめに

  • elasticsearchの導入
.sh
$ brew install elasticsearch
$ echo "export ELASTICPATH=/usr/local/Cellar/elasticsearch/5.5.1/libexec/bin" >> .bashrc
# 起動
$ elasticsearch
# 確認
$ curl localhost:9200
{
  "name" : "MDffy-a",
  "cluster_name" : "elasticsearch_naopon",
  "cluster_uuid" : "Dzj28enNSkyAig0sZkyQZQ",
  "version" : {
    "number" : "5.5.1",
    "build_hash" : "19c13d0",
    "build_date" : "2017-07-18T20:44:24.823Z",
    "build_snapshot" : false,
    "lucene_version" : "6.6.0"
  },
  "tagline" : "You Know, for Search"
}

# cluster nameはここで設定されている
$ vim /usr/local/Cellar/elasticsearch/5.5.1/libexec/config/elasticsearch.yml
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: elasticsearch_naopon

# clusterの確認
$ curl localhost:9200/_cat/health?v
epoch      timestamp cluster              status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1501895954 10:19:14  elasticsearch_naopon yellow          1         1      1   1    0    0        1             0                  -                 50.0%
# indexの確認
$ curl localhost:9200/_cat/indices?v
health status index   uuid                   pri rep docs.count docs.deleted store.size pri.store.size
yellow open   .kibana oFN9CZzIRASC5Eww1FFW0Q   1   1          1            0      3.1kb          3.1kb
  • clusterのstatus

The cluster health status is: green, yellow or red. On the shard level, a red status indicates that the specific shard is not allocated in the cluster, yellow means that the primary shard is allocated but replicas are not, and green means that all shards are allocated.

  • kibana導入
.sh
$ mkdir ~/kibana && cd $_
$ wget https://artifacts.elastic.co/downloads/kibana/kibana-5.5.1-darwin-x86_64.tar.gz
$ tar zxvf kibana-5.5.1-darwin-x86_64.tar.gz
$ cd kibana-5.5.1-darwin-x86_64
$ bin/kibana

http://localhost:5601/ でアクセス

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?