`
m635674608
  • 浏览: 5060319 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

ElasticSearch 同步副本方式

 
阅读更多
Distributed
edit

The index operation is directed to the primary shard based on its route (see the Routing section above) and performed on the actual node containing this shard. After the primary shard completes the operation, if needed, the update is distributed to applicable replicas.
Write Consistency
edit

To prevent writes from taking place on the "wrong" side of a network partition, by default, index operations only succeed if a quorum (>replicas/2+1) of active shards are available. This default can be overridden on a node-by-node basis using the action.write_consistency setting. To alter this behavior per-operation, the consistency request parameter can be used.

Valid write consistency values are one, quorum, and all.

Note, for the case where the number of replicas is 1 (total of 2 copies of the data), then the default behavior is to succeed if 1 copy (the primary) can perform the write.

The index operation only returns after all active shards within the replication group have indexed the document (sync replication).

  

replication

The default value for replication issync.This causes the primary shard to wait for successful responses from the replica shards before returning.

If you set replication to async, it will return success to the client as soon as the request has been executed on the primary shard. It will still forward the request to the replicas, but you will not know whether the replicas succeeded.

This option is mentioned specifically to advise against using it. The defaultsync replication allows Elasticsearch to exert back pressure on whatever system is feeding it with data. Withasync replication, it is possible to overload Elasticsearch by sending too many requests without waiting for their completion.

复制

复制的缺省值是sync。在这种设定下,原始切片返回前,需要等待副本先返回。

如果把replication设置为async,请求在原始切片上的执行成功后会立即返回成功给客户端。这种设定下,请求仍然会转发给副本,但是客户端不知道副本上是否成功。

此选项特别建议,不要使用它。缺省的同步复制选项可以使Elasticsearch把压力反馈给客户端程序。异步复制的话,有可能使Elasticsearch过载。


consistency

By default, the primary shard requires aquorum, or majority, of shard copies (where a shard copy can be a primary or a replica shard) to be available before even attempting a write operation. This is to prevent writing data to the “wrong side” of a network partition. A quorum is defined as follows:

int( (primary + number_of_replicas) / 2 ) + 1

The allowed values for consistency areone (just the primary shard),all (the primary and all replicas), or the default quorum, or majority, of shard copies.

Note that the number_of_replicas is the number of replicasspecified in the index settings, not the number of replicas that are currently active. If you have specified that an index should have three replicas, a quorum would be as follows:

int( (primary + 3 replicas) / 2 ) + 1 = 3

But if you start only two nodes, there will be insufficient active shard copies to satisfy the quorum, and you will be unable to index or delete any documents.

一致性

缺省的,即使尝试一个写操作,原始切片也需要“法定人数”的拷贝就绪。这是为了防止把数据写到“错误的网络区域”。

 http://blog.csdn.net/silent1/article/details/44590657

https://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-index_.html

 

   

分享到:
评论

相关推荐

    Elasticsearch-HBase-River同步

    两者各有优势,但在某些场景下,我们可能需要将HBase中的数据同步到Elasticsearch,以利用ES的实时搜索和分析能力。这就是"Elasticsearch-HBase-River"的作用。 **Elasticsearch-HBase-River插件** Elasticsearch-...

    《ElasticSearch入门到实战》电子书,从入门到进阶实战项目的教程文档,框架SpringBoot框架整合ES.zip

    18. **数据导入与同步**:实现数据从源系统到 Elasticsearch 的导入和实时同步机制。 19. **Web 应用开发**:构建基于 SpringBoot 的 Web 应用,提供 Elasticsearch 查询接口,展示查询结果。 20. **监控与报警**...

    基于canal的mysql和elasticsearch实时同步方案,支持增量同步和全量同步.zip

    - **调优策略**:根据业务需求调整Canal的消费速度、批量大小以及Elasticsearch的索引分片和副本数量。 8. **安全与稳定性** - **权限控制**:对Canal访问MySQL的权限进行严格限制,防止数据泄露。 - **容错机制...

    mysql数据导入elasticsearch并支持SQL查询

    MySQL到Elasticsearch的数据导入是将关系型数据库中的数据实时或定期同步到分布式搜索引擎Elasticsearch的过程,以实现更高效、灵活的搜索和分析。在本项目中,我们看到两个关键点:定时任务导入和SQL查询支持。 1....

    elasticsearch-7.10.2、kibana-7.10.2 Windows 版.zip

    1. **分布式**:Elasticsearch 可以跨多个节点分布数据,通过分片和副本机制实现高可用性,确保数据的安全性和容错性。 2. **实时**:数据一旦被索引,立刻可以进行搜索,无需等待任何同步过程。 3. **RESTful API**...

    ElasticSearch入门到精通(基于ELK技术栈ElasticSearch7.8.版本).rar

    **Elasticsearch 入门到精通** Elasticsearch 是一个高度可扩展的开源全文搜索引擎,设计用于处理大量数据,提供实时分析和搜索功能。它基于 Lucene 库,但提供了更高级别的分布式、RESTful 风格的搜索和数据分析...

    Elasticsearch 在物流系统的应用

    "Elasticsearch 在物流系统的应用" Elasticsearch 是一个基于 Lucene ...对于物流系统,未来规划需要根据運单数据的规模和搜索需求进行设计,例如升级到Elasticsearch 7.0版本、增加副本数、调大search queue队列等。

    基于Java8的SSM+Elasticsearch全文检索的个人博客系统.zip

    2. **数据同步**:当博客文章在数据库中创建、更新或删除时,需要将这些变化实时同步到Elasticsearch。这通常通过监听数据库的事件或者定时任务实现。 3. **索引设计**:根据博客文章的属性(如标题、内容、作者、...

    Springboot集成elasticsearch

    Elasticsearch(简称ES)作为一个强大的分布式搜索引擎,因其易用性、高可扩展性和实时性能而备受青睐。Spring Boot,作为Java开发框架的明星产品,通过简化配置使得开发变得更加便捷。本文将深入探讨如何将Spring ...

    Elasticsearch集成Hadoop最佳实践

    - **分片与副本**: 分片是 Elasticsearch 数据分布的基础,副本则提供了容错和负载均衡。根据集群规模和预期流量合理设置分片和副本数量。 - **倒排索引优化**: 考虑到查询性能,对高频率查询的字段使用更高效的倒...

    【精选】ES集群同步原理_es集群原理

    **ES集群同步原理详解** **一、ES集群基础概念** 1. **Cluster(集群)**:ES集群由多个节点组成,其中一个节点担任主节点(Master Node),负责协调集群中的各种操作,如索引分配、节点状态管理和元数据更新。主...

    elasticsearch-7.7.0-2020-linux-x86_64.tar.gz.zip

    但请注意,Elasticsearch默认是以守护进程的方式运行,可能会因为权限问题无法启动,所以建议以Java服务管理工具(如systemd或init.d)的方式来管理Elasticsearch。 在Elasticsearch中,数据以索引(Index)的形式...

    ElasticSearch Head.rar

    **Elasticsearch (ES) 知识点详解** Elasticsearch 是一个开源的分布式全文搜索引擎,它提供实时、可扩展的搜索和分析功能。在大数据时代,Elasticsearch 因其高效、灵活和强大的特性而备受青睐,广泛应用于日志...

    elasticsearch-2.4.2

    通过分片和副本机制,Elasticsearch 能够实现数据的高可用性和容错性。每个文档会被分配到多个分片上,这些分片可以分布在不同的节点上,当某个节点故障时,副本分片可以接管,确保服务不间断。 搜索功能是 Elastic...

    Springboot1.3.1+elasticsearch1.7.3集群

    以上内容涵盖了SpringBoot1.3.1与Elasticsearch1.7.3集群的关键知识点,包括集成方式、操作流程、查询机制、集群管理和性能优化等方面。通过理解并熟练掌握这些概念,可以有效地在SpringBoot应用中构建和使用Elastic...

    elasticsearch-5.1.2.tar.gz

    4. 搜索(Search):Elasticsearch支持全文搜索、短语搜索、模糊搜索、布尔运算等多种搜索方式。 二、Elasticsearch的分布式特性 1. 分片(Shard):Elasticsearch将大型索引分成多个分片,以便在多台机器上分布式...

    elasticsearch and logstash版本6.2.4同步mysql

    1. **分布式**:Elasticsearch 具有分片和副本机制,可以实现高可用性和容错性。 2. **实时**:数据一旦被索引,就立即可供搜索。 3. **可扩展**:通过简单的添加节点,可以轻松地扩展集群。 4. **全文搜索引擎**:...

Global site tag (gtag.js) - Google Analytics