Elasticsearch升级踩坑记之升级elasticsearch2.x到elasticsearch5.x

参考文档:
https://www.elastic.co/guide/en/elasticsearch/reference/2.4/restart-upgrade.html

一开始是尝试使用rolling upgrade的方式升级,但是后来发现从2.x升级到5.x是一个大的升级,需要采用full restart upgrade的方式升级,参考连接中的表格:
https://www.elastic.co/guide/en/elasticsearch/reference/5.6/setup-upgrade.html

先将想要升级的版本对应的tar.gz包下载下来,解压,将旧版2.x的elasticsearch.yml文件复制到5.x的config目录下,覆盖相应的elasticsearch.yml文件。数据目录和日志目录都不用改,5.xelasticsearch启动后可以直接使用2.x的elasticsearch data目录下的数据,二者是兼容的。

修改系统配置:
Vim /etc/sysctl.conf
设置
fs.file-max=655350
vm.max_map_count=655360
保存之后sysctl -p使设置生效

将之前的65535修改成655350
vi /etc/security/limits.conf 
*               soft    nofile          655350
*               hard    nofile             655350

以上步骤完成后,关闭2.x旧版机器,节点全部关闭,退出elastic用户重新登录(必须退出重新登录系统配置才能生效),启动5.x新版elasticsearch所有节点。当节点全部加入集群,集群状态有yellow变成green时,集群更新完成。

查看集群健康状态

[root@localhost nodes]# curl -XGET 192.168.1.146:9200/_cat/health?pretty
1520927394 15:49:54 es_test green 3 3 84 42 0 0 0 0 - 100.0% 
[root@localhost nodes]# curl -XGET 192.168.1.146:9200/_cat/nodes
192.168.1.146 192.168.1.146  3 45 0.02 d m node-1 
192.168.1.151 192.168.1.151 12 94 0.38 d m node-2 
192.168.1.152 192.168.1.152  9 67 0.21 d * node-3 

查看版本

[root@localhost 0]# curl -XGET 192.168.1.146:9200
{
  "name" : "node-1",
  "cluster_name" : "es_test",
  "cluster_uuid" : "9Ud3N-NNS_C4PWF7YKp73g",
  "version" : {
    "number" : "5.6.8",
    "build_hash" : "688ecce",
    "build_date" : "2018-02-16T16:46:30.010Z",
    "build_snapshot" : false,
    "lucene_version" : "6.6.1"
  },
  "tagline" : "You Know, for Search"
}

索引备份请参考:
http://blog.csdn.net/u012062455/article/details/79570996

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值