首页 文章 精选 留言 我的

精选列表

搜索[es],共3900篇文章
优秀的个人博客,低调大师

ES不设置副本是非常脆弱的,整个文章告诉了你为什么

Delaying Shard Allocation As discussed way back inScale Horizontally, Elasticsearch will automatically balance shards between your available nodes, both when new nodes are added and when existing nodes leave. Theoretically, this is the best thing to do. We want to recover missing primaries by promoting replicas as soon as possible. We also want to make sure resources are balanced evenly across the cluster to prevent hotspots. In practice, however, immediately re-balancing can cause more problems than it solves. For example, consider this situation: Node 19 loses connectivity to your network (someone tripped on the power cable) Immediately, the master notices the node departure. It determines what primary shards were on Node 19 and promotes the corresponding replicas around the cluster After replicas have been promoted to primary, the master begins issuing recovery commands to rebuild the now-missing replicas. Nodes around the cluster fire up their NICs and start pumping shard data to each other in an attempt to get back to green health status This process will likely trigger a small cascade of shard movement, since the cluster is now unbalanced. Unrelated shards will be moved between hosts to accomplish better balancing Meanwhile, the hapless admin who kicked out the power cable plugs it back in.Node 19 reboots and rejoins the cluster. Unfortunately, the node is informed that its existing data is now useless; the data being re-allocated elsewhere. So Node 19 deletes its local data and begins recovering a different set of shards from the cluster (which then causes a new minor re-balancing dance). If this all sounds needless and expensive, you’re right. It is, butonly when you know the node will be back soon. If Node 19 was truly gone, the above procedure is exactly what we want to happen. To help address these transient outages, Elasticsearch has the ability to delay shard allocation. This gives your cluster time to see if nodes will rejoin before starting the re-balancing dance. Changing the default delay By default, the cluster will wait one minute to see if the node will rejoin. If the node rejoins before the timer expires, the rejoining node will use its existing shards and no shard allocation occurs. This default time can be changed either globally, or on a per-index basis, by configuring thedelayed_timeoutsetting: PUT /_all/_settings { "settings": { "index.unassigned.node_left.delayed_timeout": "5m" } } By using the_allindex name, we can apply this setting to all indices in the cluster The default time is changed to 5 minutes The setting is dynamic and can be changed at runtime. If you would like shards to allocate immediately instead of waiting, you can setdelayed_timeout: 0. Delayed allocation won’t prevent replicas from being promoted to primaries. The cluster will still perform promotions as necessary to get the cluster back toyellowstatus. The allocation of the now-missing replicas will be the only process that is delayed Auto-cancellation of shard relocation What happens if the node comes backafterthe timeout expires, but before the cluster has finished moving shards around? In this case, Elasticsearch will check to see if the on-disk data matches the current "live" data in the primary shard. If the two shards are identical — meaning there have been no new documents, updates or deletes — the master will cancel the on-going rebalancing and restore the on-disk data. This is done since recovery of on-disk data will always be faster than transferring over the network, and since we can guarantee the shards are identical, the process is a win-win. If the shards have diverged (e.g. new documents have been indexed since the node went down), the recovery process will continue as normal. The rejoining node will delete it’s local, out-dated shards and obtain a new set. 本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/bonelee/p/7444495.html,如需转载请自行联系原作者

优秀的个人博客,低调大师

用 ES、MongoDB 和 PgSQL 做日志系统的日志数据库,优缺点各有哪些?

目前系统里有各种log,每次处理比较麻烦,想做一个专有的日志服务web程序,用数据库存日志,但日志可视化显示定制为自己的网页。关于数据库,我想到了postgresql,Elasticsearch,mongodb其中Elasticsearch,mongodb是文档数据库,postgresql有json字段,是关系型数据库,但拥有文档数据库的特性。 请问用这三个做数据库做存日志服务,优缺点有哪些呢 关于Elasticsearch。用java语言访问的话,我查了一下java连接Elasticsearch的教程,我点几个看了一下,似乎都是用http客户端的形式,java连Elasticsearch是必须要借助http客户端这种方式,而不是用类似jdbc驱动这种吗?

优秀的个人博客,低调大师

ES跨版本升级?——难道升级集群发生shard allocation是因为要分配replica节点???

Full cluster restart upgrade Elasticsearch requires a full cluster restart when upgrading across major versions. Rolling upgrades are not supported across major versions. Consult thistableto verify that a full cluster restart is required. The process to perform an upgrade with a full cluster restart is as follows: Disable shard allocation——防止分片大量复制数据 When you shut down a node, the allocation process will immediately try to replicate the shards that were on that node to other nodes in the cluster, causing a lot of wasted I/O. This can be avoided by disabling allocation before shutting down a node: PUT _cluster/settings { "persistent": { "cluster.routing.allocation.enable": "none" } } COPY AS CURL VIEW IN CONSOLE Perform a synced flush Shard recovery will be much faster if you stop indexing and issue asynced-flushrequest: POST _flush/synced COPY AS CURL VIEW IN CONSOLE A synced flush request is a “best effort” operation. It will fail if there are any pending indexing operations, but it is safe to reissue the request multiple times if necessary. Shutdown and upgrade all nodes Stop all Elasticsearch services on all nodes in the cluster. Each node can be upgraded following the same procedure described in[upgrade-node]. Upgrade any plugins Elasticsearch plugins must be upgraded when upgrading a node. Use theelasticsearch-pluginscript to install the correct version of any plugins that you need. Start the cluster——先启动主节点,然后再是数据节点 If you have dedicated master nodes — nodes withnode.masterset totrue(the default) andnode.dataset tofalse — then it is a good idea to start them first. Wait for them to form a cluster and to elect a master before proceeding with the data nodes. You can check progress by looking at the logs. As soon as theminimum number of master-eligible nodeshave discovered each other, they will form a cluster and elect a master. From that point on, the_cat/healthand_cat/nodesAPIs can be used to monitor nodes joining the cluster: GET _cat/health GET _cat/nodes COPY AS CURL VIEW IN CONSOLE Use these APIs to check that all nodes have successfully joined the cluster. Wait for yellow As soon as each node has joined the cluster, it will start to recover any primary shards that are stored locally. Initially, the_cat/healthrequest will report astatusofred, meaning that not all primary shards have been allocated. Once each node has recovered its local shards, thestatuswill becomeyellow, meaning all primary shards have been recovered, but not all replica shards are allocated. This is to be expected because allocation is still disabled. Reenable allocation Delaying the allocation of replicas until all nodes have joined the cluster allows the master to allocate replicas to nodes which already have local shard copies.At this point, with all the nodes in the cluster, it is safe to reenable shard allocation: PUT _cluster/settings { "persistent": { "cluster.routing.allocation.enable": "all" } } COPY AS CURL VIEW IN CONSOLE The cluster will now start allocating replica shards to all data nodes(难道升级集群发生shard allocation是因为要分配replica节点???).At this point it is safe to resume indexing and searching, but your cluster will recover more quickly if you can delay indexing and searching until all shards have recovered. You can monitor progress with the_cat/healthand_cat/recoveryAPIs: GET _cat/health GET _cat/recovery COPY AS CURL VIEW IN CONSOLE Once thestatuscolumn in the_cat/healthoutput has reachedgreen, all primary and replica shards have been successfully allocated. 本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/bonelee/p/7444080.html ,如需转载请自行联系原作者

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

用户登录
用户注册