elasticsearch-5.5.1安装head客户端

1、安装nodejs、npm、grunt

curl -sL -o /etc/yum.repos.d/khara-nodejs.repo https://copr.fedoraproject.org/coprs/khara/nodejs/repo/epel-7/khara-nodejs-epel-7.repo
 然后安装 yum install -y nodejs nodejs-npm

查看版本号,验证是否安装成功

# node -v

v6.11.2

# npm -v

3.10.10

打印版本号,证明安装成功。

2、安装grunt、grunt-cli

# npm install -g grunt-cli

# npm install -g grunt

下载head源码,下载地址

git clone git://github.com/mobz/elasticsearch-head.git

存放在/data/ELK/目录下

# mv elasticsearch-head head

# cd head

执行以下命令开始安装依赖

npm install -g cnpm --registry=https://registry.npm.taobao.org
3、安装完成之后,对elasticesearch进行以下配置

在/data/ELK/elasticesearch/config/elasticesearch.yml文件末端新增以下内容:

http.cors.enabled: true
http.cors.allow-origin: "*"
4、修改head相关配置

在/data/ELK/head/Gruntfile.js文件中找到 connect,新增hostname

connect: {
        server: {
            options: {
                hostname: '0.0.0.0',
                port: 9100,
                base: '.',
                keepalive: true
            }
        }
    }   
5、启动head服务

在/data/ELK/head目录下启动服务器

nohup grunt server & //后台运行命令

# losf -i:9100 查看端口是否正常启动监听

6、访问后台

在浏览器中访问

http://192.168.40.249:9100


总结:启动grunt server时抛出以下异常,需要逐个安装(npm install grunt-contrib-clean)。

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

hu_wenjie

您的鼓励将是我创作最大的动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值