云搜索服务 CSS-切换冷热数据:冷热数据切换

时间:2024-04-18 15:13:19

冷热数据切换

用户在创建集群的时候如果选择启用冷数据节点,冷数据节点将会打上“cold”标签,用来表示冷节点,同时其他数据节点将会上升为热节点,会被打上“hot”标签。用户可以通过配置指定索引,将数据分配到冷热节点。

通过设置template,可以通过模板将相应的index存储到指定冷热节点。

如下,登录集群的Kibana Console页面,配置myindex开头的索引,储存在冷节点上面。 这样可以通过模板在创建的时候把myindex*的数据存储在冷数据节点上面。

  • 5.x版本使用以下命令创建模板:
    PUT _template/test
    {
        "order": 1,
        "template": "myindex*",
        "settings": {
            "index": {
                "refresh_interval": "30s",
                "number_of_shards": "3",
                "number_of_replicas": "1",
                "routing.allocation.require.box_type": "cold"
            }
        }
    }
  • 6.x及以上版本使用以下命令创建模板:
    PUT _template/test
    {
      "order": 1,
      "index_patterns": "myindex*",
      "settings": {
        "refresh_interval": "30s",
        "number_of_shards": "3",
        "number_of_replicas": "1",
        "routing.allocation.require.box_type": "cold"
      }
    }

同时也可以单独对已经创建好的索引进行操作。

PUT myindex/_settings   
 { 
        "index.routing.allocation.require.box_type": "cold"
    }

也可以去掉冷热数据配置,不受冷热数据标签影响。

PUT myindex/_settings    
{ 
        "index.routing.allocation.require.box_type": null
    }
support.huaweicloud.com/usermanual-css/css_01_0079.html