License Manager¶
A License Manager (LM) is an essential service that runs on a server for you to manage your license and license the NebulaGraph enterprise edition database and its associated software. You can use an LM client that communicates with the LM service to load license keys and view license information, including the license validity period and purchased nodes. By configuring the LM service address in the NebulaGraph database and its associated software, the validity of the license can be verified to ensure the normal use of the NebulaGraph database and its associated software.
This article introduces how to deploy and use an LM service in a Linux environment and how to configure it within the Nebula Graph database and its associated software. For information on how to deploy the LM in a K8s cluster, see Deploy LM.
Preparations¶
To use an LM, you need to make sure the following:
-
You have obtained the desired LM installation package.
Note
LM installation packages are sent to you by email after you purchase a license.
- LM uses
9119
as the default port, make sure that port is not occupied.
Notes¶
- An LM is a single-process service. To ensure the reliability and continuity of the LM, it is recommended that you use systemd to manage the LM and set a restart policy for the LM.
- The time on the LM server must be synchronized with the services (including the NebulaGraph database and associated software) connected to the LM. If the times are not in sync, license verification will fail, which can prevent the service from being used.
Install and start LM¶
An LM can be installed on Linux amd64 or arm64 systems, or installed through Dashboard.
Using the TAR Package¶
-
Unpack the LM TAR package.
tar -zxvf <name.tar.gz> -C <path>
<name.tar.gz>
: The name of the LM TAR package.<path>
: The installation path for the unpacked LM. If the-C
parameter is not specified, it defaults to the current directory.
-
Start the LM service using systemd.
-
Create the LM service file
/etc/systemd/system/nebula-license-manager.service
with the following contents:[Unit] Description=License Manager [Service] Type=simple ExecStart=<path>/nebula-license-manager/nebula-license-manager WorkingDirectory=<path>/nebula-license-manager Restart=always [Install] WantedBy=multi-user.target
<path>
: Refers to the directory where the LM package is extracted.
-
Start the LM service:
sudo systemctl start nebula-license-manager
-
-
Set up LM to start automatically on boot.
sudo systemctl enable nebula-license-manager
Using the RPM package¶
-
Unpack the LM RPM package.
sudo rpm -ivh <name.rpm>
<name.rpm>
: The name of the LM RPM package.- The default installation path is
/usr/local/nebula-license-manager
, which cannot be changed.
-
Start LM.
sudo systemctl start nebula-license-manager
-
Set up LM to start automatically on boot.
sudo systemctl enable nebula-license-manager
Using the DEB package¶
-
Unpack the LM DEB package.
sudo dpkg -i <name.deb>
<name.deb>
: The name of the LM DEB package.- The default installation path is
/usr/local/nebula-license-manager
, which cannot be changed.
-
Start LM.
sudo systemctl start nebula-license-manager
-
Set up LM to start automatically on boot.
sudo systemctl enable nebula-license-manager
Using Dashboard¶
LM can be installed and started through Dashboard. For more information, see Connect to Dashboard.
View LM configuration file¶
The configuration file name for LM is nebula-license-manager.yaml
.
- For RPM and DEB packages, the default path is
/usr/local/nebula-license-manager/etc/nebula-license-manager.yaml
.
- For the TAR package, the path is
nebula-license-manager/etc/nebula-license-manager.yaml
under the LM installation directory.
The contents of the LM configuration file are as follows:
Name: nebula-license-manager
Host: 0.0.0.0 # The host address LM binds to.
Port: 9119 # The port number LM listens on. The default is 9119.
Timeout: 3000 # The timeout period for LM waiting for client requests, in milliseconds. The default is 3000 milliseconds.
DataPath: data # The path for storing LM status data.
Notify: # LM notification related configuration.
Mail: # Mail notification related configuration.
Host: "" # SMTP server address.
Port: 465 # SMTP server port number.
User: "" # SMTP email.
Password: "" # SMTP email password.
To: [] # The list of emails to receive notifications.
Log: # Logging related configuration.
Mode: file # The logging mode. It can be file (output to file) or console (output to console). The default is file.
Path: logs # The path for storing log files.
Level: info # The log level. It can be debug, info, error, or severe. The default is info.
KeepDays: 30 # The longest number of days to keep logs. The default is 30 days.
Use LM¶
After your LM starts, in the LM installation path you can use the LM CLI to view license information.
View LM CLI version¶
./nebula-license-manager-cli version
Note
When LM starts, its version information is printed in the logs.
Load a license key¶
After generating a license key, you need to use the LM client tool to load the license key.
./nebula-license-manager-cli load --key <license-key> --force
<license-key>
: The license key string, such asMSY2-LGQ6O-69521-XXXXX-XXXXX
.--force
: Loads the license key without checking the current license status. This flag is optional.
View license information¶
./nebula-license-manager-cli info
-
When the license key is not loaded, the output is as follows:
LMID: RUZB-XXXX LicenseStatus: NotExist
-
When the license key is loaded, the output is as follows:
LMID: RUZB-XXXX LicenseStatus: Normal LicenseKey: MM90U-9H4Q0-W093M-XXXXX-XXXXX Type: NODE Query Node: 3 Storage Node: 3 ExpireAt: 2023-06-25 12:00:00 +0800 CST
The information items of the license in the output are described as follows:
Items | Description |
---|---|
LMID |
The ID of your LM. When you obtain a license key, this LMID needs to be bound. For more information, see Generate a license key. |
LicenseStatus |
The status of the license. It includes:Normal : The license can be used normally.NotExist : The license key does not exist.Invalid : The license key is invalid.Syncing : Synchronizing the license information from LC.Expiring : The license is about to expire.Expired : The license has expired. |
LicenseKey |
An encrypted string containing authorization information, which is the only credential for you to obtain the authorization of the NebulaGraph database and its associated software. For details, see License key. |
Type |
The type of resources purchased. Currently, only node-based resources can be purchased. |
Query Node |
The number of query nodes purchased |
Storage Node |
The number of storage nodes purchased |
ExpireAt |
The expiration time of the license. |
Synchronize license info¶
When the license key loaded into LM is in online mode, the LM periodically synchronizes the license information from LC every one to two hours. You can also manually synchronize the license key using the following command.
./nebula-license-manager-cli sync
Check the license quota usage¶
You can run the following command to check the current usage of the license quota (the number of nodes purchased) and the usage status of the associated software.
./nebula-license-manager-cli usage
View the license information on a specified LM¶
For a database administrator (DBA), there may be a need to view the license information on a specified LM. To achieve this, run the following command:
./nebula-license-manager-cli <command> --addr <host>:9119
<command>
: The command to be executed. Options includeinfo
,usage
,sync
, andload --key <license-key> --force
.<host>
: The IP address of the host where the specified LM is located.
Monitor LM¶
Monitor LM status¶
You can use monitoring tools to monitor the status of the LM service.
-
Use Dashboard Enterprise
When LM is running normally, the License Manager page displays the status of LM as Running, otherwise, it displays Exited. For more information, see License Manager.
-
Use Prometheus
You need to configure the Prometheus server before monitoring LM.
Add the following configuration to the Prometheus configuration file. For more information about the Prometheus configuration file, see Prometheus Configuration.
... - job_name: license-manager scrape_interval: 15s # The interval for pulling data. metrics_path: /metrics # The monitoring metrics path of LM, which is `/metrics`. scheme: http # The protocol type of LM, which is HTTP. static_configs: # The address and port of LM (default 9119). - targets: - [<ip:lm_port>] ...
After the configuration is complete, you can monitor the status of LM through its built-in metric
up
. If the value is1
, it means that LM is running normally; if the value is0
, it means that LM is not running. To view the metric, enterup
in the Prometheus query box as shown below:up{instance="<ip:lm_port>", job="job_name"}
<ip:lm_port>
: The IP address and port of LM.job_name
: The name of the job.
For example, up{instance="192.168.8.xxx:9119", job="license-manager"}.
Note
By default, LM uses port
9119
. If you need to change the port number, you can modify the value of thePort
field in the LM configuration file above, or modify the value ofport
in the YAML file of Deploying LM in K8s.
View LM metrics¶
You can view the built-in metrics of LM through the following URL:
http://<ip:lm_port>/metrics
<ip:lm_port>
: The IP address and port of LM.
You can also collect LM metrics data through monitoring tools. To use Prometheus, you need to configure the Prometheus server before collecting LM metrics. For more information, see the above section Monitor LM status.
Configure connection to LM¶
Configure LM in NebulaGraph¶
In the NebulaGraph database Meta service configuration file (nebula-metad.conf
), set the license_manager_url
value to reflect the IP address of the LM host and port number 9119
in the format like 192.168.8.xxx:9119
. For more information, see Meta service configuration.
After the configuration is complete, restart the Meta service.
Configure LM in Explorer¶
In the Explorer installation directory, enter the config
folder and modify the app-config.yaml
file. Set the value of LicenseManagerURL
to reflect the IP address of the LM host and port number 9119
in the format like 192.168.8.xxx:9119
.
After the configuration is complete, restart Explorer. For more information, see Deploy Explorer.
Configure LM in Dashboard¶
In the Dashboard installation directory, enter the etc
folder and modify the config.yaml
file. Set the value of LicenseManagerURL
to reflect the IP address of the LM host and port number 9119
in the format like 192.168.8.xxx:9119
.
After the configuration is complete, restart Dashboard. For more information, see Deploy Dashboard.
Configure LM in Analytics¶
In the Analytics installation directory, enter the scripts
folder and modify the analytics.conf
file. Set the value of license_manager_url
to the IP address of the LM host and the port number 9119
, for example, 192.168.8.xxx:9119
.
After the configuration is complete, run ./run_pagerank.sh
in the scripts
folder to start the Analytics service. For more information, see NebulaGraph Analytics.
Configure LM in NebulaGraph Operator¶
When deploying the cluster using NebulaGraph Operator, configure the address and port of the LM through the spec.metad.licenseManagerURL
field in the cluster configuration file. For more details, see Install a NebulaGraph cluster.
FAQ¶
Q: Can I change the host on which my LM is located?
A: No. The LM is bound to the host where it is installed. If you need to change the host, or the host is unable to be used, you need to contact Vesoft sales to rebind the LMID.