es从6.5升级到6.8(单节点)

 

原es版本:6.5.0

新es版本:6.8.5

 

1.禁用集群分片配置
首先查看集群分片配置
[root@localhost soft]# curl -u elastic:elastic -XGET "http://192.168.1.135:19200/_cluster/settings?pretty"
{
  "persistent" : { },
  "transient" : { }
}
我这里是单节点的es,所以不需要进行该操作

curl -u elastic:elastic -H 'Content-Type: application/json' -X PUT "http://192.168.1.135:19200/_cluster/settings" -d'
{
"persistent": {
"cluster.routing.allocation.enable": "primaries"
}
}
'

2.停止不必要的索引并执行同步刷新(可选操作)
[root@localhost soft]# curl -u elastic:elastic -X POST http://192.168.1.135:19200/_flush/synced?pretty
{
  "_shards" : {
    "total" : 42,
    "successful" : 42,
    "failed" : 0
  },
  "inoculate_new" : {
    "total" : 10,
    "successful" : 10,
    "failed" : 0
  },
  "db_customer" : {
    "total" : 10,
    "successful" : 10,
    "failed" : 0
  },
  "db_test" : {
    "total" : 10,
    "successful" : 10,
    "failed" : 0
  },
  ".security-6" : {
    "total" : 2,
    "successful" : 2,
    "failed" : 0
  },
  "reservation_new" : {
    "total" : 10,
    "successful" : 10,
    "failed" : 0
  }
}


3.停止所有正在运行的机器学习作业(6.5版本没有set_upgrade_mode,该步骤省略掉)
curl -u elastic:elastic -X POST http://192.168.1.135:19200/_ml/set_upgrade_mode?enabled=true


4.停掉原来的节点
systemctl stop elasticsearch
或是采用kill的方式杀掉es进程

5.升级指定的节点
加压安装
[root@localhost soft]# tar -xvf elasticsearch-6.8.5.tar.gz
[root@localhost soft]# mv elasticsearch-6.8.5 /home/yeemiao/

拷贝就的环境的配置文件到新的环境的相应目录下
cp /home/yeemiao/single_elasticsearch/config/{elasticsearch.yml,jvm.options} /home/yeemiao/elasticsearch-6.8.5/config/
修改es目录权限
[root@localhost yeemiao]# cd /home/yeemiao
[root@localhost yeemiao]# chown -R yeemiao.yeemiao ./elasticsearch-6.8.5/

启动
[root@localhost yeemiao]# su - yeemiao
[yeemiao@localhost bin]$ cd /home/yeemiao/elasticsearch-6.8.5/bin
[yeemiao@localhost bin]$ ./elasticsearch -d


这里很多地方报错,是因为我这里6.5的xpath是破解的,注释掉相应的配置文件即可
##xpack.security.transport.ssl.verification_mode: certificate
##xpack.security.transport.ssl.keystore.path: certs/elastic-certificates.p12
##xpack.security.transport.ssl.truststore.path: certs/elastic-certificates.p12


迁移数据文件(不是必须的)
停掉es
[yeemiao@localhost config]$ kill -9 3358
拷贝数据文件
[yeemiao@localhost single_elasticsearch]$ cp -R ./data /home/yeemiao/elasticsearch-6.8.5/
修改新升级后版本的配置文件
path.data: /home/yeemiao/elasticsearch-6.8.5/data
path.logs: /home/yeemiao/elasticsearch-6.8.5/logs


8.启用分片
curl -u elastic:elastic -H 'Content-Type: application/json' -X PUT "http://192.168.1.135:19200/_cluster/settings" -d'
{
"persistent": {
"cluster.routing.allocation.enable": null
}
}
'

9.重启机器学习作业(这个是6.8才有的功能).
curl -u elastic:elastic -X POST http://192.168.1.135:19200/_ml/set_upgrade_mode?enabled=false


10.查看健康情况
curl -u elastic:elastic -XGET http://192.168.1.135:19200/_cat/health?v
curl -u elastic:elastic 'http://192.168.1.135:19200/_cat/indices?v'
curl -u elastic:elastic http://192.168.1.135:19200/?pretty

posted @   slnngk  阅读(1379)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
点击右上角即可分享
微信分享提示