Elasticsearch 6.x升级7.x 版本的注意事项及填坑

根据部署方式不同存在不同升级方式,目前有两种

  • laradock部署的搜索引擎版本升级
  • AWS的搜索服务版本升级

一、laradock部署的搜索引擎版本升级

  1. 升级到 6.8.13
    1.1 elasticsearch/Dockerfile、kibana/Dockerfile 的版本号修改为 6.8.13
    1.2 docker-compose.yml 注释掉 elasticsearch 两个配置项:node.name=laradock-node 和 cluster.initial_master_nodes=laradock-node
    1.3 构建 elasticsearch、kibana 容器 docker-compose build --no-cache elasticsearch kibana,并启动 docker-compose up -d elasticsearch kibana
    1.4 浏览器输入地址 localhost:5601 进入kibana管理界面,找到菜单 Management -> 7.0 Upgrade Assistant 依次解决列出这些问题:
    在这里插入图片描述
  • 删除 .watches 索引

在这里插入图片描述

  • docker-compose.yml 的 ealsticsearch 增加配置项:
- node.name=laradock-node
- cluster.initial_master_nodes=laradock-node
- logger.deprecation.level=warn
  • 重建列出的索引在这里插入图片描述
  1. 升级到 7.9.3
    1.1 elasticsearch/Dockerfile、kibana/Dockerfile 的版本号修改为 7.9.3
    1.2 构建 elasticsearch、kibana 容器 docker-compose build --no-cache elasticsearch kibana,并启动 docker-compose up -d elasticsearch kibana

二、AWS搜索服务升级

帮助文档:Elasticsearch升级

三、QAQ 各类问题及解决

  • 升级到6.x版本后,账号密码:elastic changeme 使用不了
    原因:6.x版本之后 elastic 默认的密码不再是 changeme
解决方法:
1 进入elasticsearch 容器 docker-compose exec elasticsearch bash
2 重置密码 elasticsearch-setup-passwords interactive
3 设置成自己的密码
  • kibana 容器启动不了,报错 PollError [security_exception] missing authentication token
{"type":"log","@timestamp":"2021-01-08T06:20:56Z","tags":["warning","task_manager"],"pid":1,"message":"PollError [security_exception] missing authentication token for REST request [/_template/.kibana_task_manager?include_type_name=true&filter_path=*.version], with { header={ WWW-Authenticate=\"Basic realm=\\\"security\\\" charset=\\\"UTF-8\\\"\" } }"}
{"type":"log","@timestamp":"2021-01-08T06:20:58Z","tags":["license","warning","xpack"],"pid":1,"message":"License information from the X-Pack plugin could not be obtained from Elasticsearch for the [data] cluster. [security_exception] missing authentication token for REST request [/_xpack], with { header={ WWW-Authenticate=\"Basic realm=\\\"security\\\" charset=\\\"UTF-8\\\"\" } } :: {\"path\":\"/_xpack\",\"statusCode\":401,\"response\":\"{\\\"error\\\":{\\\"root_cause\\\":[{\\\"type\\\":\\\"security_exception\\\",\\\"reason\\\":\\\"missing authentication token for REST request [/_xpack]\\\",\\\"header\\\":{\\\"WWW-Authenticate\\\":\\\"Basic realm=\\\\\\\"security\\\\\\\" charset=\\\\\\\"UTF-8\\\\\\\"\\\"}}],\\\"type\\\":\\\"security_exception\\\",\\\"reason\\\":\\\"missing authentication token for REST request [/_xpack]\\\",\\\"header\\\":{\\\"WWW-Authenticate\\\":\\\"Basic realm=\\\\\\\"security\\\\\\\" charset=\\\\\\\"UTF-8\\\\\\\"\\\"}},\\\"status\\\":401}\",\"wwwAuthenticateDirective\":\"Basic realm=\\\"security\\\" charset=\\\"UTF-8\\\"\"}"}
解决方法:
1 进入 kibana 容器 docker-compose exec kibana bash
2 修改配置文件 vi config/kibana.yml
3 增加 elasticsearch 账号密码配置:elasticsearch.username: elastic 和
elasticsearch.password: changeme
4 重启 kibana容器 docker-compose restart kibana
  • kibana容器启动报错 FATAL Error: Index .kibana belongs to a version of Kibana that cannot be automatically migrated. Reset it or use the X-Pack upgrade assistant.
解决方法:
1 进入 workspace 容器 docker-compose exec workspace bash后删除 .kibana 索引 curl -XDELETE -u elastic:changeme 'http://elasticsearch:9200/.kibana'
3 重启kibana容器 docker-compose restart kibana
  • 删除 .watches 索引时报错 This endpoint is not supported for DELETE on .watches index.
解决方法: 如何删除 .watches 索引
1 docker-compose.yml 增加配置项:xpack.watcher.index.rest.direct_access=true
2 重启 elasticsearch 容器 docker-compose restart elasticsearch
3 进入 workspace 容器 docker-compose exec workspace bash 后删除 .watches 索引 curl -XDELETE -u elastic:changeme 'http://elasticsearch:9200/.watches'
4 docker-compose.yml 删除配置项:xpack.watcher.index.rest.direct_access=true
5 重启 elasticsearch 容器 docker-compose restart elasticsearch
  • 构建 elasticsearch 容器时报错 failed to read local state
解决方法:
1 删除 elasticsearch 的 数据卷 docker volume rm laradock_elasticsearch
2 重新构建 elasticsearch 容器 docker-compose build --no-cache elasticsearch
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值