ES的可视化插件有两种,一种是Elasticsearch-Head插件(推荐使用),另外一种是ES的官方插件 Kibanahtml
github地址: https://github.com/mobz/elast...
在5.x版本中不支持直接安装head插件,须要启动一个服务。node
是一个与Elastic集群(Cluster)相交互的Web前台。
它展示ES集群的拓扑结构,而且能够经过它来进行索引(Index)和节点(Node)级别的操做
它提供一组针对集群的查询API,并将结果以json和表格形式返回
它提供一些快捷菜单,用以展示集群的各类状态linux
$ 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
$ 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的链接地址) git
若是显示elasticsearch未链接。则须要配置elasticsearch,而后重启elasticsearchgithub
$ 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: "*"
# 启动 $ 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)
elasticsearch-head的使用 :https://www.cnblogs.com/xuwen...docker
单节点Elasticsearch出现unassigned_shards的缘由及解决办法:https://blog.csdn.net/x460988...。
Unassigned 是由于建立的索引设置了副本,然而副本只能在副(从)节点上,而用单节点集群则会出现Unassigned。若是索引的副本为0,则不会有Unassigned。或者集群使用多个节点也是能够消除这个错误的。npm
官方文档:https://www.elastic.co/guide/...
使用教程:https://www.cnblogs.com/moonl...
ES官方提供的WEB界面json
$ 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
$ vim ./config/kibana.yml 修改以下参数为"0.0.0.0"便可 network.host: "0.0.0.0"