学会偷懒,并懒出效率

x-pack插件证书如何更新?

xpack安装完成后,默认情况下,x-pack插件license有效期为一个月
通过如下命令查询:
# curl -XGET -u admin:123456 'localhost:9200/_xpack/license'

{
  "license" : {
    "status" : "active",
    "uid" : "53713854-15d9-46d4-8ad5-b0b6acca5ff5",
    "type" : "trial",
    "issue_date" : "2017-11-28T11:14:12.587Z",
    "issue_date_in_millis" : 1511867652587,
    "expiry_date" : "2017-12-28T11:14:12.587Z",      //2017-12-28过期
    "expiry_date_in_millis" : 1514459652587,
    "max_nodes" : 1000,
    "issued_to" : "es_production",
    "issuer" : "elasticsearch",
    "start_date_in_millis" : -1
  }
}

下载证书

注册用户获取基础license,有效期1年, 注册地址:https://register.elastic.co/xpack_register 注册成功后,会在你的邮箱收到一封邮件如下:
Thank you for using the Elastic Stack and registering for your free Basic license! This license expires on November 29, 2018同时也告诉你下载地址了。

下载证书json文件后,重命名为: xpack_license20181129.json,然后把这个文件上传到/opt/modules/src/目录

更新license命令:
# curl -XPUT -u admin:123456 'http://192.168.46.132:9200/_xpack/license?pretty&acknowledge=true' -H "Content-Type: application/json" -d @/opt/modules/src/xpack_license20181129.json

{
  "acknowledged" : true,     //更新成功
  "license_status" : "valid"
}

证书权限表:https://www.elastic.co/subscriptions#request-info