安装Elasticsearch-Head

NodeJS

//elasticsearch-head是基于nodejs开发的,所以需要安装nodejs环境
//安装前查看本机是否有Node环境
node -v
//如果没有 下载NodeJS包
cd ~/package
wget https://nodejs.org/dist/v10.13.0/node-v10.13.0-linux-x64.tar.xz
//解压安装到 /usr/local
tar -xvf node-v10.13.0-linux-x64.tar.xz -C /usr/local/
//重名下文件夹名字
mv /usr/local/node-v10.13.0-linux-x64 /usr/local/node-v10.13.0
//配置nodejs环境变量
vim /etc/profile
//添加两行环境变量配置
export NODE_HOME=/usr/local/node-v10.13.0
export PATH=$NODE_HOME/bin:$PATH
//保存退出,生效一下环境变量
source /etc/profile
//验证一下
node -v

Elasticsearch-Head
访问成果http://192.168.8.8:9101

//安装git 用户从github下载elasticsearch-head插件yum -y install git
//下载elasticsearch-head 到/usr/local/elasticsearch-head
git clone git://github.com/mobz/elasticsearch-head.git /usr/local/elasticsearch-head
//进入到elasticsearch-head目录。进行安装
yum -y install epel-release
cd /usr/local/elasticsearch-head
npm install cnpm -g --registry=https://registry.npm.taobao.org
cnpm install -g
//修改Gruntfile.js文件
cd /usr/local/elasticsearch-head/ 
vim ./Gruntfile.js

//修改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";

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

//模式一,窗口运行 Elasticsearch-Head
cd /usr/local/elasticsearch-head
npm run start
//模式二,后台运行及运行日志查看
cd /usr/local/elasticsearch-head
nohup npm run start &
more nohup.out
//查看是否安装成功
//打开浏览器 http://192.168.8.8:9101
//模式一,窗口终止运行
//Ctrl+C 退出运行 即终止
//模式二,后台终止运行
ps -ef | grep grunt
kill -9 对应进程

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值