es 集群的重启

一、 es 1

1.关闭集群的动态分片:(动态分片开启状态如果节点宕机了,会导致集群重新分配数据进行数据转移,会导致节点直接大量传输数据)

curl -XPUT ‘http://10.3.14.154:9200/_cluster/settings?pretty’ -d ‘{“transient”:{“cluster.routing.allocation.disable_allocation”: true}}’

curl -XPUT 'http://10.3.14.154:9200/_cluster/settings?pretty' -d '{"transient":{"cluster.routing.allocation.disable_allocation": true}}'
{
  "error" : "Content-Type header [application/x-www-form-urlencoded] is not supported",
  "status" : 406
}
2. 查看进程和杀死进程
  • 重启前,进入到业务账号很重要。见过死的谁都害怕
    ps -ef | grep elas
    kill -9 12955
3.重启 服务

cd ~/bin
./elasticsearch -d

4.确认进程是否启动

ps -ef | grep elasticsearch

5.开启集群的动态分片:

curl -XPUT ‘http://10.3.14.155:9200/_cluster/settings?pretty’ -d ‘{“transient”:{“cluster.routing.allocation.disable_allocation”: false}}’

{
“error” : “Content-Type header [application/x-www-form-urlencoded] is not supported”,
“status” : 406
}

6.检查集群的健康状态

curl 10.3.14.154:9200/_cluster/health?pretty

{
“cluster_name” : “elasticsearch”,
“status” : “yellow”,
“timed_out” : false,
“number_of_nodes” : 3,
“number_of_data_nodes” : 3,
“active_primary_shards” : 5,
“active_shards” : 8,
“relocating_shards” : 0,
“initializing_shards” : 2,
“unassigned_shards” : 0,
“delayed_unassigned_shards” : 0,
“number_of_pending_tasks” : 1,
“number_of_in_flight_fetch” : 0,
“task_max_waiting_in_queue_millis” : 0,
“active_shards_percent_as_number” : 80.0
}

https://shihlei.iteye.com/blog/2418651

7、es 状态查看的脚本

curl '10.3.14.161:9200/_cat/health?'
curl '10.3.14.161:9200/_cat/health?v'

在这里插入图片描述

curl -sXGET http://10.3.14.161:9200/_cluster/health/?pretty 

在这里插入图片描述

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

运维螺丝钉

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值