温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

elasticsearch写入优化的示例分析

发布时间:2022-01-10 10:22:04 来源:亿速云 阅读:147 作者:柒染 栏目:大数据

小编今天带大家了解elasticsearch写入优化的示例分析,文中知识点介绍的非常详细。觉得有帮助的朋友可以跟着小编一起浏览文章的内容,希望能够帮助更多想解决这个问题的朋友找到问题的答案,下面跟着小编一起深入学习“elasticsearch写入优化的示例分析”的知识吧。

全量dump数据时,为优化性能,可做如下优化。

  1. 分片设置,不分片

http://localhost:9200/test_index/_settings/
{
  "index": {
    "number_of_replicas": 0
  }
}
  1. 刷新设置,不刷新

http://localhost:9200/test_index/_settings/
{
  "index": {
    "refresh_interval": "-1"
  }
}
  1. translog 大小设置,调大 默认512M

http://localhost:9200/test_index/_settings/
{
  "index.translog.flush_threshold_size": "1024mb"
}
  1. 如果是SSD硬盘,修改段合并速率

http://localhost:9200/_cluster/settings/
{
  "persistent": {
    "indices.store.throttle.max_bytes_per_sec": "200mb"
  }
}

http://localhost:9200/_cluster/settings/
{
  "transient": {
    "indices.store.throttle.type": "none"
  }
}

全量dump后,再恢复一下

  1. 分片设置

http://localhost:9200/test_index/_settings/
{
  "index": {
    "number_of_replicas": 2
  }
}
  1. 刷新设置,不刷新

http://localhost:9200/test_index/_settings/
{
  "index": {
    "refresh_interval": "1s"
  }
}
  1. translog 大小设置

http://localhost:9200/test_index/_settings/
{
  "index.translog.flush_threshold_size": "512mb"
}

当然应该使用bulk模式, elasticsearch单次提交数据尽量在15M以内。

感谢大家的阅读,以上就是“elasticsearch写入优化的示例分析”的全部内容了,学会的朋友赶紧操作起来吧。相信亿速云小编一定会给大家带来更优质的文章。谢谢大家对亿速云网站的支持!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI