ndbxfrm 工具可用于解压、解密以及输出由 NDB Cluster 创建的、已压缩、已加密或同时具备两者特性的文件的信息。它也可以用于压缩或加密文件。The ndbxfrm utility can be used to decompress, decrypt, and output information about files created by NDB Cluster that are compressed, encrypted, or both. It can also be used to compress or encrypt files.
用法Usage
ndbxfrm --infofile[file...] ndbxfrm --compressinput_fileoutput_filendbxfrm --decrypt-password=passwordinput_fileoutput_filendbxfrm [--encrypt-ldf-iter-count=#] --encrypt-password=passwordinput_fileoutput_file
input_file 和 output_file 不能是同一个文件。input_file and
output_file cannot be the same file.
选项Options
--compress,-c命令行格式Command-Line Format --compress使用与压缩 NDB 集群备份相同的方法压缩输入文件,并将输出写入输出文件。要解压未加密的压缩
NDB备份文件,只需调用 ndbxfrm 并使用压缩文件名和输出文件名(无需任何选项)。Compresses the input file, using the same compression method as is used for compressing NDB Cluster backups, and writes the output to an output file. To decompress a compressedNDBbackup file that is not encrypted, it is necessary only to invoke ndbxfrm using the names of the compressed file and an output file (with no options required).--decrypt-key=,key-Kkey命令行格式Command-Line Format --decrypt-key=key使用提供的密钥解密由
NDB加密的文件。Decrypts a file encrypted byNDBusing the supplied key.Note此选项不能与
--decrypt-password一起使用。This option cannot be used together with--decrypt-password.命令行格式Command-Line Format --decrypt-key-from-stdin使用从
stdin提供的密钥解密由NDB加密的文件。Decrypts a file encrypted byNDBusing the key supplied fromstdin.命令行格式Command-Line Format --decrypt-password=password类型Type 字符串String 默认值Default Value [none][none]使用提供的密码解密由
NDB加密的文件。Decrypts a file encrypted byNDBusing the password supplied.Note此选项不能与
--decrypt-key一起使用。This option cannot be used together with--decrypt-key.--decrypt-password-from-stdin[=TRUE|FALSE]命令行格式Command-Line Format --decrypt-password-from-stdin使用从标准输入提供的密码解密由
NDB加密的文件。这类似于在调用 mysql 后输入密码,使用--password但选项后未跟密码。Decrypts a file encrypted byNDB, using a password supplied from standard input. This is similar to entering a password after invoking mysql--passwordwith no password following the option.命令行格式Command-Line Format --defaults-extra-file=path--defaults-extra-file=path类型Type 字符串String 默认值Default Value [none][none]在读取全局文件之后读取给定文件。Read given file after global files are read.
命令行格式Command-Line Format --defaults-file=path类型Type 字符串String 默认值Default Value [none][none]仅从指定文件读取默认选项。Read default options from given file only.
命令行格式Command-Line Format --defaults-group-suffix=string类型Type 字符串String 默认值Default Value [none][none]还可以读取
CONCAT(group, suffix)组合的组。Also read groups withCONCAT(.group,suffix)命令行格式Command-Line Format --encrypt-block-size=#类型Type 布尔Boolean 默认值Default Value FALSE打印文件信息,如
--info,但包括文件的头部和尾部。Print out file information like--info, but include the file's header and trailer.示例:Example:
$>
ndbxfrm --detailed-info S0.sysfileFile=/var/lib/cluster-data/ndb_7_fs/D1/NDBCNTR/S0.sysfile, compression=no, encryption=yes header: { fixed_header: { magic: { magic: { 78, 68, 66, 88, 70, 82, 77, 49 }, endian: 18364758544493064720, header_size: 32768, fixed_header_size: 160, zeros: { 0, 0 } }, flags: 73728, flag_extended: 0, flag_zeros: 0, flag_file_checksum: 0, flag_data_checksum: 0, flag_compress: 0, flag_compress_method: 0, flag_compress_padding: 0, flag_encrypt: 18, flag_encrypt_cipher: 2, flag_encrypt_krm: 1, flag_encrypt_padding: 0, flag_encrypt_key_selection_mode: 0, dbg_writer_ndb_version: 524320, octets_size: 32, file_block_size: 32768, trailer_max_size: 80, file_checksum: { 0, 0, 0, 0 }, data_checksum: { 0, 0, 0, 0 }, zeros01: { 0 }, compress_dbg_writer_header_version: { ... }, compress_dbg_writer_library_version: { ... }, encrypt_dbg_writer_header_version: { ... }, encrypt_dbg_writer_library_version: { ... }, encrypt_key_definition_iterator_count: 100000, encrypt_krm_keying_material_size: 32, encrypt_krm_keying_material_count: 1, encrypt_key_data_unit_size: 32768, encrypt_krm_keying_material_position_in_octets: 0, }, octets: { 102, 68, 56, 125, 78, 217, 110, 94, 145, 121, 203, 234, 26, 164, 137, 180, 100, 224, 7, 88, 173, 123, 209, 110, 185, 227, 85, 174, 109, 123, 96, 156, } } trailer: { fixed_trailer: { flags: 48, flag_extended: 0, flag_zeros: 0, flag_file_checksum: 0, flag_data_checksum: 3, data_size: 512, file_checksum: { 0, 0, 0, 0 }, data_checksum: { 226, 223, 102, 207 }, magic: { zeros: { 0, 0 } fixed_trailer_size: 56, trailer_size: 32256, endian: 18364758544493064720, magic: { 78, 68, 66, 88, 70, 82, 77, 49 }, }, } }命令行格式Command-Line Format --encrypt-block-size=#类型Type 整数Integer 默认值Default Value 0最小值Minimum Value 0最大值Maximum Value 2147483647作为一个单元加密的输入数据块大小。用于 XTS;在 CBC 模式下设为
0(默认值)。Size of input data chunks that are encrypted as a unit. Used with XTS; set to0(the default) for CBC mode.命令行格式Command-Line Format --encrypt-cipher=#类型Type 整数Integer 默认值Default Value 1最小值Minimum Value 0最大值Maximum Value 2147483647用于加密的密码算法。CBC 模式(默认值)设置为
1,XTS 设置为2。Cipher used for encryption. Set to1for CBC mode (the default), or2for XTS.--encrypt-kdf-iter-count=,#-k#命令行格式Command-Line Format --encrypt-kdf-iter-count=#类型Type 整数Integer 默认值Default Value 0最小值Minimum Value 0最大值Maximum Value 2147483647加密文件时,指定用于加密密钥的迭代次数。需要
--encrypt-password选项。When encrypting a file, specifies the number of iterations to use for the encryption key. Requires the--encrypt-passwordoption.命令行格式Command-Line Format --encrypt-key=key使用提供的密钥加密文件。Encrypts a file using the supplied key.
Note此选项不能与
--encrypt-password一起使用。This option cannot be used together with--encrypt-password.命令行格式Command-Line Format --encrypt-key-from-stdin使用从
stdin提供的密钥加密文件。Encrypt a file using the key supplied fromstdin.命令行格式Command-Line Format --encrypt-password=password类型Type 字符串String 默认值Default Value [none][none]使用选项提供的密码加密备份文件。密码必须符合此处列出的要求:Encrypts the backup file using the password supplied by the option. The password must meet the requirements listed here:
使用除
!、'、"、$、%、\、`和^之外的任何可打印 ASCII 字符Uses any of the printable ASCII characters except!,',",$,%,\,`, and^长度不超过 256 个字符Is no more than 256 characters in length
用单引号或双引号括起来Is enclosed by single or double quotation marks
Note此选项不能与
--encrypt-key一起使用。This option cannot be used together with--encrypt-key.--encrypt-password-from-stdin[=TRUE|FALSE]命令行格式Command-Line Format --encrypt-password-from-stdin使用从标准输入提供的密码加密文件。这类似于在调用 mysql
--password时不跟随密码输入密码。Encrypts a file using a password supplied from standard input. This is similar to entering a password is entered after invoking mysql--passwordwith no password following the option.--help,-?命令行格式Command-Line Format --help--help打印程序的使用信息。Prints usage information for the program.
--info,-i命令行格式Command-Line Format --info打印一个或多个输入文件的以下信息:Prints the following information about one or more input files:
文件名The name of the file
文件是否压缩(
compression=yes或compression=no)Whether the file is compressed (compression=yesorcompression=no)文件是否加密(
encryption=yes或encryption=no)Whether the file is encrypted (encryption=yesorencryption=no)
示例:Example:
$>
ndbxfrm -i BACKUP-10-0.5.Data BACKUP-10.5.ctl BACKUP-10.5.logFile=BACKUP-10-0.5.Data, compression=no, encryption=yes File=BACKUP-10.5.ctl, compression=no, encryption=yes File=BACKUP-10.5.log, compression=no, encryption=yes您还可以使用
--detailed-info选项查看文件的头部和尾部信息。You can also see the file's header and trailer using the--detailed-infooption.命令行格式Command-Line Format --login-path=path类型Type 字符串String 默认值Default Value [none][none]从登录文件读取给定路径。Read given path from login file.
命令行格式Command-Line Format --no-login-paths跳过从登录路径文件读取选项。Skips reading options from the login path file.
命令行格式Command-Line Format --no-defaults--no-defaults除了登录文件之外,不从任何配置文件读取默认选项。Do not read default options from any option file other than login file.
命令行格式Command-Line Format --print-defaults打印程序参数列表然后退出。Print program argument list and exit.
--usage,-?命令行格式Command-Line Format --usage--version,-V命令行格式Command-Line Format --version打印版本信息。Prints out version information.
ndbxfrm 可以加密由任何版本的 NDB Cluster 创建的备份。备份包含的 .Data、.ctl 和 .log 文件必须分别加密,并且每个数据节点的这些文件也必须分别加密。加密后,此类备份只能由 ndbxfrm、ndb_restore 或 ndb_print_backup 解密。ndbxfrm can encrypt backups created by any
version of NDB Cluster. The .Data,
.ctl, and .log files
comprising the backup must be encrypted separately, and these
files must be encrypted separately for each data node. Once
encrypted, such backups can be decrypted only by
ndbxfrm, ndb_restore, or
ndb_print_backup.
可以使用 --encrypt-password 和 --decrypt-password 选项一起,使用新密码对加密文件重新加密,如下所示:An encrypted file can be re-encrypted with a new password using
the --encrypt-password and
--decrypt-password options
together, like this:
ndbxfrm --decrypt-password=old--encrypt-password=newinput_fileoutput_file
在刚才显示的示例中,old 和 new 分别是旧密码和新密码;这两个都必须加引号。输入文件会被解密,然后作为输出文件进行加密。输入文件本身不会改变;如果你不希望它能够使用旧密码访问,必须手动删除输入文件。In the example just shown, old and
new are the old and new passwords,
respectively; both of these must be quoted. The input file is
decrypted and then encrypted as the output file. The input file
itself is not changed; if you do not want it to be accessible
using the old password, you must remove the input file manually.