Elasticsearch 滚动重启 必读
关键词:elasticsearch , es , 滚动重启 , 禁止分片
由于之前es GC没有怎么调优,结果今天被大量scroll查询查挂了,GC 卡死了。然后为了先恢复给业务使用,也没什么其他办法,只能重启server。重启的时候傻逼了,忘记了禁止分片,于是起来后集群就在重新做分片迁移了。这里记录一下ES部分重启或滚动重启的步骤。
参考:https://www.elastic.co/guide/en/elasticsearch/guide/current/_rolling_restarts.html
一般情况下可能是server因为GC、负载等原因卡死了,或升级了需要重启的配置了,这类场景下会要重启部分server或整个集群滚动重启。但是在这类重启场景下,ES的数据实际是没丢失的(指的是ES已经存下的数据,正在写入的数据需要客户端去自己做好重试)。
具体步骤就参见上面的官方文档link了:
- If possible, stop indexing new data. This is not always possible, but will help speed up recovery time. (补充:如果可以的话,最好停止读写后jmap触发强制GC看看有没机会让假死的程序恢复,虽然一般停止用户读写可能性不大;另,在停止服务前可以的话建议做好flush操作,但不是必须。)
Disable shard allocation. This prevents Elasticsearch from rebalancing missing shards until you tell it otherwise. If you know the maintenance window will be short, this is a good idea. You can disable allocation as follows:
PUT /_cluster/settings
{
"transient" : {
"cluster.routing.allocation.enable" : "none"
}
}- Shut down a single node.
- Perform a maintenance/upgrade.
- Restart the node, and confirm that it joins the cluster.
Reenable shard allocation as follows:
PUT /_cluster/settings
{
"transient" : {
"cluster.routing.allocation.enable" : "all"
}
}Shard rebalancing may take some time. Wait until the cluster has returned to status
greenbefore continuing.- (repeat前建议先确认集群状态,看看有没重启后出现问题)Repeat steps 2 through 6 for the rest of your nodes.
- At this point you are safe to resume indexing (if you had previously stopped), but waiting until the cluster is fully balanced before resuming indexing will help to speed up the process.
Elasticsearch 滚动重启 必读的更多相关文章
- ElasticSearch关闭重启命令
很多人学习elasticSearch都是自学,想百度一下如何重启es也是没有答案,我硬着头皮,算是琢磨出来了,借此写博,希望能帮助您. 1.如何关闭ES,elasticsearch关闭办法 1.使用h ...
- elasticsearch安全重启节点
elasticsearch集群,有时候可能需要修改配置,增加硬盘,扩展内存等操作,需要对节点进行维护升级.但是业务不能停,如果直接kill掉节点,可能导致数据丢失.而且集群会认为该节点挂掉了,就开始转 ...
- linux 添加elasticsearch 开机重启(自启动)
在 /etc/init.d 文件夹下建立脚本 eg:data.sh #chkconfig: 2345 80 90#description:auto_run#!bin/bashexport JAVA_H ...
- elasticsearch的重启
没有重启的操作,只有关闭了再启动的操作. ps -ef | grep elastic e表示全部的进程,f表示展示进程间的相关关系,如父子进程. 然后找到你启动es的那个账号,不是root,一般是新建 ...
- elasticsearch如何安全重启
elasticsearch如何安全重启节点 问题: elasticsearch集群,有时候可能需要修改配置,增加硬盘,扩展内存等操作,需要对节点进行维护升级.但是业务不能停,如果直接kill掉节 点, ...
- elasticsearch之节点重启
Elasticsearch节点重启时背后发生的故事有哪些,应该注意哪些配置内容,本篇文章做一个简单的探讨. 节点离开 在elasticsearch集群中,假设NodeA因为种种原因退出集群,在Node ...
- elasticsearch 大集群,双重别名,滚动更新分词方案
elasticsearch 滚动更新分词 国内用ik.hanlp.ansj或基于其二次开发的比较多 必然有分词变更的操作(主要是是加词) reindex+别名可以解决一部分问题,但在大集群上会影响业务 ...
- Elasticsearch集群运维
一.索引管理 1. 创建索引 PUT test-2019-03 { "settings": { "index": { "number_of_shard ...
- Elasticsearch 监控和部署
Elasticsearch: ! [ https://elasticsearch.cn/book/elasticsearch_definitive_guide_2.x/_cluster_health. ...
随机推荐
- TCP、UDP通信
开放系统互连参考模型 (Open System Interconnect 简称OSI) OSI七层模型 1.应用层2.表示层3.会话层4.传输层5.网络层6.数据链路层7.物理层 TCP/IP模型1. ...
- selenium采用find_element_by方法识别页面元素
主要是练习获取页面中的各元素,马克 # coding:utf-8 import time from selenium import webdriver import unittest from pyt ...
- shell的进度条【转】
生成进度条的俩个shell脚本 !/bin/bash i= bar='' index= arr=( "|" "/" "-" "\\ ...
- C#中上下文Context的理解
上下文指的是 进程间占有的资源空间. 当一个进程时间片到了或者资缺的时候就会让出cpu 当另一个进程开始始用CPU之前,系统要保存即将退出进程的执行状态,以便轮到时间片或有资源的时候现场恢复.这就所谓 ...
- 【原创】大数据基础之Impala(3)部分调优
1)将coordinator和executor角色分离 By default, each host in the cluster that runs the impalad daemon can ac ...
- git自动部署到服务器
1.现在服务器配置空仓库 mkdir -p test/project.git chmod 777 test cd test/project.git/ git init --bare . cd .. c ...
- 学习笔记_J2EE_SpringMVC_01_入门
1. 概述 笔者作为一个不太正经的不专业佛教信仰者,习惯了解事物的因果关系,所以概述就有点BBB...了.如果不喜欢这些的,请自行跳过概述章节,直接进入第二章的操作实践:2 入门示例. 1.1. ...
- Django 2.0 与 Django1.0在内部方法上的差异
models.Customer.tags.rel 方法 对于Django1 可以通过 models.Customer.tags.to.model.objects.all() 获取一个model下的Ma ...
- 在django中使用redis
方式一 utils文件夹下,简历redis_pool.py import redis POOL = redis.ConnectionPool(host='127.0.0.1', port=6379,p ...
- 逻辑卷管理(linux)
(创建分区)1.fdisk /dev/sdb2.n3default4.default5.+200M6.w7.partprobe(更新分区)8mkfs.ext4 /dev/sdb1//格式化sdb1.. ...