• elasticsearch学习(1)


    安装 elasticsearch ,操作elasticsearch的工具kibana,

    (1)在kibana中输入GET _cluster/health查看es的健康状况(2)在kibana中输入 GET /_cat/health?v 查看es具体信息

    epoch      timestamp cluster       status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
    1565201059 18:04:19  elasticsearch green           1         1      2   2    0    0        0             0                  -                100.0%

    status :green:每个索引的primary shard 和replica shard 都是active状态

       yellow:每个索引的primary shard 都是active状态的,但是部分replica shard不是active状态的

      red:不是所有索引primary shard都是active状态的,部分索引有数据丢失了

    kibana中:GET /_cat/indices?v

    health status index                uuid                   pri rep docs.count docs.deleted store.size pri.store.size
    green  open   .kibana_task_manager ynymnIYGSiaUo76dW86xKA   1   0          2            0     45.5kb         45.5kb
    green  open   .kibana_1            6I0Vh6e8QLCvPgZil4_StQ   1   0          4            0     15.3kb         15.3kb

    添加文档:

    PUT /index/_doc/id{ }

    例如:

    PUT /ecommerce/product/3
    {
      "name":"zhonghua toothpaste",
      "desc":"herb,prevent cavity",
      "price":40,
      "producer":"zhonghua producer",
      "tags":["fresh"]
    }

    更新:

    POST /index/product/id/_update

    {

    "doc":{

    }

    }

    例如:

    POST /ecommerce/product/1/_update
    {
      "doc":{
        "name":"highly efficient white toothpaste"
      }
    }

  • 相关阅读:
    server-conf-PPTConf
    client-autoReport-ppt
    client-autoReport-common
    浏览器书签导出
    微信公众号JSAPI支付-多公众号向同一商户号支付的问题解决
    Kettle 4.4.0 通过 Java 代码 输出日志到表
    spring tx:advice事务配置
    Spring异常捕获而且回滚事务的方法
    移动端服务器i-jetty下载编译安装及问题解决系列
    I-Jetty部署war包到安卓手机
  • 原文地址:https://www.cnblogs.com/vary-/p/11318831.html
Copyright © 2020-2023  润新知