当你执行索引相关操作有如下报错:
HTTP/1.1 403 Forbidden
content-type: application/json; charset=UTF-8
content-length: 384
{
"error" : {
"root_cause" : [
{
"type" : "security_exception",
"reason" : "current license is non-compliant for [security]",
"license.expired.feature" : "security"
}
],
"type" : "security_exception",
"reason" : "current license is non-compliant for [security]",
"license.expired.feature" : "security"
},
"status" : 403
}
这就提示你许可证过期需要重新申请。
步骤如下:
1. 登录注册
Register | Elastic
https://license.elastic.co/registration

注册成功!邮件会收到下载链接。

2. 点击下载与ES对应的版本
查看ES版本:curl http://172.16.18.140:9200
3. 将下载好的许可证文件上传到ES所在服务器任意位置
许可证文件的文件名是可以修改的

4. 查看原来许可证过期时间
curl -XGET -u elastic:changeme 'http://172.16.18.140:9200/_xpack/license'

5. 使用新下载的许可证
添加证书(两种方式任选一种)
curl -XPUT 'http://172.16.18.140:9200/_xpack/license?acknowledge=true' -d @license.json
curl -H "Content-Type: application/json" 'http://172.16.18.140:9200/_xpack/license?acknowledge=true' -d @license.json
6. 再次查看许可证过期时间

有效期增加了一年。


![新兴新能源设施[2]--盐穴压缩空气储能预警模块开发](https://img-blog.csdnimg.cn/f05a82a2b16c4f589ee4834298afad5d.png)















