dumpling怎么用!

【 TiDB 使用环境】生产环境
【 TiDB 版本】5.0.1
【复现路径】做过哪些操作出现的问题
【遇到的问题:问题现象及影响】
【资源配置】
【附件:截图/日志/监控】

你把dumpling下载到哪里了? 写全路径

需要先确认你是否安装Dumping, ./dumpling使用的是dumpling这个命令文件,你看一下你安装后在哪,然后再使用全路径进行指定。

在哪下载

[root@master ~]# tiup dumpling -u -root -P 4000 -H 192.168.30.141 --filetype sql -t 8 -o /home/tidb/databak/test -r 2000000 -B test
tiup is checking updates for component dumpling …
Starting component dumpling: /root/.tiup/components/dumpling/v5.4.2/dumpling -u -root -P 4000 -H 192.168.30.141 --filetype sql -t 8 -o /home/tidb/databak/test -r 2000000 -B test
unknown shorthand flag: ‘H’ in -H
Dumpling is a CLI tool that helps you dump MySQL/TiDB data

Usage:
dumpling [flags]

Flags:
–allow-cleartext-passwords Allow passwords to be sent in cleartext (warning: don’t use without TLS)
–azblob.access-tier string Specify the storage class for azblob
–azblob.account-key string Specify the account key for azblob
–azblob.account-name string Specify the account name for azblob
–azblob.endpoint string (experimental) Set the Azblob endpoint URL
–ca string The path name to the certificate authority file for TLS connection
–case-sensitive whether the filter should be case-sensitive
–cert string The path name to the client certificate file for TLS connection
–complete-insert Use complete INSERT statements that include column names
-c, --compress string Compress output file type, support ‘gzip’, ‘no-compression’ now
–consistency string Consistency level during dumping: {auto|none|flush|lock|snapshot} (default “auto”)
–csv-delimiter string The delimiter for values in csv files, default ‘"’ (default “"”)
–csv-null-value string The null value used when export to csv (default “\N”)
–csv-separator string The separator for csv files, default ‘,’ (default “,”)
-B, --database strings Databases to dump
–dump-empty-database whether to dump empty database (default true)
–escape-backslash use backslash to escape special characters (default true)
-F, --filesize string The approximate size of output file
–filetype string The type of export file (sql/csv)
-f, --filter strings filter to select which tables to dump (default [.,!/^(mysql|sys|INFORMATION_SCHEMA|PERFORMANCE_SCHEMA|METRICS_SCHEMA|INSPECTION_SCHEMA)$/.*])
–gcs.credentials-file string (experimental) Set the GCS credentials file path
–gcs.endpoint string (experimental) Set the GCS endpoint URL
–gcs.predefined-acl string (experimental) Specify the GCS predefined acl for objects
–gcs.storage-class string (experimental) Specify the GCS storage class for objects
–help Print help message and quit
-h, --host string The host to connect to (default “127.0.0.1”)
–key string The path name to the client private key file for TLS connection
-L, --logfile path Log file path, leave empty to write to console
–logfmt format Log format: {text|json} (default “text”)
–loglevel string Log level: {debug|info|warn|error|dpanic|panic|fatal} (default “info”)
-d, --no-data Do not dump table data
–no-header whether not to dump CSV table header
-m, --no-schemas Do not dump table schemas with the data
-W, --no-views Do not dump views (default true)
-o, --output string Output directory (default “./export-2023-04-22T11:09:55+08:00”)
–output-filename-template string The output filename template (without file extension)
–params stringToString Extra session variables used while dumping, accepted format: --params “character_set_client=latin1,character_set_connection=latin1” (default [])
-p, --password string User password
-P, --port int TCP/IP port to connect to (default 4000)
-r, --rows uint If specified, dumpling will split table into chunks and concurrently dump them to different files to improve efficiency. For TiDB v3.0+, specify this will make dumpling split table with each file one TiDB region(no matter how many rows is).
If not specified, dumpling will dump table without inner-concurrency which could be relatively slow. default unlimited
–s3.acl string (experimental) Set the S3 canned ACLs, e.g. authenticated-read
–s3.endpoint string (experimental) Set the S3 endpoint URL, please specify the http or https scheme explicitly
–s3.provider string (experimental) Set the S3 provider, e.g. aws, alibaba, ceph
–s3.region string (experimental) Set the S3 region, e.g. us-east-1
–s3.sse string Set S3 server-side encryption, e.g. aws:kms
–s3.sse-kms-key-id string KMS CMK key id to use with S3 server-side encryption.Leave empty to use S3 owned key.
–s3.storage-class string (experimental) Set the S3 storage class, e.g. STANDARD
–snapshot string Snapshot position (uint64 or MySQL style string timestamp). Valid only when consistency=snapshot
-s, --statement-size uint Attempted size of INSERT statement in bytes (default 1000000)
–status-addr string dumpling API server and pprof addr (default “:8281”)
-T, --tables-list strings Comma delimited table list to dump; must be qualified table names
-t, --threads int Number of goroutines to use, default 4 (default 4)
–tidb-mem-quota-query uint The maximum memory limit for a single SQL statement, in bytes.
-u, --user string Username with privileges to run the dump (default “root”)
-V, --version Print Dumpling version
–where string Dump only selected records
unknown shorthand flag: ‘H’ in -H

-h改成小写

tiup install dumpling,然后去.tiup目录下的component目录下把dumpling拷贝到你需要使用dumpling的机器上。

./dumpling -h 10.10.10.16 -P 4000 -u root -p ****** -o /tmp/test --filetype sql -t 8 -r 200000 -F 256MiB -T test2.trun_tab --snapshot “2022-11-30 11:02:20”
大概这样

tiup dumpling -u root -P 4000 -h 192.168.30.141 --filetype sql -t 8 -o /home/tidb/databak/test -r 2000000 -B test

我这么完成的

此话题已在最后回复的 60 天后被自动关闭。不再允许新回复。