What Happens When a KingbaseES License Expires? A Practical Guide
This article explains the structure of KingbaseES license files, distinguishes commercial and non‑commercial license types, describes the actual behavior of the database when a license expires, and provides step‑by‑step workarounds such as OS date tweaking, license inspection, file replacement, and server reload commands.
Background
Open‑source databases do not use license files; commercial products such as KingbaseES rely on a license file that records the effective date, product version, maximum connections, MAC address, IP, and other constraints. If the information in the file does not match the host environment, the database cannot start.
License Types
KingbaseES defines two main categories: commercial and non‑commercial. Commercial licenses are purchased and may be permanent or time‑limited, while non‑commercial licenses are temporary for testing or trial purposes and have strict expiration limits.
KingbaseES further splits licenses into four sub‑categories, as shown in the diagram below.
What Happens When a License Expires?
Contrary to rumors that a Chinese database shuts down immediately after the license expires, the observed behavior varies. In two major domestic databases, one only logs a warning and continues to operate after a restart, while the other blocks the restart.
In a personal 90‑day test license for KingbaseES, the server could still be started, but stopping and then restarting the instance failed, producing a “License file expired” error.
WARNING:License file expired. Please replace the license file in timesys_ctl stop -D $KINGBASE_DATA
waiting for server to shut down.... done
server stopped
sys_ctl start -D $KINGBASE_DATA
waiting for server to start....FATAL: XX000: License file expired.
LOCATION: KesMasterMain, master.c:851
sys_ctl: could not start server
Examine the log output.Workarounds
Two extreme solutions are reinstalling the database or restoring from a snapshot, both of which discard existing data. A less destructive approach is to request a new license from the vendor, or for personal testing, temporarily modify the operating system date (not recommended for production because it can corrupt time‑type fields).
Changing the system date to a past or future value allowed the expired test instance to start.
Inspecting the License File
The license file is a plain‑text Chinese file. Examining it reveals a 90‑day validity period counted from the installation date.
[kingbase@jiekexu install]$ more license.dat
-------------------END KINGASE.LICENSE.3.0 PRIVATE KEY---------------------
License序列号 --- 启用 --- 197C9F62-3209-11EF-AACD-000C29CBE49F
生产日期 --- 启用 --- 2024-06-24
产品名称 --- 启用 --- KingbaseES V8
细分版本模板名 --- 启用 --- SALES-企业版 V9R1
产品版本号 --- 启用 --- V009R001C
浮动基准日期 ------ 启用
有效期间 --- 启用 --- 90
用户名称 --- 启用 --- 官方网站试用授权
项目名称 --- 启用 --- 官方网站试用授权Replacing the License File
Steps to replace an expired license:
Obtain a new license file matching the exact version from the vendor.
Search the host for all license.dat files, e.g., find / -name license.dat.
Replace each found file, preserving the original ownership and permissions, e.g., chown -R kingbase:kingbase license.dat.
Typical locations include:
Installation root directory. Server/bin under the installation. Cluster/bin under the installation. ManagerTools/tools/bin under the installation.
Restart the server ( sys_ctl restart -D $KINGBASE_DATA) or reload the configuration dynamically ( select sys_reload_conf(); or select pg_reload_conf();).
Checking Remaining Valid Days
After a successful replacement, the remaining validity can be queried:
select get_license_validdays();
-- returns 365Notes
The command reload_license exists in some KingbaseES versions but is absent in version V009R001C001B0030 used by the author.
For production environments, a dynamic reload without restarting the database is preferred to avoid downtime.
ITPUB
Official ITPUB account sharing technical insights, community news, and exciting events.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
