ES、kibana安装及交互操作

一、ES的安装与启动

1、ES安装(Windows环境)

  • 下载地址:https://www.elastic.co/cn/downloads/past-releases#elasticsearch
  • 版本:6.3.2
  • 运行环境:jdk1.8以上
  • 双击.bat启动

2、查看效果

浏览器输入:http://localhost:9200,返回如下json。

{
  "name" : "RDFnj43",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "X-h3NABsTPOitRIeqIJj4Q",
  "version" : {
    "number" : "6.3.2",
    "build_flavor" : "default",
    "build_type" : "zip",
    "build_hash" : "053779d",
    "build_date" : "2018-07-20T05:20:23.451332Z",
    "build_snapshot" : false,
    "lucene_version" : "7.3.1",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

证明启动成功

二、kibana安装及启动

1、kibana安装(Windows环境)

  • 下载地址:https://www.elastic.co/cn/downloads/past-releases#kibana
  • 版本:6.3.2
  • 运行环境:jdk1.8以上
  • 双击.bat启动

2、查看效果

浏览器输入:http://localhost:5601,如下所示,证明启动成功

三、交互操作

1、ES与mysql的对应关系理解

2、使用postman与ES交互操作案例

{
    "id": "7b72aa64-67f2-5276-9f9f-f50d5c4ef1ef",
    "name": "ES与postman交互",
    "description": "",
    "order": [
        "ed0c094d-ad2f-c724-0537-030a693b36dc",
        "0ea20269-f2b9-2f40-f8e6-06d09609bf16",
        "77d672e4-9ad5-6184-530f-b12c29501f76",
        "8935a2f2-5e8b-ec82-4633-f5bbfcbdc1b1",
        "e4bdcf5a-c4df-39c3-75a4-82285cc98af0",
        "72a69b67-c537-c442-d684-dae1f0cd38a6",
        "c04a38a6-d13a-d63c-4d2f-149c4072cdcb",
        "f8fe5a0d-05e4-fa30-76b5-2cae83c29928"
    ],
    "folders": [],
    "folders_order": [],
    "timestamp": 1575722536609,
    "owner": 0,
    "public": false,
    "requests": [
        {
            "id": "0ea20269-f2b9-2f40-f8e6-06d09609bf16",
            "headers": "",
            "headerData": [],
            "url": "http://localhost:9200/test",
            "queryParams": [],
            "preRequestScript": null,
            "pathVariables": {},
            "pathVariableData": [],
            "method": "PUT",
            "data": null,
            "dataMode": "params",
            "version": 2,
            "tests": null,
            "currentHelper": "normal",
            "helperAttributes": {},
            "time": 1575722819075,
            "name": "创建索引-test",
            "description": "http://localhost:9200/_all",
            "collectionId": "7b72aa64-67f2-5276-9f9f-f50d5c4ef1ef",
            "responses": []
        },
        {
            "id": "72a69b67-c537-c442-d684-dae1f0cd38a6",
            "headers": "Content-Type: application/json\n",
            "headerData": [
                {
                    "key": "Content-Type",
                    "value": "application/json",
                    "description": "",
                    "enabled": true
                }
            ],
            "url": "http://localhost:9200/person/_doc/2",
            "queryParams": [],
            "pathVariables": {},
            "pathVariableData": [],
            "preRequestScript": null,
            "method": "PUT",
            "collectionId": "7b72aa64-67f2-5276-9f9f-f50d5c4ef1ef",
            "data": [],
            "dataMode": "raw",
            "name": "新增数据-person2",
            "description": "",
            "descriptionFormat": "html",
            "time": 1575724045084,
            "version": 2,
            "responses": [],
            "tests": null,
            "currentHelper": "normal",
            "helperAttributes": {},
            "rawModeData": "{\r\n\t\"userName\": \"ESRC\",\r\n\t\"age\": 22,\r\n\t\"interests\": [\"PLAY GAME\", \"FOOTBALL\"]\r\n}"
        },
        {
            "id": "77d672e4-9ad5-6184-530f-b12c29501f76",
            "headers": "",
            "headerData": [],
            "url": "http://localhost:9200/test",
            "queryParams": [],
            "pathVariables": {},
            "pathVariableData": [],
            "preRequestScript": null,
            "method": "DELETE",
            "collectionId": "7b72aa64-67f2-5276-9f9f-f50d5c4ef1ef",
            "data": null,
            "dataMode": "params",
            "name": "删除索引-test",
            "description": "",
            "descriptionFormat": "html",
            "time": 1575722861291,
            "version": 2,
            "responses": [],
            "tests": null,
            "currentHelper": "normal",
            "helperAttributes": {}
        },
        {
            "id": "8935a2f2-5e8b-ec82-4633-f5bbfcbdc1b1",
            "headers": "",
            "headerData": [],
            "url": "http://localhost:9200/person",
            "queryParams": [],
            "pathVariables": {},
            "pathVariableData": [],
            "preRequestScript": null,
            "method": "PUT",
            "collectionId": "7b72aa64-67f2-5276-9f9f-f50d5c4ef1ef",
            "data": null,
            "dataMode": "params",
            "name": "创建索引persion",
            "description": "",
            "descriptionFormat": "html",
            "time": 1575722978016,
            "version": 2,
            "responses": [],
            "tests": null,
            "currentHelper": "normal",
            "helperAttributes": {}
        },
        {
            "id": "c04a38a6-d13a-d63c-4d2f-149c4072cdcb",
            "headers": "Content-Type: application/json\n",
            "headerData": [
                {
                    "key": "Content-Type",
                    "value": "application/json",
                    "description": "",
                    "enabled": true
                }
            ],
            "url": "http://localhost:9200/person/_doc/1",
            "queryParams": [],
            "pathVariables": {},
            "pathVariableData": [],
            "preRequestScript": null,
            "method": "GET",
            "collectionId": "7b72aa64-67f2-5276-9f9f-f50d5c4ef1ef",
            "data": [],
            "dataMode": "raw",
            "name": "按照id查询",
            "description": "",
            "descriptionFormat": "html",
            "time": 1575724086023,
            "version": 2,
            "responses": [],
            "tests": null,
            "currentHelper": "normal",
            "helperAttributes": {},
            "rawModeData": "{\r\n\t\"userName\": \"tom\",\r\n\t\"age\": 19,\r\n\t\"interests\": [\"music\", \"sports\"]\r\n}"
        },
        {
            "id": "e4bdcf5a-c4df-39c3-75a4-82285cc98af0",
            "headers": "Content-Type: application/json\n",
            "headerData": [
                {
                    "key": "Content-Type",
                    "value": "application/json",
                    "description": "",
                    "enabled": true
                }
            ],
            "url": "http://localhost:9200/person/_doc/1",
            "queryParams": [],
            "preRequestScript": null,
            "pathVariables": {},
            "pathVariableData": [],
            "method": "PUT",
            "data": [],
            "dataMode": "raw",
            "tests": null,
            "currentHelper": "normal",
            "helperAttributes": {},
            "time": 1575724010195,
            "name": "新增数据-person",
            "description": "",
            "collectionId": "7b72aa64-67f2-5276-9f9f-f50d5c4ef1ef",
            "responses": [],
            "rawModeData": "{\r\n\t\"userName\": \"tom\",\r\n\t\"age\": 19,\r\n\t\"interests\": [\"music\", \"sports\"]\r\n}"
        },
        {
            "id": "ed0c094d-ad2f-c724-0537-030a693b36dc",
            "headers": "",
            "headerData": [],
            "url": "http://localhost:9200/_all",
            "queryParams": [],
            "preRequestScript": null,
            "pathVariables": {},
            "pathVariableData": [],
            "method": "GET",
            "data": null,
            "dataMode": "params",
            "version": 2,
            "tests": null,
            "currentHelper": "normal",
            "helperAttributes": {},
            "time": 1575722733199,
            "name": "查看所有索引",
            "description": "http://localhost:9200/_all",
            "collectionId": "7b72aa64-67f2-5276-9f9f-f50d5c4ef1ef",
            "responses": []
        },
        {
            "id": "f8fe5a0d-05e4-fa30-76b5-2cae83c29928",
            "headers": "Content-Type: application/json\n",
            "headerData": [
                {
                    "key": "Content-Type",
                    "value": "application/json",
                    "description": "",
                    "enabled": true
                }
            ],
            "url": "http://localhost:9200/person/_doc/_search?q=userName:tom",
            "queryParams": [
                {
                    "key": "q",
                    "value": "userName:tom",
                    "equals": true,
                    "description": "",
                    "enabled": true
                }
            ],
            "pathVariables": {},
            "pathVariableData": [],
            "preRequestScript": null,
            "method": "GET",
            "collectionId": "7b72aa64-67f2-5276-9f9f-f50d5c4ef1ef",
            "data": [],
            "dataMode": "raw",
            "name": "按照用户名查询",
            "description": "",
            "descriptionFormat": "html",
            "time": 1575724275505,
            "version": 2,
            "responses": [],
            "tests": null,
            "currentHelper": "normal",
            "helperAttributes": {},
            "rawModeData": "{\r\n\t\"userName\": \"tom\",\r\n\t\"age\": 19,\r\n\t\"interests\": [\"music\", \"sports\"]\r\n}"
        }
    ]
}
  • GET为查询操作
  • PUT为创建索引
  • DELETE为删除索引

3、使用kibana与ES交互操作

找到dev tools,进行交互操作

//查询所有的索引
GET _all1//按照id查询GET person/_doc/2

与es交互式操作格式:

POST /person/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "interests": "FOOTBALL"
          }
        },
        {
          "match": {
            "userName": "ESRC22"
          }
        }
      ]
    }
  }
}
  • must为且的关系
  • must处为should的时候为或的关系

