21.4.32 NDB 群集程序共有的选项-NDB 群集程序共有的选项

所有 NDB 群集程序均接受本节中描述的选项,但以下情况除外:

Note

早期版本的 NDB Cluster 的用户应注意,其中一些选项已更改,以使它们彼此一致,也与mysqld一致。可以将--help选项与任何 NDB Cluster 程序一起使用(ndb_print_backup_filendb_print_schema_filendb_print_sys_file除外)以查看该程序支持的选项列 table。

下 table 中的选项对所有 NDB Cluster 可执行文件都是通用的(本节前面提到的除外)。

table21.265 所有 MySQL NDB Cluster 程序共有的命令行选项

FormatDescription添加,不建议使用或删除
--character-sets-dir=dir_name字符集的安装目录(在所有基于 MySQL 5.7 的版本中受支持)
--connect-retries=#设置放弃前重试连接的次数(在所有基于 MySQL 5.7 的版本中受支持)
--connect-retry-delay=#两次尝试联系 Management 服务器之间 await 的时间,以秒为单位(在所有基于 MySQL 5.7 的版本中受支持)
--core-file将内核写入错误(在调试版本中默认为 TRUE)(在所有基于 MySQL 5.7 的版本中受支持)
--debug=options启用调试调用的输出。只能用于启用了调试的编译版本(在所有基于 MySQL 5.7 的版本中受支持)
--defaults-extra-file=filename读取全局选项文件后读取此文件(在所有基于 MySQL 5.7 的版本中受支持)
--defaults-file=filename从该文件中读取默认选项(在所有基于 MySQL 5.7 的版本中受支持)
--defaults-group-suffix还要阅读名称以该后缀结尾的组(在所有基于 MySQL 5.7 的版本中受支持)
--help ,

