Updating a License Key with the REST API
The REST API has a /license
endpoint that allows you to temporarily update the license on a running member.
If a member shuts down, its license key will not be persisted. To persist the license key, you can add the license key to a configuration file. |
Before you Begin
To use the REST API, you must enable it on your members. See the REST Endpoint Groups section.
Update a License Key
To temporarily update the license of a running cluster, send a POST
request to the /license
endpoint.
curl --data "{cluster-name}&{password}&{license}" http://localhost:5001/hazelcast/rest/license
The request parameters must be URL-encoded as described in the REST Client section. |
The above command updates the license on all running Hazelcast members of the cluster. If successful, the response looks as follows:
{
"status": "success",
"licenseInfo": {
"expiryDate": 1560380399161,
"maxNodeCount": 10,
"type": -1,
"companyName": "ExampleCompany",
"ownerEmail": "info@example.com",
"keyHash": "ml/u6waTNQ+T4EWxnDRykJpwBmaV9uj+skZzv0SzDhs="
},
"message": "License updated at run time - please make sure to update the license in the persistent configuration to avoid losing the changes on restart."
}
If, for any reason, updating the license fails on some members (member does not respond, license is not compatible, etc.), the whole operation fails, leaving the cluster in a potentially inconsistent state (some members have been switched to the new license while some have not). It is up to you to resolve this situation manually.