【elasticsearch】license管理

1.license管理 

--查看当前的license:basic 
[esadmin@oracle1 config]$ curl -XGET -u elastic:esadmin -H "Content-Type: application/json" -v "http://192.168.1.7:9201/_license"
* About to connect() to 192.168.1.7 port 9201 (#0)
*   Trying 192.168.1.7...
* Connected to 192.168.1.7 (192.168.1.7) port 9201 (#0)
* Server auth using Basic with user 'elastic'
> GET /_license HTTP/1.1
> Authorization: Basic ZWxhc3RpYzplc2FkbWlu
> User-Agent: curl/7.29.0
> Host: 192.168.1.7:9201
> Accept: */*
> Content-Type: application/json
> 
< HTTP/1.1 200 OK
< content-type: application/json; charset=UTF-8
< content-length: 334
< 
{
  "license" : {
    "status" : "active",
    "uid" : "a415fa6f-dec6-468e-9007-dbbfb3fd7bd4",
    "type" : "basic",
    "issue_date" : "2024-06-27T03:05:08.095Z",
    "issue_date_in_millis" : 1719457508095,
    "max_nodes" : 1000,
    "issued_to" : "escluster1",
    "issuer" : "elasticsearch",
    "start_date_in_millis" : -1
  }
}
* Connection #0 to host 192.168.1.7 left intact

2.设置license为start_trial,即试用版本的30天

curl -XPOST -u elastic:esadmin http://192.168.1.7:9201/_xpack/license/start_trial?acknowledge=true -H "Content-Type:application/json"

[esadmin@oracle1 config]$ curl -XGET -u elastic:esadmin -H "Content-Type: application/json" -v "http://192.168.1.7:9201/_license"
* About to connect() to 192.168.1.7 port 9201 (#0)
*   Trying 192.168.1.7...
* Connected to 192.168.1.7 (192.168.1.7) port 9201 (#0)
* Server auth using Basic with user 'elastic'
> GET /_license HTTP/1.1
> Authorization: Basic ZWxhc3RpYzplc2FkbWlu
> User-Agent: curl/7.29.0
> Host: 192.168.1.7:9201
> Accept: */*
> Content-Type: application/json
> 
< HTTP/1.1 200 OK
< content-type: application/json; charset=UTF-8
< content-length: 427
< 
{
  "license" : {
    "status" : "active",
    "uid" : "f3c207b4-8e53-4a62-ad16-f87de9934bc8",
    "type" : "trial",
    "issue_date" : "2024-06-29T09:58:14.179Z",
    "issue_date_in_millis" : 1719655094179,
    "expiry_date" : "2024-07-29T09:58:14.179Z",
    "expiry_date_in_millis" : 1722247094179,
    "max_nodes" : 1000,
    "issued_to" : "escluster1",
    "issuer" : "elasticsearch",
    "start_date_in_millis" : -1
  }
}
* Connection #0 to host 192.168.1.7 left intact

3.设置为基本的license:basic;

curl -XPOST -u elastic:esadmin http://192.168.1.7:9201/_xpack/license/start_basic?acknowledge=true -H "Content-Type:application/json"

[esadmin@oracle1 config]$ curl -XGET -u elastic:esadmin -H "Content-Type: application/json" -v "http://192.168.1.7:9201/_license"
* About to connect() to 192.168.1.7 port 9201 (#0)
*   Trying 192.168.1.7...
* Connected to 192.168.1.7 (192.168.1.7) port 9201 (#0)
* Server auth using Basic with user 'elastic'
> GET /_license HTTP/1.1
> Authorization: Basic ZWxhc3RpYzplc2FkbWlu
> User-Agent: curl/7.29.0
> Host: 192.168.1.7:9201
> Accept: */*
> Content-Type: application/json
> 
< HTTP/1.1 200 OK
< content-type: application/json; charset=UTF-8
< content-length: 334
< 
{
  "license" : {
    "status" : "active",
    "uid" : "9b1424e1-f89b-43dc-8ab8-6c902fbddf9c",
    "type" : "basic",
    "issue_date" : "2024-06-29T10:00:05.774Z",
    "issue_date_in_millis" : 1719655205774,
    "max_nodes" : 1000,
    "issued_to" : "escluster1",
    "issuer" : "elasticsearch",
    "start_date_in_millis" : -1
  }
}
* Connection #0 to host 192.168.1.7 left intact

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值