升级后发现es服务无法启动,发现报错如下:

升级原因:kibana 升级至6.4 无法正常启动连接 6.2 版本es集群数据;

x-pack 插件错误:

[2018-09-19×××7:12:54,555][ERROR][o.e.b.Bootstrap          ] Exception
java.lang.IllegalArgumentException: property [name] is missing in [/usr/share/elasticsearch/plugins/x-pack/plugin-descriptor.properties]

按要求添加文件,重启服务发现问题无法解决,经查询发现,6.4版本已经将x-pack 转换为模块,安装时会自动添加。

由于6.2版本使用/usr/share/elasticsearch/bin/elasticsearch-plugin install 安装的,使用yum 升级 es 服务会遗留就插件文件,所以要手动删除 x-spak 插件文件夹 (每一个节点)。

执行操作如下:

mv /usr/share/elasticsearch/plugins/x-pack /esbackup/x-pack.20180919

插件删除后,再次重启服务,日志报错如下:

org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: Plugin [repository-s3] was built for Elasticsearch version 6.2.4 but version 6.4.1 is running

6.2 版本使用S3备份,原插件版本也无法使用了!!!!

[root@jp33e502-4-13 ~]# /usr/share/elasticsearch/bin/elasticsearch-plugin list
repository-s3
WARNING: plugin [repository-s3] was built for Elasticsearch version 6.2.4 but version 6.4.1 is required

删除S3备份插件

[root@jp33e502-4-13 ~]# /usr/share/elasticsearch/bin/elasticsearch-plugin remove repository-s3
-> removing [repository-s3]...
-> preserving plugin config files [/etc/elasticsearch/repository-s3] in case of upgrade; use --purge if not needed
[root@jp33e502-4-13 ~]# /usr/share/elasticsearch/bin/elasticsearch-plugin list

插件删除后,再次重启服务,日志报错如下:

S3 备份时集群内配置的key也需要删除!!!

Caused by: java.lang.IllegalArgumentException: unknown secure setting [s3.client.default.access_key] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
        at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:393) ~[elasticsearch-6.4.1.jar:6.4.1]
        at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:339) ~[elasticsearch-6.4.1.jar:6.4.1]
        at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:311) ~[elasticsearch-6.4.1.jar:6.4.1]
        at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:282) ~[elasticsearch-6.4.1.jar:6.4.1]
        at org.elasticsearch.common.settings.SettingsModule.(SettingsModule.java:135) ~[elasticsearch-6.4.1.jar:6.4.1]
        at org.elasticsearch.node.Node.(Node.java:343) ~[elasticsearch-6.4.1.jar:6.4.1]
        at org.elasticsearch.node.Node.(Node.java:256) ~[elasticsearch-6.4.1.jar:6.4.1]
        at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:213) ~[elasticsearch-6.4.1.jar:6.4.1]
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:213) ~[elasticsearch-6.4.1.jar:6.4.1]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:326) ~[elasticsearch-6.4.1.jar:6.4.1]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) ~[elasticsearch-6.4.1.jar:6.4.1]
        ... 6 more
        Suppressed: java.lang.IllegalArgumentException: unknown secure setting [s3.client.default.secret_key] please check that any required plugins are installed, or check the breaking changes documentation for removed settings

删除 key 信息:

/usr/share/elasticsearch/bin/elasticsearch-keystore remove s3.client.default.access_key
/usr/share/elasticsearch/bin/elasticsearch-keystore remove s3.client.default.secret_key

启动es 服务正常,集群逐步恢复至正常状态,万幸数据没有影响。

问题总结:

  早就听说es升级比较生猛,今日一见果然不同凡响!!!
1:直接使用yum update elasticsearch  升级服务版本,要先看服务发布的release 信息,不要用常规思路对待es的小版本升级;
2:ES 服务小版本之间也可能做大改动,直接放弃之前版本的一些特性;
3:6.2升级6.4 推荐先删除6.2 版本安装的所有插件;
4:升级之前先在备份环境充分演练,梳理思路,整理步骤以便能够快速完成升级;
5:备份数据;
6: .....