码迷,mamicode.com
首页 > 其他好文 > 详细

Elasticsearch证书过期更新

时间:2019-01-30 12:55:22      阅读:507      评论:0      收藏:0      [点我收藏+]

标签:highlight   .json   register   pos   guid   each   文件   val   安装   

elasticsearch证书过期更新。

1.查看ES证书状态

curl -XGET -u admin:passwd ‘http://IP:9200/_license‘
{
  "license" : {
    "status" : "expired",
    "uid" : "ffe075ec-b906-450f-a614-e308310a032c",
    "type" : "trial",
    "issue_date" : "2018-11-20T12:11:30.011Z",
    "issue_date_in_millis" : 1542715890011,
    "expiry_date" : "2018-12-20T12:11:30.011Z",
    "expiry_date_in_millis" : 1545307890011,
    "max_nodes" : 1000,
    "issued_to" : "fsl-es",
    "issuer" : "elasticsearch",
    "start_date_in_millis" : -1
  }
}

 

2.注册elasticsearch账号获取证书

证书分为付费版和免费版,免费版会对节点数量有限制,但是一般的工作环境足够使用,因此我们采用BASIC授权文件。

登陆地址https://register.elastic.co/安装提示填写相关内容,然后就会受到es发送的邮件。邮件内容如下:

Thank you for using the Elastic Stack and registering for your free Basic license! This license expires on January 30, 2020.

To download your license, please go to:

--> http://license.elastic.co/registration/download/f***********              #此处链接为证书的下载地址

For license installation instructions:                              #下面3个链接为证书的导入方式,版本不同导入的方式也不一样

Elasticsearch 6.x -- https://www.elastic.co/guide/en/x-pack/current/license-management.html
Elasticsearch 5.x -- https://www.elastic.co/guide/en/x-pack/5.6/installing-license.html
Elasticsearch 2.x -- https://www.elastic.co/guide/en/marvel/current/license-management.html
Elasticsearch 1.x -- Use license code ‘1010‘ to register

If you have any questions or issues, please visit us on the forums: https://discuss.elastic.co/ or reach out to us directly at info@elastic.co.

Best,
The Elastic Team

--
http://elastic.co

 

3. 导入证书

1)上传证书到服务器

ll license.json
-rw-r--r-- 1 root root 1191 Jan 30 10:07 license.jso

 

2)5.x版本导入证书

curl -XPUT -u elastic http://IP:port/_xpack/license?acknowledge=true -H "Content-Type: application/json" -d @license.json
Enter host password for user ‘elastic‘:
{"acknowledged":true,"license_status":"valid"}

  

3)6.x版本导入证书 

curl -XPOST -u elastic http://ip:port/_xpack/license/start_basic?acknowledge=true -H "Content-Type: application/json" -d @license.json
Enter host password for user ‘elastic‘:
{"acknowledged":true,"license_status":"valid"}  

 备注:

查看证书状态

curl -XGET -u elastic:changeme ‘http://172.19.0.204:9200/_license‘
{
  "license" : {
    "status" : "active",
    "uid" : "9a99dbc6-d4fc-4b89-a4de-d68e5428e59d",
    "type" : "basic",
    "issue_date" : "2019-01-30T00:00:00.000Z",
    "issue_date_in_millis" : 1548806400000,
    "expiry_date" : "2020-01-30T23:59:59.999Z",
    "expiry_date_in_millis" : 1580428799999,
    "max_nodes" : 100,
    "issued_to" : "yjtx yjtx (yjtx)",
    "issuer" : "Web Form",
    "start_date_in_millis" : 1548806400000
  }
}

  

Elasticsearch证书过期更新

标签:highlight   .json   register   pos   guid   each   文件   val   安装   

原文地址:https://www.cnblogs.com/cangyuefeng/p/10337293.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!