您的位置:首页 > 其它

Elasticsearch之—— 5.X head插件安装实例

2017-09-05 23:08 639 查看
转载请注明出处:http://blog.csdn.net/l1028386804/article/details/77859098

1、下载Elasticsearch 5.5.1

下载地址:https://www.elastic.co/downloads/elasticsearch  


zip和tar格式是各种系统都通用的,解压之后启动Elasticsearch即可。

2、下载elasticsearch-head

在服务器上执行以下命令安装elasticsearch-head插件

wget https://codeload.github.com/mobz/elasticsearch-head/zip/master


3、下载node.js

nodejs官网下载地址https://nodejs.org/dist/

也可在服务器上执行如下命令下载node.js

wget https://nodejs.org/dist/v6.9.2/node-v6.9.2-linux-x64.tar.gz[/code] 

4、配置node环境变量

tar –zxvf node-v6.9.2-linux-x64.tar.gz
mv node-v6.9.2-linux-x64 /usr/local/node
vim /etc/profile
export NODE_HOME=/usr/local/node
export PATH=$PATH:$NODE_HOME/bin
source /etc/profile

# node –v
v6.9.2
# npm –v
3.10.9


5、安装grunt

cd elasticsearch-head-master
npm install -g grunt --registry=https://registry.npm.taobao.org


6、测试

cd elasticsearch-head-master
grunt
出现以下提示,为Gruntfile.js引用的,缺少以下包
>> Local Npm module "grunt-contrib-clean" not found. Is it installed?
>> Local Npm module "grunt-contrib-concat" not found. Is it installed?
>> Local Npm module "grunt-contrib-watch" not found. Is it installed?
>> Local Npm module "grunt-contrib-connect" not found. Is it installed?
>> Local Npm module "grunt-contrib-copy" not found. Is it installed?
>> Local Npm module "grunt-contrib-jasmine" not found. Is it installed?
Warning: Task "connect:server" not found. Use --force to continue.
Aborted due to warnings.
安装缺少的依赖

npm install grunt-contrib-clean --registry=https://registry.npm.taobao.org
npm install grunt-contrib-concat --registry=https://registry.npm.taobao.org
npm install grunt-contrib-watch --registry=https://registry.npm.taobao.org
npm install grunt-contrib-connect --registry=https://registry.npm.taobao.org
npm install grunt-contrib-copy --registry=https://registry.npm.taobao.org
npm install grunt-contrib-jasmine --registry=https://registry.npm.taobao.org
此时运行如下命令

grunt server
启动成功。

7、修改Elasticsearch配置文件

编辑elasticsearch-5.5.1/config/elasticsearch.yml,加入以下内容:

http.cors.enabled: true
http.cors.allow-origin: "*"
bootstrap.system_call_filter: false


8、修改Gruntfile.js

打开elasticsearch-head-master/Gruntfile.js,找到下面connect属性,新增hostname: '0.0.0.0':

connect: {
server: {
options: {
hostname: '0.0.0.0',
port: 9100,
base: '.',
keepalive: true
}
}
}


9、重启启动es,重启启动head插件

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: