Elasticsearch-head插件安装

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
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容