为windows环境的elasticsearch更新license授权文件

        我win7电脑安装了elasticsearch-2.3.0,一个月以前安装了shield插件,为了增加基本的用户名和密码认证;安装shield插件,首先要安装license,有效期一个月。当时不知道是过期了,只知道elasticsearch启动不了,然后去看日志,报:

operation due to expired license. Cluster health, cluster stats and indices stats

operations are blocked on shield 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.

     然后在网上搜到了在linux上如何更新license。基本上都是用curl 命令操作的,对于windows来说不太方便。不过道理都一样,将新的license提交到elasticsearch;那我们就用postman来提交,提交之前有个问题要注意:虽然license已过期,elasticsearch无法启动,但是之前配置过用户名密码,所以只要访问elasticsearch就要加上用户名和密码,要不然会报401,权限不够。

    第一步:去elasticsearch官网申请一个新的license,打开申请地址https://register.elastic.co/marvel_register

    填入各项信息后,会给你邮箱发送一封license的下载地址,有两个版本2.x和5.x,根据自己的elasticsearch版本选择

为windows环境的elasticsearch更新license授权文件

    第二步:打开postman,请求方式为put,填入提交的url地址,在Authorization中填入用户名和密码,先别发送

为windows环境的elasticsearch更新license授权文件

    第三步:在body>raw里面粘贴上你申请的license文件的内容:

为windows环境的elasticsearch更新license授权文件

     第四步:点击send按钮发送就更新成功了。然后再启动elasticsearch就ok了

   参考博客:https://www.cnblogs.com/kasumi/p/6419803.html (linux上更新方式)