跳转到主要内容

server:实例摘要、参数与授权检查

查看完整版本与兼容模式、非默认及待重启(pending_restart)参数、授权剩余天数及绑定 MAC/连接上限。

聚合实例摘要(server)、非默认与 pending_restart 参数(server params)以及授权有效期与绑定信息(server license)。只读检查:不修改参数、不执行 reload 或重启。

用法

kbdiag server
kbdiag server params
kbdiag server license
kbdiag server --json

子命令与参数

命令 / 参数说明
server展示完整身份版本、连接余量、授权摘要及非默认参数预览
server params列出所有非默认与待重启参数及其配置文件路径与行号
server license展示授权剩余天数、license.dat 路径、绑定 MAC 与授权连接数
--json输出结构化 JSON(inst.identity、inst.info、params.changed、license.info)

判定与输出解读

  • FAIL(exit=2):license.expired(运行中实例可暂存,下次重启失败;主备需分别核对本机授权),或 server 本身命中普通用户连接耗尽(inst.connections)。
  • WARN(exit=1):license.expiring(30 天内到期)或 params.pending_restart(参数修改待重启生效,报告提供可供人工确认的回退语句)。
  • UNKNOWN(exit=3):探针失败或权限不足(即使可见配置行数为零,缺少超管或 sys_read_all_settings 权限仍标 UNKNOWN)。
  • 隐私提示:license.dat 路径与绑定 mac 默认原样输出(不遮蔽),外发报告前请按需脱敏。

实测示例(KES V9 主库节选,80 列)

inst.summary  OK  (KingbaseES V009R002C016, primary, system@local,
    endpoint=/tmp/.s.KINGBASE.54321, 2026-12-03T09:40:35Z)
[INST.IDENTITY]
  ok, 1 rows
  full_version=KingbaseES V009R002C016 | server_version_num=120001 |
    database_mode=oracle | role=primary
[INST.INFO]
  ok, 1 rows
  version=V009R002C016 | connections=2 | max_connections=100 |
    usable_connections=97
...
params  OK  (KingbaseES V009R002C016, primary, system@local,
    endpoint=/tmp/.s.KINGBASE.54321, 2026-12-03T04:05:00Z)
[PENDING RESTART]
  0
[CHANGED]
  45 parameters not at their default (sources other than default, override and
    this connection)
  ...
  archive_command = exit 0
    source=configuration file  file=kingbase.conf:236
  archive_mode = always
    source=configuration file  file=kingbase.conf:234
[LICENSE]
  left             171 days
  file             /data/kingbase/app/KESRealPro/V009R002C016/Server/bin/../../l
    icense.dat
  product          KingbaseES
  version          V009
  validity         180
  mac              00:00:00:00:00:00
  max connections  0
  KES checks the license only when the instance starts
  note: file path and MAC shown verbatim (not redacted); scrub before sharing

关联命令

  • kbdiag check — 一次性巡检连接数与授权等九个核心域
  • kbdiag session — 对照 max_connections 查看当前会话明细
  • kbdiag status — 检查实例运行时长、主备角色与磁盘状态