zoukankan      html  css  js  c++  java
  • 基本概念

    节点:es的运行实例
    集群:拥有相同cluster.name的节点,有节点加入或删除,为了数据的均匀分配,集群的将会在当前集群中的节点重新分配数据(分片迁移)
    主节点:选举产生,负责关联集群范围内所有的变更(索引及以上级别,不包括文档级别及搜索等操作)
     
    请求可以发送到集群中的任意节点,节点间都知道任意文档所处位置
    GET /_cluster/health
    {
      "cluster_name": "wqqqqq",
      "status": "yellow",
      "timed_out": false,
      "number_of_nodes": 1,
      "number_of_data_nodes": 1,
      "active_primary_shards": 49,
      "active_shards": 49,
      "relocating_shards": 0,
      "initializing_shards": 0,
      "unassigned_shards": 51,
      "delayed_unassigned_shards": 0,
      "number_of_pending_tasks": 0,
      "number_of_in_flight_fetch": 0,
      "task_max_waiting_in_queue_millis": 0,
      "active_shards_percent_as_number": 49
    }
     
    索引:指向一个或多个物理分片的逻辑命名空间
    分片:一个lucene的实例,仅包含一个索引中全部数据的一部分(文档)
    应用程序直接与索引而不是分片交互
    主分片:任意一个文档都会但不仅会存在一个主分片中,主分片的数目决定索引能够保存的最大数据量
    副分片:主分片的拷贝,冗余备份,并提供搜索服务,
    PUT /blogs
    {
       "settings" : {
          "number_of_shards" : 3,//三个主分片
          "number_of_replicas" : 1//一个主分片对应的副本数量
       }
    }
    {
      "acknowledged": true,
      "shards_acknowledged": true,
      "index": "blogs"
    }
    put blogs/_settings
    {
      "number_of_replicas": 2
    }
    {
      "acknowledged": true
    }
     
    失去主节点,集群会选取新的主节点,
    失去主分片,副分片会瞬间晋升为主分片,
     
  • 相关阅读:
    go语言学习-接口
    go语言学习-函数
    go语言学习-常用命令
    go语言学习-数组-切片-map
    go语言学习-基础知识
    go语言学习-安装和配置
    python套接字基本使用
    debian 10 firewall-cmd --reload 报错
    synchronized 关键字
    Filebeat+Kafka+Logstash+ElasticSearch+Kibana 日志采集方案
  • 原文地址:https://www.cnblogs.com/wqkant/p/9624010.html
Copyright © 2011-2022 走看看