Clarification on how licensing works

Question

  • Can a new license be added while the existing license is about to expire?

  • Can we add a new license when the application is still running on the old license?

Answer

Yes, HiveMQ allows you to replace licenses at runtime, this means you can add/delete licenses to the license folder and HiveMQ will update the used license accordingly. If you have multiple licenses in the license folder HiveMQ will pick the “best” license.

Question

How to add the new license to HiveMQ?

Answer

Put the license file in the /opt/hivemq/license directory.

Question

How to add the new license to HiveMQ in Kubernetes?

Answer

https://www.hivemq.com/docs/operator/4.8/kubernetes-operator/configuration.html#license

  1. Create a configMap that contains the license file:

    kubectl create configmap hivemq-license \ --from-file license1.lic -o yaml \ --dry-run | kubectl apply -f -

    If there is more than one license file:

    kubectl create configmap hivemq-license \ --from-file license1.lic -o yaml \ --from-file license2.lic -o yaml \ --dry-run | kubectl apply -f -
  2. Configure the mapping in the HiveMQ Cluster custom resource:

    apiVersion: hivemq.com/v1 kind: HiveMQCluster metadata: name: hivemq-cluster1 spec: configMaps: - name: hivemq-license path: /opt/hivemq/license

    Once the HiveMQ Cluster custom resource is updated with the new configMap, the HiveMQ Kubernetes Operator will roll out the update to HiveMQ pods.

Answer

How do I know which license is used by my HiveMQ at the moment?

Question

The information is logged in the hivemq.log. The information is logged shortly after the start. Once a new license file is detected and it is “better” than the current license, HiveMQ will pick up a new “better” license and log the information about the license to the hivemq.log:

INFO - Using valid Enterprise Edition CPU Evaluation license (hivemq-license. lic) issued to HiveMQ Support for max 9999 CPU cores, valid until 2023-05-03.

Answer

How long does it take for HiveMQ to notice the new license file and update the license?

Question

It takes milliseconds after the license is in the License Directory.

For HiveMQ Kubernetes Operator, it is seconds from the moment when you apply the new (updated) configMap to the moment when the files are mapped to the License Directory path in the HiveMQ pod.