Centos7 安装 elasticsearch-head插件
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Centos7 安装 elasticsearch-head插件,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1985字,纯文字阅读大概需要3分钟。
内容图文
上车
Head是elasticsearch的集群管理工具,可以用于数据的浏览和查询。
elasticsearch-head是一款开源软件,被托管在github上面,所以如果我们要使用它,必须先安装git,通过git获取elasticsearch-head
运行elasticsearch-head会用到grunt,而grunt需要npm包管理器,所以nodejs是必须要安装的。
发车
git 拉下来
elasticsearch 5.0 之后,elasticsearch-head不做为插件放在其plugins目录下。使用git拷贝elasticsearch-head到本地
cd /wwwroot/soft/es-plugins
git clone git://github.com/mobz/elasticsearch-head.git
安装nodejs
去nodejs 官网下载最新的
解压:tar xvf node-v12.13.0-linux-x64.tar.xz
做2个软连接:
ln -s /wwwroot/soft/node-v12.13.0-linux-x64/bin/node /usr/bin/node
ln -s /wwwroot/soft/node-v12.13.0-linux-x64/bin/npm /usr/bin/npm
安装 grunt
npm install -g grunt-cli
安装 elasticsearch-head 依赖的包
cd elasticsearch-head
npm install
报错:Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2tar (child): bzip2:无法 exec: 没有那个文件或目录
解决: yum -y install bzip2.x86_64
报错:Error: EACCES: permission denied, link '/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1571667960384/phantomjs-2.1.1-linux-x86_64' -> '/wwwroot/soft/es-plugins/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom'
我大root居然有权限问题! 搜了下 github上说要加--unsafe-perm
rm -rf node_modules/ npm install --unsafe-perm
安装成功!
head修改配置
修改hostname
修改 Gruntfile.js 在connect-->server-->options下面添加:hostname:' ** ,允许所有IP可以访问
修改默认连接地址
修改elasticsearch-head默认连接地址,改成你自己的es地址
cd /wwwroot/soft/es-plugins/elasticsearch-head/_site
vim app.js
将4374行 this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://10.180.18.38:9201";
修改es
想在界面上看到es集群信息,必须在elasticsearch.yml增加两项配置,重启es
打开elasticsearch 的配置文件 elasticsearch.yml 在末尾加上:
http.cors.enabled: true
http.cors.allow-origin: "*"
到站
启动es
启动 elasticsearch-head nohup ./node_modules/grunt/bin/grunt server &
然后打开浏览器访问:
?
内容总结
以上是互联网集市为您收集整理的Centos7 安装 elasticsearch-head插件全部内容,希望文章能够帮你解决Centos7 安装 elasticsearch-head插件所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。