ES证书到期,修改证书期限的办法


前言

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

将证书期限修改为50年的方法:

下载下来的证书也只有一年的有效期,一年后又要更新。为此,我们尝试将有效期延长,修改 License.json 文件中的一下字段:

1、将 "type":"basic" 替换为 "type":"platinum" (基础版变更为铂金版)
2、将 "expiry_date_in_millis":1561420799999 替换为 "expiry_date_in_millis":3107746200000(1年变为50年)

修改完记得执行命令重新生成一下哦~~


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM