Ubuntu安装可视化界面ElasticSearch-head插件

1、下载地址

GitHub - mobz/elasticsearch-head: A web front end for an elastic search cluster

上传并解压:

root@zq-virtual-machine:/home/elasticsearch# rz
root@zq-virtual-machine:/home/elasticsearch# unzip elasticsearch-head-master.zip 

根目录下使用命令启动elasticsearch:

root@zq-virtual-machine:/home/elasticsearch/elasticsearch-8.4.0/bin# su esroot
$ ./elasticsearch

 2、检查是否安装node

node -v

 如果没有安装:先安装nodejs

1、官网下载nodejs

2、创建文件夹:      mkdir -p /home/soft/

3、添加安装包:

cd /home/soft/

rz

4、解压

tar -xvf node-v16.15.1-linux-x64.tar.xz

ln -s /home/soft/node-v16.15.1-linux-x64/bin/node /usr/bin

ln -s /home/soft/node-v16.15.1-linux-x64/bin/npm /usr/bin

5、然后测试/查看版本

node -v

npm -v

3、启动elasticsearch-head

3.1 进入elasticsearch-head-master根目

cd elasticsearch-head-master/

3.2 安装elasticsearch所需的依赖包

npm install

报错:

npm ERR! code 137
npm ERR! path /home/elasticsearch/elasticsearch-head-master/node_modules/phantomjs-prebuilt
npm ERR! command failed
npm ERR! command sh /tmp/install-cf9989e7.sh
npm ERR! PhantomJS not found on PATH
npm ERR! Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2
npm ERR! Saving to /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
npm ERR! Receiving...
npm ERR! Killed

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-08-30T04_33_46_160Z-debug-0.log

单独安装:npm install phantomjs@2.1.1 --ignore-scripts

 再次:npm install

3.3 启动head插件

npm run start

 虚拟机内访问:

物理主机访问:http://192.168.1.129:9100/

修改防火墙状态,并开放9100端口:

开启ufw:ufw enable

开放9100端口:ufw allow 9100

查看ufw状态:ufw status


查看状态:systemctl status firewalld

关闭防火墙:systemctl stop firewalld

可通过命令:telnet 192.168.1.129 9100,测试端口是否开放。

4、连接http://192.168.1.129:9200/

 跨域

修改配置文件:根目录下的config/elasticsearch.yml

vim config/elasticsearch.yml 

# 在末尾添加配置
http.cors.enabled: true
http.cors.allow-origin: "*"

 

重启es和es-head,访问结果如下图:

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值