本文共 797 字,大约阅读时间需要 2 分钟。
压缩配置:index.codec: best_compression合并索引:curl –XPOST localhost:9200/hec_test3/_forcemerge’配置mapping:curl -XPUT 'http://localhost:9200/hec_test3' -d '{ "mappings": { "hec_type3": { "_source": { "enabled": false }, "_all": { "enabled": false }, "properties": { “fieldxxx": { "type": "string", “norms”: {“enabled”: false}, “store”: false, "doc_values": false, "index_options": "docs" }, …. } } }}'
注意:同时将原始数据放在DB里,ES里通过doc id去DB里获取。_all搜索时候使用cross_fields。.tim文件较大,可以采用降低shard个数来瘦身。
总之,上述设置后可以将es的索引数据磁盘占用降低为原始数据的50%以内。
本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/bonelee/p/6934125.html,如需转载请自行联系原作者