ElasticSearch笔记

Elasticsearch性能调优指南

优化

性能测试

  • 在一个节点的一个分片,不设置副本,测试性能
  • 在完全默认设置上记录性能数据,作为测试的基准线
  • 确保性能测试持续30分钟以上以确认长时间的性能;短时间的测试可能不会碰到segment合并和GC,无法确认这些因素的影响
  • 每次基于默认基准线更改一个参数,如果性能有提升就保留设置,并基于此设置做后续的测试



生产环境elasticsearch的配置建议

以下主要来自官方文档,主要分为几块:

分片大小的建议 每个分片小于50GB

Elasticsearch集群搭建实战

大规模集群实践



PUT /_cluster/settings
{
    "persistent" : {
        "discovery.zen.minimum_master_nodes" : 8
    }
}


gateway.expected_nodes: 15
gateway.recover_after_nodes: 12
gateway.recover_after_time: 5m





笔记


设置分片数

curl -X PUT -u {username}:{password} "{ip}:9200/{indexName}" -d '
{
    "settings" : { 
        "number_of_shards" : {number} 
    }
}
'



task 观察任务运行状态

GET _tasks

GET _tasks?actions=*reindex&detailed

GET _tasks/uOCOZUwHQ-CWfbeizCDOOg:37931

POST _tasks/uOCOZUwHQ-CWfbeizCDOOg:37931/_cancel






别名alias


POST /_aliases
{
  "actions": [
    {
      "add": {
        "index": "probe_datecl2",
        "alias": "probe_datecl4"
      }
    }
  ]
}





问答区



提高索引速度


限制reindex的速度,默认不限制
requests_per_second   can be set to any positive decimal number ( 1.4 ,   6 ,   1000 , etc) and throttles rate at which reindex issues batches of index operations by padding each batch with a wait time. The throttling can be disabled by setting   requests_per_second   to   -1 .



ElasticSearch 的一次非正常master脱离的调查


5.1.1存在经常节点失联的bug,导致集群状态不稳定(yellow),不停均衡,大量磁盘io以及cpu使用。影响入库以及查询效率。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值