--usage ,
-?
显示帮助消息并退出((所有基于 MySQL 5.7 的版本均支持)
--login-path=path从登录文件读取此路径(所有基于 MySQL 5.7 的发行版均支持)
--ndb-connectstring=connectstring ,
--connect-string=connectstring ,
-c
设置用于连接到 ndb_mgmd 的连接字符串。语法:[nodeid = <id>;] [host =] [:<port>]。覆盖 NDB_CONNECTSTRING 或 my.cnf中指定的条目(在所有基于 MySQL 5.7 的发行版中受支持)
--ndb-mgmd-host=host[:port]设置用于连接到 Management 服务器的主机(和端口,如果需要)(在所有基于 MySQL 5.7 的发行版中受支持)
--ndb-nodeid=#为此节点设置节点 ID(在所有基于 MySQL 5.7 的发行版中受支持)
--ndb-optimized-node-selection以更优化的方式选择事务节点(所有基于 MySQL 5.7 的版本均支持)
--no-defaults请勿从登录文件以外的任何选项文件中读取默认选项(在所有基于 MySQL 5.7 的发行版中受支持)
--print-defaults打印程序参数列 table 并退出(所有基于 MySQL 5.7 的版本均支持)
--version ,
-V
输出版本信息并退出(在所有基于 MySQL 5.7 的发行版中受支持)

有关特定于各个 NDB 群集程序的选项,请参见第 21.4 节“ NDB 群集程序”

有关 NDB 群集的mysqld选项,请参阅第 21.3.3.9.1 节“ NDB 群集的 MySQL 服务器选项”

  • --character-sets-dir=name

PropertyValue
Command-Line Format--character-sets-dir=dir_name
TypeDirectory name
Default Value``

告诉程序在哪里可以找到字符集信息。

NDB 7.6.7 和更高版本中的ndb_import支持此选项。

  • --connect-retries=#

PropertyValue
Command-Line Format--connect-retries=#
TypeNumeric
Default Value12
Minimum Value0
Maximum Value4294967295

此选项指定在放弃前第一次尝试重试连接之后的次数(Client 端始终至少尝试一次连接)。每次尝试 await 的时间长度是使用--connect-retry-delay设置的。

Note

ndb_mgm一起使用时,此选项的默认值为 3.有关更多信息,请参见第 21.4.5 节“ ndb_mgm — NDB 群集 ManagementClient 端”

  • --connect-retry-delay=#

PropertyValue
Command-Line Format--connect-retry-delay=#
TypeNumeric
Default Value5
最小值(≥5.7.10-ndb-7.5.0)1
Minimum Value0
Maximum Value4294967295

该选项指定放弃连接前每次尝试 await 的时间。尝试连接的次数由--connect-retries设置。

  • --core-file

PropertyValue
Command-Line Format--core-file
TypeBoolean
Default ValueFALSE

如果程序死了,请写一个核心文件。核心文件的名称和位置取决于系统。 (对于在 Linux 上运行的 NDB Cluster 程序节点,默认位置是程序的工作目录-对于数据节点,这是该节点的DataDir。)对于某些系统,可能会有限制或限制。例如,可能有必要在启动服务器之前执行 ulimit -c unlimited 。有关详细信息,请查阅系统文档。

如果 NDB 群集是使用--debug选项进行 configure 构建的,则默认启用--core-file。对于常规构建,默认情况下禁用--core-file

  • --debug[=options]

PropertyValue
Command-Line Format--debug=options
TypeString
Default Valued:t:O,/tmp/ndb_restore.trace

此选项只能用于启用了调试的编译版本。它用于启用调试调用的输出,方式与mysqld进程相同。

  • --defaults-extra-file = filename

PropertyValue
Command-Line Format--defaults-extra-file=filename
TypeString
Default Value[none]

读取全局选项文件后,请读取此文件。

有关此选项和其他选项文件选项的更多信息,请参见第 4.2.2.3 节“影响选项文件处理的命令行选项”

  • --defaults-file = filename

PropertyValue
Command-Line Format--defaults-file=filename
TypeString
Default Value[none]

从该文件中读取默认选项。

有关此选项和其他选项文件选项的更多信息,请参见第 4.2.2.3 节“影响选项文件处理的命令行选项”

  • --defaults-group-suffix

PropertyValue
Command-Line Format--defaults-group-suffix
TypeString
Default Value[none]

还要阅读名称以该后缀结尾的组。

有关此选项和其他选项文件选项的更多信息,请参见第 4.2.2.3 节“影响选项文件处理的命令行选项”

  • --help , --usage , -?

PropertyValue
Command-Line Format--help

--usage

打印简短列 table,其中包含可用命令选项的描述。

  • --login-path = path

PropertyValue
Command-Line Format--login-path=path
TypeString
Default Value[none]

从登录文件中读取此路径。

有关此选项和其他选项文件选项的更多信息,请参见第 4.2.2.3 节“影响选项文件处理的命令行选项”

  • --ndb-connectstring=connection_string , --connect-string=connection_string , -c connection_string

PropertyValue
Command-Line Format--ndb-connectstring=connectstring

--connect-string=connectstring
TypeString
默认值localhost:1186

此选项采用 NDB 群集连接字符串,该字符串指定应用程序要连接到的 Management 服务器,如下所示:

shell> ndbd --ndb-connectstring="nodeid=2;host=ndb_mgmd.mysql.com:1186"

有关更多信息,请参见第 21.3.3.3 节“ NDB 群集连接字符串”

  • --ndb-mgmd-host=host[:port]

PropertyValue
Command-Line Format--ndb-mgmd-host=host[:port]
TypeString
Default Valuelocalhost:1186

可用于设置程序要连接到的单个 Management 服务器的主机和端口号。如果该程序在其连接信息中需要节点 ID 或对多个 Management 服务器的引用(或两者都引用),请改用--ndb-connectstring选项。

  • --ndb-nodeid=#

PropertyValue
Command-Line Format--ndb-nodeid=#
TypeNumeric
Default Value0

设置此节点的 NDB 群集节点 ID。 允许值的范围取决于节点的类型(数据,Management 或 API)和 NDB Cluster 软件版本。有关更多信息,请参见第 21.1.7.2 节“ NDB 群集与标准 MySQL 限制的限制和差异”

  • --no-defaults

PropertyValue
Command-Line Format--no-defaults
TypeBoolean
Default ValueTRUE

不要从登录文件以外的任何选项文件中读取默认选项。

有关此选项和其他选项文件选项的更多信息,请参见第 4.2.2.3 节“影响选项文件处理的命令行选项”

  • --ndb-optimized-node-selection

PropertyValue
Command-Line Format--ndb-optimized-node-selection
TypeBoolean
Default ValueTRUE

优化 Transaction 节点的选择。默认启用。

  • --print-defaults

PropertyValue
Command-Line Format--print-defaults
TypeBoolean
Default ValueTRUE

打印程序参数列 table 并退出。

有关此选项和其他选项文件选项的更多信息,请参见第 4.2.2.3 节“影响选项文件处理的命令行选项”

  • --version , -V

PropertyValue
Command-Line Format--version

打印可执行文件的 NDB 群集版本号。版本号很重要,因为不是所有版本都可以一起使用,并且 NDB 群集启动过程会验证所使用的二进制文件的版本可以共存于同一群集中。在执行 NDB 群集的联机(滚动)软件升级或降级时,这一点也很重要。

有关更多信息,请参见第 21.5.5 节“执行 NDB 群集的滚动重启”)。