Supplying the H2O-3 Secure license
H2O-3 Secure checks for a valid license when a cluster starts and when a MOJO or POJO model loads. Use this page to supply the license and confirm that H2O-3 Secure accepted it.
Prerequisites
- A license file,
license.sig. The license key is the text inside that file. Contact your H2O.ai account team or enterprise@h2o.ai for a license.
Where H2O-3 Secure looks for the license
H2O-3 Secure checks these sources in order:
| Order | Source | Value |
|---|---|---|
| 1 | H2O_LICENSE_KEY environment variable | The license key |
| 2 | -license_file startup option | Path to license.sig |
| 3 | H2O_LICENSE_FILE environment variable | Path to license.sig |
| 4 | /license/license.sig | Default location for containers |
| 5 | .h2oai/license.sig in your home directory | Default location |
H2O-3 Secure reads only the first source it finds. If that license is invalid, H2O-3 Secure doesn't start, even when a later source holds a valid license.
Set an environment variable
To point H2O-3 Secure at the license file:
export H2O_LICENSE_FILE=/etc/h2o/license.sig
java -jar h2o.jar
To pass the license key itself, for example from a secrets manager:
export H2O_LICENSE_KEY="$(cat /etc/h2o/license.sig)"
java -jar h2o.jar
Pass the license file at startup
java -jar h2o.jar -license_file /etc/h2o/license.sig
h2o.init() in Python has no option for -license_file. From Python, use an environment variable or a default location.
Use a default location
To install the license for your user account:
mkdir -p ~/.h2oai
cp license.sig ~/.h2oai/license.sig
In a container, mount the license file at /license/license.sig. When both default files exist, H2O-3 Secure reads only /license/license.sig.
Start H2O-3 Secure from Python
h2o.init() starts the jar bundled in the Python package and passes your environment to it. Set the environment variable before you call h2o.init():
import os
os.environ["H2O_LICENSE_FILE"] = "/etc/h2o/license.sig"
import h2o
h2o.init()
A license in a default location needs no code.
Supply the license for model scoring
The h2o-genmodel.jar file checks the license when a MOJO or POJO model loads. A MOJO or POJO download includes this jar when you request h2o-genmodel.jar with the model.
The scoring process reads H2O_LICENSE_KEY, then H2O_LICENSE_FILE, then the two default locations. Set one of these on every host that scores models. The -license_file option doesn't apply to scoring.
If the scoring process can't find a valid license, loading the model throws hex.genmodel.license.LicenseException with the reason.
Verify the license
After a successful start, the H2O-3 Secure log shows the license details:
License validated successfully
Organization: <licensee organization>
Serial: <serial number>
Type: <license type>
Expires: <yyyy/MM/dd>
In the last 30 days before the license expires, the log also shows this warning:
License expires in <days> days! Please renew your license.
Errors and limits
When the license check fails, H2O-3 Secure prints H2O LICENSE ERROR and the reason to standard error, then exits with code 1. From Python, h2o.init() raises H2OServerError with the same text.
| Reason in the error | Fix |
|---|---|
No valid H2O license found. | Supply the license from a source in Where H2O-3 Secure looks for the license. |
License file not found: <path> | Correct the path in -license_file or H2O_LICENSE_FILE. |
License has expired on <date> | Install a renewed license. |
License signature verification failed or Invalid license key encoding | Copy the license again from the original file, unchanged. |
License was issued for '<product>', not for H2O-3 | Request a license that covers H2O-3 Secure. |
License can no longer be used | Request a replacement license. |
A license stays valid through the date in its Expires field. A running cluster checks its license again every 12 hours and shuts down when the license is no longer valid.
To renew a running cluster, replace the license file before the current license expires. The cluster reads the renewed file at its next check. A cluster started with H2O_LICENSE_KEY keeps the old key. When that key is no longer valid, the cluster reads the file sources instead. Place the renewed file in one of them, or restart the cluster with the new key.
Related pages
- Submit and view feedback for this page
- Send feedback about H2O-3 Secure to cloud-feedback@h2o.ai