一 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。或者集羣使用多個節點也是能夠消除這個錯誤的。