linux安装es-head插件

1.首先需要node.js环境,去http://nodejs.cn/download/下载

下载下来是.xz后缀的文件node-v12.13.0-linux-x64.tar.xz,

先使用xz -d node-v12.13.0-linux-x64.tar.xz将文件转换成node-v12.13.0-linux-x64.tar文件,在用tar xvf node-v12.13.0-linux-x64.tar解压

2.将nodejs加入环境变量,进入到nodejs的bin目录,pwd复制路径

修改配置文件vim /etc/profile

生效修改后的配置文件source /etc/profile

输入npm -version安装成功

3.安装cnpm

npm install -g cnpm --registry=https://registry.npm.taobao.org

cnpm install phantomjs-prebuilt@2.1.16 --ignore-scripts

grunt是一个很方便的构建工具,可以进行打包压缩、测试、执行等等的工作,5.0里的head插件就是通过grunt启动的。因此需要安装一下grunt:

cnpm install -g grunt-cli

cnpm install grunt --save-dev
grunt -version

grunt安装成功

4.下载elastichsearch-head插件
地址:https://github.com/mobz/elasticsearch-head 
安装git :yum install git 
git clone https://github.com/mobz/elasticsearch-head.git

安装elastichsearch-head插件
到elasticsearch-head目录下, 执行cnpm install 命令

5.修改配置

修改es目录下conf中的elasticsearch.yml,增加以下两行(跨越的配置)

http.cors.enabled: true
http.cors.allow-origin: "*"
修改完成后重启ES生效

修改es-head目录下的/Gruntfile.js,增加hostname属性,也可以自行更改监听地址

修改head的连接地址

在es-head的安装目录下_site/app.js,将这一行的localhost改成你的主机名或公网IP

this.base_uri = this.config.base_uri || this.prefs.get(“app-base_uri”) || “http://localhost:9200“;

把localhost修改成你es的服务器地址,如:

this.base_uri = this.config.base_uri || this.prefs.get(“app-base_uri”) || “http://192.168.19.105:9200“;

6.运行

前台运行./node_modules/grunt/bin/grunt server (直接运行)
后台运行nohup ./node_modules/grunt/bin/grunt server > es-head-start.log 2>&1 & (后台运行)
 
打开9100端口即可访问

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值