elasticsearch-head是els的界面插件,地址https://github.com/mobz/elasticsearch-head
1.进入github并下载
wget https://github.com/mobz/elasticsearch-head/archive/master.zip
2.解压
[[email protected] /usr/local/src]# unzip master.zip [[email protected] /usr/local/src]# mv elasticsearch-head-master/ /usr/local/ [[email protected] /usr/local/src]# ls /usr/local/elasticsearch-head-master/ Dockerfile elasticsearch-head.sublime-project grunt_fileSets.js LICENCE plugin-descriptor.properties README.textile src Dockerfile-alpine Gruntfile.js index.html package.json proxy _site test [[email protected] /usr/local/src]#
3.下载node
https://nodejs.org/en/download/
[[email protected] /usr/local/src]# wget https://nodejs.org/dist/v8.11.3/node-v8.11.3-linux-x64.tar.xz [[email protected] /usr/local/src]# tar -Jxvf node-v8.11.3-linux-x64.tar.xz -C /usr/local/ [[email protected] /usr/local/src]# mv /usr/local/node-v8.11.3-linux-x64/ /usr/local/node-8.11.3
4.配置node环境变量
[[email protected] /usr/local/src]# vim /etc/profile export NODE_HOME=/usr/local/node-8.11.3 export PATH=$PATH:$NODE_HOME/bin [[email protected] /usr/local/src]# source /etc/profile [[email protected] /usr/local/src]# node -v # 输出版本号则代表配置成功 v8.11.3 [[email protected] /usr/local/src]#
5.npm install
[[email protected] /usr/local/src]# cd /usr/local/elasticsearch-head-master/ [[email protected] /usr/local/elasticsearch-head-master]# npm install [email protected]2.1.14 --ignore-scripts # 因为有墙,phantomjs-prebuilt需要单独安装,不然会失败 [[email protected] /usr/local/elasticsearch-head-master]# npm install
6.需改配置
[[email protected] /usr/local/elasticsearch-head-master]# vim Gruntfile.js connect: { server: { options: { hostname: ‘0.0.0.0‘, # 增加这段 port: 9100, base: ‘.‘, keepalive: true } } } [[email protected] /usr/local/elasticsearch-head-master]#
7.开启els跨域
[[email protected] /usr/local/elasticsearch-head-master]# cd ../elasticsearch-5.5.2/config/ [[email protected] /usr/local/elasticsearch-5.5.2/config]# vim elasticsearch.yml # 文件末尾加上如下配置 http.cors.enabled: true http.cors.allow-origin: "*" [[email protected] /usr/local/elasticsearch-5.5.2/config]#
8.重启els
[[email protected] bin]$ ps -ef | grep ela [[email protected] bin]$ kill -9 10899 [[email protected] bin]$ ./elasticsearch -d
9.启动elasticsearch-head
[[email protected] elasticsearch-head-master]$ npm run start
10.访问
原文地址:https://www.cnblogs.com/chenyishi/p/10682454.html
时间: 2024-11-10 00:58:40