21.4.17 ndb_perror —获取 NDB 错误消息信息

ndb_perror显示有关 NDB 错误的信息(给出错误代码)。这包括错误消息,错误类型以及错误是永久的还是临时的。已添加到 NDB 7.6.4 中的 MySQL NDB 群集发行版中,旨在代替perror --ndb

Usage

ndb_perror [options] error_code

ndb_perror不需要访问正在运行的 NDB 群集或任何节点(包括 SQL 节点)。要查看有关给定 NDB 错误的信息,请使用错误代码作为参数来调用程序,如下所示:

shell> ndb_perror 323
NDB error code 323: Invalid nodegroup id, nodegroup already existing: Permanent error: Application error

要仅显示错误消息,请使用--silent选项(简称-s)调用ndb_perror,如下所示:

shell> ndb_perror -s 323
Invalid nodegroup id, nodegroup already existing: Permanent error: Application error

perror一样,ndb_perror接受多个错误代码:

shell> ndb_perror 321 1001
NDB error code 321: Invalid nodegroup id: Permanent error: Application error
NDB error code 1001: Illegal connect string

ndb_perror的其他程序选项将在本节后面介绍。

ndb_perror替换了perror --ndb,后者从 NDB 7.6.4 开始不推荐使用,并且在以后的 MySQL NDB Cluster 版本中会被删除。为了使脚本和其他可能依赖perror来获取 NDB 错误信息的应用程序中的替换更容易,ndb_perror支持其自己的“虚拟” --ndb选项,该选项不执行任何操作。

下 table 包含特定于 NDB 群集程序ndb_perror的所有选项。附加说明如下 table 所示。

table21.253 ndb_perror 程序的命令行选项

FormatDescription添加,不建议使用或删除
--help ,

-?
显示帮助文本添加:NDB 7.6.4
--ndb用于与依赖于旧版本 perror 的应用程序兼容;什么都不做添加:NDB 7.6.4
--silent ,
-s
仅显示错误消息已添加:NDB 7.6.4
--version ,
-V
打印程序版本信息并退出添加:NDB 7.6.4
--verbose ,
-v
详细输出;使用--silentADDED 禁用:NDB 7.6.4

Additional Options

  • --help , -?

PropertyValue
Command-Line Format--help
Introduced5.7.19-ndb-7.6.4
TypeBoolean
Default ValueTRUE

显示程序帮助文本并退出。

  • --ndb

PropertyValue
Command-Line Format--ndb
Introduced5.7.19-ndb-7.6.4
TypeBoolean
Default ValueTRUE

为了与使用该程序的--ndb选项的依赖于perror的旧版本的应用程序兼容。与ndb_perror一起使用时,该选项无效,将被忽略。

  • --silent , -s

PropertyValue
Command-Line Format--silent
Introduced5.7.19-ndb-7.6.4
TypeBoolean
Default ValueTRUE

仅显示错误消息。

  • --version , -V

PropertyValue
Command-Line Format--version
Introduced5.7.19-ndb-7.6.4
TypeBoolean
Default ValueTRUE

打印程序版本信息并退出。

  • --verbose , -v

PropertyValue
Command-Line Format--verbose
Introduced5.7.19-ndb-7.6.4
TypeBoolean
Default ValueTRUE

详细输出;禁用--silent