zoukankan      html  css  js  c++  java
  • ElasticSearch设置索引全局默认分片

    设置全局分片数量:
    put http://196.168.137.100:9200/_template/template_http_request_record
    {
    “index_patterns”: ["*"],
    “settings”: {
    “number_of_shards”: 5,
    “number_of_replicas”: 1
    }
    }
    指定创建索引时的分片数量:
    put http://196.168.137.100:9200/<索引名称>
    {
    “settings”: {
    “number_of_shards”: 5,
    “number_of_replicas”: 1
    }
    }

    linux 命令执行
    curl -XPUT 'http://xxxxx:9200/_template/template_http_request_record'
       -H 'Content-Type: application/json' -d
      '{"index_patterns": ["*"],"settings": {"number_of_shards": 1,"number_of_replicas": 0}}'
    具体json 
    执行的接口

    _template/template_http_request_record

    参数

    {
      "index_patterns": ["*"],  #这个是作用于索引匹配
      "settings": {  #配置信息
         "number_of_shards": 1,
         "number_of_replicas": 0 # 备份数量
      }
    }

  • 相关阅读:
    外星人(alien)
    6. 第 6 章 函数
    5. 第 5 章 循环
    4. 第 4 章 条件选择
    3. 第 3 章 表达式和交互
    2. 第 2 章 C++简介
    1. 第 1 章 计算机和编程简介
    24. 蛇形填数
    23. 开灯问题
    12. aabb
  • 原文地址:https://www.cnblogs.com/cheyunhua/p/14694496.html
Copyright © 2011-2022 走看看