Elasticsearchのビジュアル化プラグイン


前言
ESの可視化プラグインは2種類あり、1つはElasticsearch-Headプラグイン(推奨使用)、もう1つはESの公式プラグインKibana
Elasticsearch-Headプラグイン
githubアドレス:https://github.com/mobz/elast... 5.xバージョンではheadプラグインの直接インストールはサポートされていません.サービスを開始する必要があります.
Elasticクラスタ(Cluster)とインタラクティブなWebフロントです.ESクラスタのトポロジー構造を示し、インデックス(Index)とノード(Node)レベルの操作を行うことができます.クラスタに対するクエリーAPIのセットを提供し、結果をjsonと表形式で返してクラスタの様々な状態を示すショートカットメニューを提供します.
1.NodeJSのインストール
$ curl -O https://nodejs.org/dist/v8.11.3/node-v8.11.3-linux-x64.tar.gz
$ tar -zxvf node-v8.11.3-linux-x64.tar.gz
$ mv node-v8.11.3-linux-x64 /usr/local/node

$ vim ~/.bash_profile #        ,       
 
$ vim /etc/profile #        ,      

export NODE_HOME=/usr/local/node
export PATH=$PATH:$NODE_HOME/bin

$ source ~/.bash_profile    source /etc/profile #       (       source    ,    )
$ node -v
$ npm -v

2.headカードのインストール
$ git clone git://github.com/mobz/elasticsearch-head.git
$ cd elasticsearch-head
$ npm install -g grunt --registry=https://registry.npm.taobao.org
$ npm install
$ npm run start
$ nohup npm run start & #     
$ curl -X GET http://localhost:9100/

アクセス:http://localhost:9100 またはhttp://localhost:9100?base_uri=http://localhost:9200(base_uriはESの接続先)
elasticsearchが表示されている場合は接続されていません.elasticsearchを構成し、elasticsearchを再起動する必要があります.
$ vim elasticsearch/config/elasticsearch.yml

# 1.        "0.0.0.0"
network.host: "0.0.0.0"
# 2.         
http.cors.enabled: true
http.cors.allow-origin: "*"

3.起動
#   
$ cd elasticsearch-head
$ nohup npm run start & #     

#   
$ netstat -anp |grep 9100 #       pid
$ ps -ef | head -1;ps -ef | grep grunt #      pid,(elasticsearch-head    grunt server)
$ kill 87523 #       pid(  id)


4.head使用チュートリアル
Elasticsearch-headの使用:https://www.cnblogs.com/xuwen...
単一ノードElasticsearchにunassigned_が表示されます.shardsの原因と解決方法:https://blog.csdn.net/x460988.... Unassignedは、作成したインデックスにコピーが設定されているためですが、コピーはサブ(スレーブ)ノードのみで、単一ノードクラスタではUnassignedが表示されます.インデックスのコピーが0の場合、Unassignedはありません.あるいはクラスタが複数のノードを使用しても、このエラーを解消することができます.
二Kibanaカード
公式ドキュメント:https://www.elastic.co/guide/... チュートリアルを使用:https://www.cnblogs.com/moonl...ES公式提供のWEBインタフェース
$ curl -O https://artifacts.elastic.co/downloads/kibana/kibana-5.6.9-linux-x86_64.tar.gz
$ sha1sum kibana-5.6.9-linux-x86_64.tar.gz 
$ tar -xzf kibana-5.6.9-linux-x86_64.tar.gz
$ cd kibana-5.6.9-linux-x86_64/
#  
$ ./bin/kibana
$ nohup ./bin/kibana & #     

#  
$ ps -ef | grep node #   kibana pid(./bin/../node/bin/node --no-warnings ./bin/../src/cli)
$ kill pid

アクセス:http://127.0.0.1:5601/またはcurl-X GET'http://127.0.0.1:5601'外部ネットワークがアクセスできないことを解決する:
$ vim ./config/kibana.yml 
       "0.0.0.0"  
network.host: "0.0.0.0"