Update license API

Updates the license for your Elasticsearch cluster.

Request

PUT _license

POST _license

Prerequisites

If Elasticsearch security features are enabled, you need manage cluster privileges to install the license.

If Elasticsearch security features are enabled and you are installing a gold or higher license, you must enable TLS on the transport networking layer before you install the license. See Encrypting communications in Elasticsearch.

Description

You can update your license at runtime without shutting down your nodes. License updates take effect immediately. If the license you are installing does not support all of the features that were available with your previous license, however, you are notified in the response. You must then re-submit the API request with the acknowledge parameter set to true.

For more information about the different types of licenses, see https://www.elastic.co/subscriptions.

Query parameters

acknowledge

(Optional, boolean) Specifies whether you acknowledge the license changes. The default value is false.

Request body

licenses

(Required, array) A sequence of one or more JSON documents containing the license information.

Examples

The following example updates to a basic license:

  1. PUT _license
  2. {
  3. "licenses": [
  4. {
  5. "uid":"893361dc-9749-4997-93cb-802e3d7fa4xx",
  6. "type":"basic",
  7. "issue_date_in_millis":1411948800000,
  8. "expiry_date_in_millis":1914278399999,
  9. "max_nodes":1,
  10. "issued_to":"issuedTo",
  11. "issuer":"issuer",
  12. "signature":"xx"
  13. }
  14. ]
  15. }

These values are invalid; you must substitute the appropriate content from your license file.

You can also install your license file using a curl command. Be sure to add @ before the license file path to instruct curl to treat it as an input file.

  1. curl -XPUT -u <user> 'http://<host>:<port>/_license' -H "Content-Type: application/json" -d @license.json

On Windows, use the following command:

  1. Invoke-WebRequest -uri http://<host>:<port>/_license -Credential elastic -Method Put -ContentType "application/json" -InFile .\license.json

In these examples,

  • <user> is a user ID with the appropriate authority.
  • <host> is the hostname of any node in the Elasticsearch cluster (localhost if executing locally)
  • <port> is the http port (defaults to 9200)
  • license.json is the license JSON file

If your Elasticsearch node has SSL enabled on the HTTP interface, you must start your URL with https://

If you previously had a license with more features than the basic license, you receive the following response:

  1. {
  2. "acknowledged": false,
  3. "license_status": "valid",
  4. "acknowledge": {
  5. "message": """This license update requires acknowledgement. To acknowledge the license, please read the following messages and update the license again, this time with the "acknowledge=true" parameter:""",
  6. "watcher": [
  7. "Watcher will be disabled"
  8. ],
  9. "logstash": [
  10. "Logstash will no longer poll for centrally-managed pipelines"
  11. ],
  12. "security": [
  13. "The following X-Pack security functionality will be disabled: ..." ]
  14. }
  15. }

To complete the update, you must re-submit the API request and set the acknowledge parameter to true. For example:

  1. PUT _license?acknowledge=true
  2. {
  3. "licenses": [
  4. {
  5. "uid":"893361dc-9749-4997-93cb-802e3d7fa4xx",
  6. "type":"basic",
  7. "issue_date_in_millis":1411948800000,
  8. "expiry_date_in_millis":1914278399999,
  9. "max_nodes":1,
  10. "issued_to":"issuedTo",
  11. "issuer":"issuer",
  12. "signature":"xx"
  13. }
  14. ]
  15. }

Alternatively:

  1. curl -XPUT -u elastic 'http://<host>:<port>/_license?acknowledge=true' -H "Content-Type: application/json" -d @license.json

For more information about the features that are disabled when your license expires, see License expiration.