原文地址:https://www.cnblogs.com/longronglang/p/12006939.html

时间: 2024-10-04 04:34:59

ES、kibana安装及交互操作的相关文章

如何开发自己的搜索帝国之ES图形化Kibana安装与使用

在如何开发自己的搜索帝国之Elasticsearch中已经介绍安装好了ES,下面就Kibana对ES的查询监控作介绍,就是常提到的大数据日志处理组件ELK里的K. 什么是Kibana?现引用园友的一段对此的介绍,个人觉得比较全. Kibana是一个针对Elasticsearch的开源分析及可视化平台,用来搜索.查看交互存储在Elasticsearch索引中的数据.使用Kibana,可以通过各种图表进行高级数据分析及展示. Kibana让海量数据更容易理解.它操作简单,基于浏览器的用户界面可以快速

五十七.分布式ELK平台、ES安装 、 扩展插件 、Kibana安装

1. ES集群安装 准备1台虚拟机 部署elasticsearch第一个节点 访问9200端口查看是否安装成功 1ELK是日志分析平台,不是一款软件,而是一整套解决方案,是三个软件产品的首字母缩写,ELK分别代表: Elasticsearch:负责日志检索和储存 Logstash:负责日志的收集和分析.处理 Kibana:负责日志的可视化 ELK组件在海量日志系统的运维中,可用于解决分布式日志数据集中式查询和管理系统监控等,故障排查,安全信息和事件管理,报表功能 部署Elasticsearch分

