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


    1、下载地址

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

    上传并解压:

    1. root@zq-virtual-machine:/home/elasticsearch# rz
    2. 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

    报错:

    1. npm ERR! code 137
    2. npm ERR! path /home/elasticsearch/elasticsearch-head-master/node_modules/phantomjs-prebuilt
    3. npm ERR! command failed
    4. npm ERR! command sh /tmp/install-cf9989e7.sh
    5. npm ERR! PhantomJS not found on PATH
    6. npm ERR! Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2
    7. npm ERR! Saving to /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
    8. npm ERR! Receiving...
    9. npm ERR! Killed
    10. npm ERR! A complete log of this run can be found in:
    11. 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 

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

     

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

  • 相关阅读:
    RK3568的CAN驱动适配
    【Golang基本语法】介绍
    jQuery内容概述
    Django Admin后台
    如何将 Elasticsearch 和时间序列数据流用于可观察性指标 - 8.7
    Vue.js 框架源码与进阶 - Vue.js 3.0 响应式系统原理
    Linux系统下压缩与解压命令
    我的阿里云盘资源搜索引擎首次试运行
    QT 点击窗口外区域 当前窗口自动关闭
    vue2中的列表渲染v-for
  • 原文地址:https://blog.csdn.net/inexaustible/article/details/126600017