Elasticsearch证书过期更新
Posted cangyuefeng
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Elasticsearch证书过期更新相关的知识,希望对你有一定的参考价值。
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 [email protected] 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证书过期更新的主要内容,如果未能解决你的问题,请参考以下文章