Kibana安装与基本用法(ELK)

Kibana也是一个开源和免费的工具,他可以帮助您汇总.分析和搜索重要数据日志并提供友好的web界面.他可以为Logstash 和ElasticSearch 提供日志分析的Web界面 它是一个基于浏览器页面的ES前端展示工具,是为ES提供日志分析的web接口,可用它对日志进行高效的搜索.可视化.分析等操作.Kibana全部使用HTML语言和JavaScript编写的,提供了Marvel监控的UI界面.Kibana是一个与ES以前工作的开源分析.可视化平台,使用Kibana可以查询.查看并与存储在

Kibana安装及使用说明

Kibana安装及使用说明 Kibana是一个针对Elasticsearch的开源分析及可视化平台,用来搜索.查看交互存储在Elasticsearch索引中的数据. 官方地址:https://www.elastic.co/cn/products/kibana 一.Kibana安装 1.环境准备 Kibana是ElasticSearch的可视化平台,依赖ElasticSearch,需要优先安装ElasticSearch. 示例:ElasticSearch 5.5.2 集群 2.Kibana下载 K

KICKSTART无人值守安装 - (字符界面操作)

kickstart 部署 1.1 kickstart简介说明 1.1.1 pxe工作过程(图) 1.1.2 kickstart具体过程(图) 1.2 kickstart无人值守部署 1.2.1 系统环境 系统:CentOS 7.4 ip: 外网:10.0.0.202 内网:172.16.1.202 1.2.2 安装.配置dhcp #安装dhcp yum -y install dhcp #编写配置文件 cat >>/etc/dhcp/dhcpd.conf<<EOF subnet 17

Windows下安装MySQLdb, Python操作MySQL数据库的增删改查

这里的前提是windows上已经安装了MySQL数据库,且配置完毕,能正常建表能操作.在此基础上只需安装MySQL-python-1.2.4b4.win32-py2.7.exe就ok了,只有1M多.这个有点类似jdbc里的那个jar包. 下载链接:http://sourceforge.net/projects/mysql-python/ , 百度云盘 :http://pan.baidu.com/s/1dDgnfpR 密码:7bna 接着import MySQLdb就能使用了,下面给出测试代码:

Mysql安装和基础操作

1.环境检查: 先检查是否已经安装了:rpm -qa |grep mysql ---两个都检查下,查看mysql是否安装 rpm -qa |grep MySQL若安装有可删除:rpm -e ****** 2.安装:1)安装前准备:mkdir usr/mysql cd进入该目录,上传安装包到/usr/mysql目录下2)安装:rpm -ivh MySQL-server-5.0.16-0.i386.rpm rpm -ivh MySQL-elient-5.0.16-0.i386.rpm3)验证安装是否

TortoiseSVN下载,安装,配置,常用操作 svn教程

   TortoiseSVN下载,安装,配置,常用操作 svn教程 首先在百度搜索并下载 TortoiseSVN 推荐从官网下载,软件分为32位和64位版本,下载时请根据自己的系统位数进行下载:  安装过程: 1.下载软件后,双击程序进行安装,点击"Next": 2.在许可证协议页面,选择"I Accept the terms in the License Agreement",点击"Next": 3.在自定义选项页面,可以选择安装目录,也可以直

ELK 学习笔记之 Kibana安装

Kibana安装: 安装地址: https://www.elastic.co/downloads/kibana 安装: tar -zxvf kibana-5.6.1-linux-x86_64.tar.gz 非常不开心的是,安装报错: 只能重新下载安装5.5.2版本: https://www.elastic.co/downloads/past-releases/kibana-5-5-2 安装运行Kibana: tar -zxvf kibana-5.5.2-linux-x86_64.tar.gz 修