当前位置: 移动技术网 > IT编程>开发语言>JavaScript > Centos7 安装 elasticsearch-head

Centos7 安装 elasticsearch-head

2020年07月14日  | 移动技术网IT编程  | 我要评论
1、下载elasticsearch-head和nodejs1.1安装nodejs官方下载https://nodejs.org/en/download/百度云下载链接:https://pan.baidu.com/s/1S1oGEd0vPNck1AEhVYA-pg提取码:49ss解压:tar xvf node-v12.13.0-linux-x64.tar.xz做2个软连接:ln -s /wwwroot/soft/node-v12.13.0-linux-x64/bin/node /usr/

1、下载elasticsearch-head和nodejs

1.1
安装nodejs

官方下载
https://nodejs.org/en/download/
百度云下载
链接:https://pan.baidu.com/s/1S1oGEd0vPNck1AEhVYA-pg
提取码:49ss

解压:

tar xf node-v12.18.2-linux-x64.tar.xz

做2个软连接:

ln -s /root/node-v12.18.2-linux-x64/bin/node /usr/bin/node
ln -s /root/node-v12.18.2-linux-x64/bin/npm /usr/bin/npm

1.2
elasticsearch 5.0 之后,elasticsearch-head不做为插件放在其plugins目录下。使用git拷贝elasticsearch-head到本地

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

百度云下载
链接:https://pan.baidu.com/s/10A4G0av-lA1LSN7dMFf7Zg
提取码:rzwl

安装 grunt

npm install -g grunt-cli

安装 elasticsearch-head 依赖的包

cd elasticsearch-head
npm install
2、修改hostname

修改 Gruntfile.js 在connect–>server–>options下面添加:hostname:’ ** ,允许所有IP可以访问

vim /root/elasticsearch-head/Gruntfile.js

在这里插入图片描述
修改默认连接地址
修改elasticsearch-head默认连接地址,改成你自己的es地址

cd /root/elasticsearch-head/_site
vim app.js
将4374行
this.base_uri = this.config.base_uri || this.prefs.get(“app-base_uri”) || “http://10.180.18.38:9200”;
在这里插入图片描述
修改es
想在界面上看到es集群信息,必须在elasticsearch.yml增加两项配置,重启es
打开elasticsearch 的配置文件 elasticsearch.yml 在末尾加上:

http.cors.enabled: true
http.cors.allow-origin: “*”
启动elasticesarch-head

cd /root/elasticsearch-head/ && nohup ./node_modules/grunt/bin/grunt server &

访问 http://ip:9111(vim /root/elasticsearch-head/Gruntfile.js这个配置修改访问IP)
在这里插入图片描述

本文地址:https://blog.csdn.net/a13568hki/article/details/107319223

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网