Elasticsearch集群许可证过期问题解决方法汇总

最近在使用elasticsearch的过程中,使用elastic-head进行可视化展示集群的状态和信息,从2024年5月18日突然elastic-head无法现在集群的状态界面啦,elasticsearch集群状态是正常,命令如下:

curl -X GET "localhost:9200/_cluster/health?pretty"

在google页面上通过F12查看状态和报错信息如下:

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

注册成功后,使用的邮件会收到下载链接信息。

(3)点击下载与ES对应的版本

如下命令是查看es版本的命令:

curl http://localhost:9200

(4)下载的许可证文件上传到ES服务器任意位置,许可证文件名可修改.

(5)查看许可证过期时间命令

 curl -XGET -u elastic:changeme 'http://localhost:9200/_xpack/license'

(6)使用新下载的许可证

curl -XPUT 'http://localhost:9200/_xpack/license?acknowledge=true' -d @license.json

curl -H "Content-Type: application/json" 'http://localhost:9200/_xpack/license?acknowledge=true' -d @license.json

(7)再次查看许可证过期时间是否增加

还有个临时解决方案:

原因:ES的X-pack许可证是提供免费一个月的试用,但是到期之后,就会报这个错误

解决方法

可使用以下任意一种方式:

1.登录kibana控制台执行命令

POST /_license/start_basic?acknowledge=true

2.直接请求es

curl -XPOST “http://localhost:9200/_license/start_basic?acknowledge=true”

注意: 以上方式只是 暂时 解决问题,到一定时间以后,依然会出现 证书过期 的错误,到时候依然需要再次执行以上命令来保证 es 正常运行

另外一种方式使用kibana来更新证书,如下是具体更新的界面.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值