一 Elasticsearch-Head 插件node
github地址: https://github.com/mobz/elast…
在5.x版本中不支持直接安装head插件,须要启动一个服务。linux
是一个与Elastic集群(Cluster)相交互的Web前台。
它展示ES集群的拓扑结构,而且能够经过它来进行索引(Index)和节点(Node)级别的操做
它提供一组针对集群的查询API,并将结果以json和表格形式返回
它提供一些快捷菜单,用以展示集群的各类状态git
1. 安装NodeJSgithub
$ 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插件npm
$ 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的链接地址)json
若是显示elasticsearch未链接。则须要配置elasticsearch,而后重启elasticsearchvim
3. 启动segmentfault
# 启动 $ 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。或者集群使用多个节点也是能够消除这个错误的。