elasticsearch-head插件
安装node.js
https://nodejs.org/dist/latest-v6.x/node-v6.17.1-linux-x64.tar.gz
tar -zxf node-v6.17.1-linux-x64.tar.gz
mv node-v6.17.1-linux-x64 /usr/local/node
echo 'export NODE_HOME=/usr/local/node' >> /etc/profile.d/node.sh
echo 'export PATH=$PATH:$NODE_HOME/bin' >> /etc/profile.d/node.sh
source /etc/profile
wget https://codeload.github.com/mobz/elasticsearch-head/zip/master
mv master master.zip
unzip master.zip
mv elasticsearch-head-master/ /usr/local/es-head
cd /usr/local/es-head/
npm install -g grunt --registry=https://registry.npm.taobao.org
npm install
grunt server
配置elasticsearch
echo 'http.cors.enabled: true' >> elasticsearch.yml
echo 'http.cors.allow-origin: "*"' >> elasticsearch.yml
配置elasticsearch-head
vim Gruntfile.js
connect: {
server: {
options: {
hostname: '0.0.0.0',
port: 9100,
base: '.',
keepalive: true
}
}
}
启动elasticsearch-head
cd elasticsearch-head-master
#执行
grunt server
#输出
>> Local Npm module "grunt-contrib-jasmine" not found. Is it installed?
Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:9100
设置后台启动
vim elasticsearch-head_start.sh
#!/bin/bash
echo "START elasticsearch-head "
cd /usr/local/es-head/
nohup grunt server &exit
vim elasticsearch-head_stop.sh
#!/bin/bash
echo "STOP elasticsearch-head "
cd /usr/local/es-head/
ps -ef | grep grunt | grep -v grep | awk '{print $2}' | xargs kill -9