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