linux(centos7)安装elasticsearch-head插件

1、elasticsearch-head是基于nodejs开发的,所以需要安装nodejs环境

2、下载nodejs 安装包

进入nodejs官网

99d4321249f117249dcc898f4bc4c7f5af6.jpg

右键复制下载链接  https://nodejs.org/dist/v10.13.0/node-v10.13.0-linux-x64.tar.xz

root用户下进入/usr/local/src目录

cd /usr/local/src
##下载nodejs安装包
wget https://nodejs.org/dist/v10.13.0/node-v10.13.0-linux-x64.tar.xz

2、安装nodejs

##创建nodejs安装目录
mkdir /usr/local/nodejs
##解压nodejs安装包到/usr/local/nodejs目录
tar -xvf node-v10.13.0-linux-x64.tar.xz -C /usr/local/nodejs/

3、配置nodejs环境变量

vim /etc/profile

##配置nodejs 的HOME目录
export NODEJS_HOME=/usr/local/nodejs/node-v10.13.0-linux-x64
##加入nodejs的环境变量
export PATH=${JAVA_HOME}/bin:${NODEJS_HOME}/bin:$PATH

4、让修改后的文件立即生效

source /etc/profile

5、测试nodejs的版本

node -v

6、安装git 用户从github下载elasticsearch-head插件

yum -y install git

7、下载elasticsearch-head

cd /usr/local/es/
git clone git://github.com/mobz/elasticsearch-head.git

8、进入到elasticsearch-head目录。进行安装

由于在执行npm install 时候报如下错误

 

yum -y install epel-release

cd /usr/local/es/elasticsearch-head

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

cnpm install -g

9、修改Gruntfile.js文件

cd /usr/local/es/elasticsearch-head/
vim ./Gruntfile.js

645c63ee7e67a5bfe6f4724e194fe29fc78.jpg

10、修改elasticsearch-head默认连接地址

cd /usr/local/es/elasticsearch-head/_site/
vim app.js

打开文件 在命令行模式输入 “/this.base_uri”  进行搜索

然后修改为

this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://you ip address:9200";

64f10613f4055564ea0b7294bafc52cccc7.jpg

11、修改elasticsearch服务配置文件允许跨域(在elasticsearch.yml文件中添加)

d05471b5b10ca26e921fd74787f00967d04.jpg

 

12、启动elasticsearch

/usr/local/es/node-1/bin/elasticsearch -d

13、启动elasticsearch-head服务

/usr/local/es/elasticsearch-head/node_modules/grunt/bin/grunt server

如果要后台启动 nohup /usr/local/es/elasticsearch-head/node_modules/grunt/bin/grunt server & exit

转载于:https://my.oschina.net/shxjinchao/blog/2878083

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值