ES下载安装后有一个月试用期,到期后需要更新License,且每个License有效期为 1 年,License过期前10天里相关log会一直出现,提醒用户更新,支持实时更新无需重启服务。
curl -XGET -u username:password ‘http://localhost:9200/_cat/nodes‘
curl -XGET -u username:password ‘http://localhost:9200/_cluster/health?pretty=true‘
curl -XGET -u username:password ‘http://localhost:9200/_xpack/license‘
如果已过期,去https://register.elastic.co/registration 网址上注册一个,成功后ELK会向注册邮箱发送邮件,然后去邮箱链接下载你的License。
将刚才下载下来的license.json文件上传至es集群机器
curl -XPUT -u username:password http://localhost:9200/_xpack/license?acknowledge=true -H "Content-Type: application/json" -d @license.json
或者:
curl -XPUT -u username:password "http://ip:port/_xpack/license" -d @license.json
下载下来的证书也只有一年的有效期,一年后又要更新。为此,我们尝试将有效期延长,修改 License.json 文件中的一下字段:
1、将 "type":"basic" 替换为 "type":"platinum" (基础版变更为铂金版)
2、将 "expiry_date_in_millis":1561420799999 替换为 "expiry_date_in_millis":3107746200000(1年变为50年)
修改完记得执行命令重新生成一下哦~~
原文:https://www.cnblogs.com/mmzl/p/14522070.html