标签:elk(elasticsearch5.0)head插件安装配置
elk升级部署到elasticsearch5.0后,安装elasticsearch-head插件遇到一个小问题:版本5.0以后,则不再elasticsearch/bin/plugin -install mobz/elasticsearch-head这种形式安装head插件,而是通过npm管理配置,步骤复杂了点。
head官网:https://github.com/mobz/elasticsearch-head#running-with-built-in-server
Running as a plugin of Elasticsearch Install elasticsearch-head: – for Elasticsearch 5.x: site plugins are not supported. Run elasticsearch-head as a standalone server #以独立服务运行
官网大致安装步骤:
git clone git://github.com/mobz/elasticsearch-head.git cd elasticsearch-head npm install grunt server open http://localhost:9100
具体流程;
1)下载并配置nodejs:
[root@elk ~]# xz -d node-v6.9.2-linux-x64.tar.xz [root@elk ~]# tar xf node-v6.9.2-linux-x64.tar -C /usr/local/ [root@elk ~]# cd /usr/local/ [root@elk local]# ln -s node-v6.9.2-linux-x64/ node [root@elk node]# cat /etc/profile.d/node.sh export nodePATH=/usr/local/node export PATH=$PATH:$nodePATH/bin export nodePATH PATH [root@elk node]# [root@elk ~]# node -v v6.9.2 [root@elk ~]#
2、下载elasticsearch-head插件并配置:
https://github.com/mobz/elasticsearch-head
yum install git -y [root@elk plugins]# git clonegit://github.com/mobz/elasticsearch-head.git [root@elk elasticsearch]# chown root.elsearch -Relasticsearch-head/ [root@elk elasticsearch]# chmod 775 elasticsearch-head/ -R 配置elasticsearch.yml: [root@elk elasticsearch]# cat config/elasticsearch.yml|grep -v"$^"|grep -v "#" node.name: hyxdelk network.host: 0.0.0.0 http.port: 9200 http.cors.enabled: true http.cors.allow-origin: "*" [root@elk elasticsearch]# #elasticsearch配置允许跨域访问,这样head插件可以访问es。 #http.cors.enabled: true #http.cors.allow-origin: "*"
3、npm 安装并修改head源代码(默认监听127.0.0.1):
grunt是一个很方便的构建工具,可以进行打包压缩、测试、执行等等的工作,5.0里的head插件就是通过grunt启动的。因此需要安装一下grunt:
# npm install -g grunt--registry=https://registry.npm.taobao.org # npm install -g grunt-cli [root@elk elasticsearch-head]# npm install #修改head源码: [root@elk _site]# cp app.js app.js.bak this.base_uri = this.config.base_uri ||this.prefs.get("app-base_uri") ||"http://192.168.1.225:9200"; [root@elk elasticsearch-head]# cp Gruntfile.js Gruntfile.js.bak hostname: ‘0.0.0.0‘, #hostname: ‘*‘,
4、后台启动grunt server并访问:
[root@elk elasticsearch-head]# ./node_modules/grunt/bin/gruntserver & ps aux|grep head|grep –v grep
http://192.168.1.225:9100 并连接 http://192.168.1.225:9200
本文出自 “永不放弃!任志远” 博客,请务必保留此出处http://renzhiyuan.blog.51cto.com/10433137/1888862
ELK(elasticsearch5.0)head插件安装配置
标签:elk(elasticsearch5.0)head插件安装配置
原文地址:http://renzhiyuan.blog.51cto.com/10433137/1888862