ElasticSearch:策展人并发快照

时间:2017-08-11 06:34:26

标签: elasticsearch

我们收到此消息:

  

[2017-08-11T04:00:02,908] [WARN] [r.suppressed] path:/ _snapshot / s3_currently / curator-20170811040002,params:{repository = s3_currently,wait_for_completion = true,snapshot = curator-20170811040002}   org.elasticsearch.snapshots.ConcurrentSnapshotExecutionException:[s3_currently:curator-20170811040002]快照已在运行

我们已经为x-pack策展人配置了两个操作:

/home/curator/actions/currently.yml
---
actions:
  1:
    action: snapshot
    description: Create snapshot every 30 minutes.
    options:
      repository: s3_currently
      wait_for_completion: true
    filters:
    - filtertype: alias
      aliases: living
  2:
    action: delete_snapshots
    description: Remove recently snapshots
    options:
      repository: s3_currently
      retry_interval: 120
      retry_count: 3
    filters:
    - filtertype: count
      count: 48

/home/curator/actions/currently-dev.yml

---
actions:
  1:
    action: snapshot
    description: Create snapshot every hour for development.
    options:
      repository: s3_currently_dev
      wait_for_completion: true
    filters:
    - filtertype: alias
      aliases: living
  2:
    action: delete_snapshots
    description: Remove recently snapshots
    options:
      repository: s3_currently_dev
      retry_interval: 120
      retry_count: 3
    filters:
    - filtertype: count
      count: 24

我们已经添加了两个cron作业:

0 * * * * -> currently_dev
0,30 * * * * -> currently

有什么想法吗?似乎elasticsearch不允许执行两个并发快照,是吗?

1 个答案:

答案 0 :(得分:0)

Elasticsearch不允许一次运行多个快照。这样做的原因是它被迫在快照期间冻结所选索引的Lucene段。对于多个并发快照而言,集群执行此操作将非常繁重,而不是在处理方面,而是在始终如何跟踪所有段的方面。它必须允许将新数据编入新段,而其他数据则被锁定/冻结以进行快照。这可能会造成开放段太多的情况,这可能会剥夺一个或多个节点所需的内存资源。因此,Elasticsearch一次只允许一个快照更安全。