前言
之前安装Elasticsearch时,没注意有试用期限,导致早上服务突然停止,查看日志提示如下错误:
[ERROR][o.e.x.s.a.f.SecurityActionFilter] [l-pgvpc] blocking [cluster:monitor/health] operation due to expired license. Cluster health, cluster stats and indices stats
operations are blocked on license expiration. All data operations (read and write) continue to work.
If you have a new license, please update it. Otherwise, please reach out to your support contact.
到官网查看后,发现第一个license只有30天试用期+7天保存数据时长,超过试用期后程序就无法正常运行了,只能再次申请license
免费的license一年只能申请一次,有效期1年
更新license
登录官方license申请地址 https://register.elastic.co/marvel_register
看到如下页面,依次填写姓名,姓氏,邮箱,公司,国家,填完后点击Send
进入邮箱查收邮件,看到如下内容
点击链接下载license,选择对应版本的license;根据自己的版本查看更新方法
上传license到Elasticsearch服务器
curl -XPUT -u elastic 'http://10.10.10.1:9200/_xpack/license' -H "Content-Type: application/json" -d @license.json
如果新的license不支持以前license中提供的所有功能,则返回如下信息。要完成license安装,必须重新提交license更新请求并将acknowledge参数设置为true以表示已了解更改。
{"acknowledged":false,"license_status":"valid","acknowledge":{"message":"This license update requires acknowledgement. To acknowledge the license, please read the following messages and update the license again, this time with the \"acknowledge=true\" parameter:","watcher":["Watcher will be disabled"],"security":["The following X-Pack security functionality will be disabled: authentication, authorization, ip filtering, and auditing. Please restart your node after applying the license.","Field and document level access control will be disabled.","Custom realms will be ignored."],"monitoring":["Multi-cluster support is disabled for clusters with [BASIC] license. If you are\nrunning multiple clusters, users won't be able to access the clusters with\n[BASIC] licenses from within a single X-Pack Kibana instance. You will have to deploy a\nseparate and dedicated X-pack Kibana instance for each [BASIC] cluster you wish to monitor.","Automatic index cleanup is locked to 7 days for clusters with [BASIC] license."],"graph":["Graph will be disabled"],"ml":["Machine learning will be disabled"]}}
curl -XPUT -u elastic 'http://10.10.10.1:9200/_xpack/license?acknowledge=true' -H "Content-Type: application/json" -d @license.json
返回如下信息说明安装成功
{"acknowledged":true,"license_status":"valid"}
在bash下输入,查看license状态
curl -XGET -u user:password 'http://10.10.10.1:9200/_license'
出现如下所示,说明更新成功