ELK(三)--CentOS安装elasticsearch-head

3 篇文章 0 订阅

一:安装Git(如果未安装)

1, yum install git
2, git  --version  #查看版本

二:安装node(如果未安装)

https://blog.csdn.net/zhuwei_clark/article/details/89521181

三:安装grunt(如果未安装,head插件的启动使用grunt)

   npm install -g grunt-cli  #安装grunt命令行工具grunt-cli

   npm install grunt --save-dev  #安装grunt及其插件

  grunt -version   #查看安装版本情况  

四:下载并安装elasticsearch-head

# 选择一个目录下执行下面命令,别把head插件clone后放到 elasticsearch的plugins目录下,否则会报错

git clone git://github.com/mobz/elasticsearch-head.git   #git下载

cd elasticsearch-head  #进入目录

npm install  # 如果npm使用很多错误,尝试使用cnpm

npm install grunt --save  #安装grunt到模块中并保存

会出现以下错误

>> 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.

 补全安装插件

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 -g install phantomjs-prebuilt@2.1.16 --ignore-script
npm install grunt-karma@2.0.0 --registry=https://registry.npm.taobao.org
npm install http-proxy@1.16.x --registry=https://registry.npm.taobao.org
npm install karma@1.3.0 --registry=https://registry.npm.taobao.org
npm install grunt-contrib-jasmine@1.0.3 --registry=https://registry.npm.taobao.org

查看是否还存在error信息

npm audit fix

启动:

grunt  server

这个是前台启动,端口是9100

后台启动的话,我这里采用的是supervisord托管进程,配置如下,也可以使用nohup grunt server

[program:eh]
directory = /usr/local/elasticsearch-head
command=grunt server
autostart=true
autorestart=true
user=root
numprocs=1
redirect_stderr=true
stdout_logfile=/data/logs/eh.log

更新:

supervisorctl update

使用IP:9100访问

配置成功

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值