ElasticSearch 7.15.2详解(二):win及Linux安装可视化界面head、kibana

本文详细介绍了在Windows和Linux环境下安装Elasticsearch可视化工具Head以及Kibana的步骤,包括下载地址、安装Node.js、解决跨域问题和配置设置。同时提到Head用于数据展示,而Kibana则更适合进行查询和分析。
摘要由CSDN通过智能技术生成

安装可视化界面head

Windows安装

  • 下载地址 https://github.com/mobz/elasticsearch-head,需要与ES版本保持一致,也可以在我的网盘上 直接下载

  • 解压即可(尽量将ElasticSearch相关工具放在统一目录下)

    在这里插入图片描述

  • 安装node.js 此处省略

  • 启动

    cd elasticsearch-head
    npm install
    npm run start
    
  • 访问

    在这里插入图片描述

启动报错问题

  • 上图箭头方向 集群健康值:未连接 ,是因为存在跨域问题

  • 开启跨域**(在elasticsearch解压目录config下elasticsearch.yml中添加)**

    # 开启跨域
    http.cors.enabled: true
    # 所有人访问
    http.cors.allow-origin: "*"
    
  • 重启ES服务,再次连接

    在这里插入图片描述

  • 这个head,我们只是把它当做可视化数据展示工具,因为不支持json格式化,不方便,之后所有的查询都在kibana中进行

Linux安装

  • 将上文的安装包下载完上传到Linux服务器

  • 解压即可(尽量将ElasticSearch相关工具放在统一目录下)

    在这里插入图片描述

  • 安装node.js

    • 进入/www/server/node后, 下载安装包

      [root@hecs-66166 node]# wget https://nodejs.org/dist/v14.15.4/node-v14.15.4-linux-x64.tar.xz
      
    • 解压

      [root@hecs-66166 mode]# tar -xf node-v14.15.4-linux-x64.tar.xz
      
    • 建立软连接

      [root@hecs-66166 bin]# cd /usr/bin
      [root@hecs-66166 bin]# ln -s /www/server/node/node-v14.15.4-linux-x64/bin/node node
      [root@hecs-66166 bin]# ln -s /www/server/node/node-v14.15.4-linux-x64/bin/npm npm
      
    • 配置淘宝镜像, 并查看

      [root@hecs-66166 bin]# npm config set registry https://registry.npm.taobao.org
      [root@hecs-66166 bin]# npm config get registry
      https://registry.npm.taobao.org/
      
    • 查看node版本和npm版本

      [root@hecs-66166 bin]# node -v
      v14.15.4
      [root@hecs-66166 bin]# npm -v
      6.14.10
      
  • 启动

    [root@hecs-66166 elasticsearch]# cd elasticsearch-head-master
    [root@hecs-66166 elasticsearch]# npm install
    [root@hecs-66166 elasticsearch]# npm run start
    

    在这里插入图片描述

  • 访问

    在这里插入图片描述

  • 上图箭头方向 集群健康值:未连接 ,是因为存在跨域问题,参考上文中win安装启动报错问题解决

  • 重启ES服务,再次连接

    在这里插入图片描述

  • 这个head,我们只是把它当做可视化数据展示工具,因为不支持json格式化,不方便,之后所有的查询都在kibana中进行

安装kibana

Windows安装

  • 下载地址 https://www.elastic.co/cn/downloads/,需要与ES版本保持一致,大家也可以从我的网盘 直接下载

  • 解压即可(尽量将ElasticSearch相关工具放在统一目录下)

    在这里插入图片描述

  • 启动,点击bin文件夹下的kibana.bat

    在这里插入图片描述

  • 访问 http://localhost:5601/

    在这里插入图片描述

  • 汉化(在kibana解压目录/config/kibana.yml中添加)

    i18n.locale: "zh-CN"
    
  • 重启即可

    在这里插入图片描述

Linux安装

  • 同windows下载地址一样,大家也可以从我的网盘上 直接下载, 需要与ES版本保持一致,下载完上传到Linux服务器直接解压

  • 解压即可(尽量将ElasticSearch相关工具放在统一目录下)

    在这里插入图片描述

  • 编辑配置文件**(在kinaba解压目录config下kibana.yml中设置)**

    server.port: 5601         #kibana端口
    server.host: "0.0.0.0"   #所有主机都能访问,或者也可以指定一个ip
    elasticsearch.hosts: ["http://localhost:9200"]     #配置es的访问地址     
    kibana.index: ".kibana"
    
  • 将之前设置的es专用用户授权到该目录

    [root@hecs-66166 elasticsearch]# chown useres:useres -R kibana-7.15.2-linux-x86_64
    
  • 启动

    [root@hecs-66166 bin]# su useres
    [useres@hecs-66166 bin]$ ./kibana
    
  • 访问 http://服务器IP地址:5601/

    在这里插入图片描述

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值