设为首页 收藏本站
查看: 210|回复: 0

[经验分享] mydumper 0.6.2 安装,dba的必备备份工具,必须掌握

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2017-1-3 08:48:45 | 显示全部楼层 |阅读模式
新年第一天,祝愿所有的数据库都平平安安!

直接看安装过程,缺少包的自己看readme 安装好了。
[iyunv@mysql93 local]# tar -xvf mydumper-0.6.2.tar.gz
mydumper-0.6.2/CMakeLists.txt
mydumper-0.6.2/README
mydumper-0.6.2/binlog.c
mydumper-0.6.2/binlog.h
mydumper-0.6.2/cmake/
mydumper-0.6.2/common.h
mydumper-0.6.2/config.h.in
mydumper-0.6.2/docs/
mydumper-0.6.2/g_unix_signal.c
mydumper-0.6.2/g_unix_signal.h
mydumper-0.6.2/mydumper.c
mydumper-0.6.2/mydumper.h
mydumper-0.6.2/myloader.c
mydumper-0.6.2/myloader.h
mydumper-0.6.2/server_detect.c
mydumper-0.6.2/server_detect.h
mydumper-0.6.2/cmake/modules/
mydumper-0.6.2/cmake/modules/CppcheckTargets.cmake
mydumper-0.6.2/cmake/modules/FindGLIB2.cmake
mydumper-0.6.2/cmake/modules/FindMySQL.cmake
mydumper-0.6.2/cmake/modules/FindPCRE.cmake
mydumper-0.6.2/cmake/modules/FindSphinx.cmake
mydumper-0.6.2/cmake/modules/Findcppcheck.cmake
mydumper-0.6.2/cmake/modules/Findcppcheck.cpp
mydumper-0.6.2/docs/CMakeLists.txt
mydumper-0.6.2/docs/_build/
mydumper-0.6.2/docs/_static/
mydumper-0.6.2/docs/authors.rst
mydumper-0.6.2/docs/compiling.rst
mydumper-0.6.2/docs/examples.rst
mydumper-0.6.2/docs/files.rst
mydumper-0.6.2/docs/index.rst
mydumper-0.6.2/docs/mydumper_usage.rst
mydumper-0.6.2/docs/myloader_usage.rst
mydumper-0.6.2/docs/_build/conf.py.in
mydumper-0.6.2/docs/_build/sources.cmake.in
[iyunv@mysql93 local]# ll
总用量 10036
drwxr-xr-x.  2 root root    4096 11月 23 00:06 bin
drwxr-xr-x.  5 root root    4096 11月 18 2015 etc
drwxr-xr-x.  2 root root    4096 9月  23 2011 games
drwxr-xr-x  10 root root    4096 6月   1 2016 inception
drwxr-xr-x.  2 root root    4096 9月  23 2011 include
drwxr-xr-x   2 root root    4096 5月  11 2016 lepus
drwxr-xr-x.  2 root root    4096 9月  23 2011 lib
drwxr-xr-x.  2 root root    4096 9月  23 2011 lib64
drwxr-xr-x.  2 root root    4096 9月  23 2011 libexec
drwxr-xr-x   4 root root    4096 12月 29 22:02 mydumper-0.6.2
-rw-r--r--   1 root root   40165 9月  30 16:33 mydumper-0.6.2.tar.gz
drwxrwxr-x   6 root root    4096 11月 23 03:10 redis-3.0.7
-rw-r--r--   1 root root 1375200 11月 25 10:01 redis-3.0.7.tar.gz
drwxr-xr-x.  2 root root    4096 11月 18 2015 sbin
drwxr-xr-x.  5 root root    4096 8月   3 2015 share
drwxr-xr-x.  3 root root    4096 12月 10 2015 src
[iyunv@mysql93 local]# cd mydumper-0.6.2
[iyunv@mysql93 mydumper-0.6.2]# ll
总用量 140
-rw-r--r-- 1 root root  8171 9月   6 2014 binlog.c
-rw-r--r-- 1 root root  1244 9月   6 2014 binlog.h
drwxr-xr-x 3 root root  4096 12月 29 22:02 cmake
-rw-r--r-- 1 root root  2339 9月   6 2014 CMakeLists.txt
-rw-r--r-- 1 root root  2081 9月   6 2014 common.h
-rw-r--r-- 1 root root   101 9月   6 2014 config.h.in
drwxr-xr-x 4 root root  4096 12月 29 22:02 docs
-rw-r--r-- 1 root root  3614 9月   6 2014 g_unix_signal.c
-rw-r--r-- 1 root root   339 9月   6 2014 g_unix_signal.h
-rw-r--r-- 1 root root 65450 9月   6 2014 mydumper.c
-rw-r--r-- 1 root root  1937 9月   6 2014 mydumper.h
-rw-r--r-- 1 root root 12742 9月   6 2014 myloader.c
-rw-r--r-- 1 root root  1284 9月   6 2014 myloader.h
-rw-r--r-- 1 root root  2458 9月   6 2014 README
-rw-r--r-- 1 root root  2021 9月   6 2014 server_detect.c
-rw-r--r-- 1 root root  1116 9月   6 2014 server_detect.h
[iyunv@mysql93 mydumper-0.6.2]# cmake .
-- The C compiler identification is GNU 4.4.7
-- The CXX compiler identification is GNU 4.4.7
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Using mysql-config: /usr/bin/mysql_config
-- Found MySQL: /usr/include/mysql, /usr/lib64/libmysqlclient.so;/usr/lib64/libpthread.so;/usr/lib64/libm.so;/usr/lib64/librt.so;/usr/lib64/libdl.so
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.3")
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.23")
-- checking for one of the modules 'glib-2.0'
-- checking for one of the modules 'gthread-2.0'
-- checking for module 'libpcre'
--   found libpcre, version 7.8
-- Found PCRE: /usr/include  

CMake Warning at docs/CMakeLists.txt:9 (message):
  Unable to find Sphinx documentation generator


-- ------------------------------------------------
-- MYSQL_CONFIG = /usr/bin/mysql_config
-- CMAKE_INSTALL_PREFIX = /usr/local
-- BUILD_DOCS = ON
-- WITH_BINLOG = OFF
-- RUN_CPPCHECK = OFF
-- Change a values with: cmake -D<Variable>=<Value>
-- ------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/mydumper-0.6.2
[iyunv@mysql93 mydumper-0.6.2]# make
Scanning dependencies of target mydumper
[ 25%] Building C object CMakeFiles/mydumper.dir/mydumper.c.o
[ 50%] Building C object CMakeFiles/mydumper.dir/server_detect.c.o
[ 75%] Building C object CMakeFiles/mydumper.dir/g_unix_signal.c.o
Linking C executable mydumper
[ 75%] Built target mydumper
Scanning dependencies of target myloader
[100%] Building C object CMakeFiles/myloader.dir/myloader.c.o
Linking C executable myloader
[100%] Built target myloader
[iyunv@mysql93 mydumper-0.6.2]# make install
[ 75%] Built target mydumper
[100%] Built target myloader
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/bin/mydumper
-- Installing: /usr/local/bin/myloader
[iyunv@mysql93 mydumper-0.6.2]#

[iyunv@mysql93 mydumper-0.6.2]# mydumper --help
Usage:
  mydumper [OPTION...] multi-threaded MySQL dumping

Help Options:
  -?, --help                  Show help options

Application Options:
  -B, --database              Database to dump
  -T, --tables-list           Comma delimited table list to dump (does not exclude regex option)
  -o, --outputdir             Directory to output files to
  -s, --statement-size        Attempted size of INSERT statement in bytes, default 1000000
  -r, --rows                  Try to split tables into chunks of this many rows. This option turns off --chunk-filesize
  -F, --chunk-filesize        Split tables into chunks of this output file size. This value is in MB
  -c, --compress              Compress output files
  -e, --build-empty-files     Build dump files even if no data available from table
  -x, --regex                 Regular expression for 'db.table' matching
  -i, --ignore-engines        Comma delimited list of storage engines to ignore
  -m, --no-schemas            Do not dump table schemas with the data
  -k, --no-locks              Do not execute the temporary shared read lock.  WARNING: This will cause inconsistent backups
  --less-locking              Minimize locking time on InnoDB tables.
  -l, --long-query-guard      Set long query timer in seconds, default 60
  -K, --kill-long-queries     Kill long running queries (instead of aborting)
  -D, --daemon                Enable daemon mode
  -I, --snapshot-interval     Interval between each dump snapshot (in minutes), requires --daemon, default 60
  -L, --logfile               Log file name to use, by default stdout is used
  --tz-utc                    SET TIME_ZONE='+00:00' at top of dump to allow dumping of TIMESTAMP data when a server has data in different time zones or data is being moved between servers with different time zones, defaults to on use --skip-tz-utc to disable.
  --skip-tz-utc               
  --use-savepoints            Use savepoints to reduce metadata locking issues, needs SUPER privilege
  --success-on-1146           Not increment error count and Warning instead of Critical in case of table doesn't exist
  --lock-all-tables           Use LOCK TABLE for all, instead of FTWRL
  -h, --host                  The host to connect to
  -u, --user                  Username with privileges to run the dump
  -p, --password              User password
  -P, --port                  TCP/IP port to connect to
  -S, --socket                UNIX domain socket file to use for connection
  -t, --threads               Number of threads to use, default 4
  -C, --compress-protocol     Use compression on the MySQL connection
  -V, --version               Show the program version and exit
  -v, --verbose               Verbosity of output, 0 = silent, 1 = errors, 2 = warnings, 3 = info, default 2


  [iyunv@mysql93 mydumper-0.6.2]# myloader --help
Usage:
  myloader [OPTION...] multi-threaded MySQL loader

Help Options:
  -?, --help                        Show help options

Application Options:
  -d, --directory                   Directory of the dump to import
  -q, --queries-per-transaction     Number of queries per transaction, default 1000
  -o, --overwrite-tables            Drop tables if they already exist
  -B, --database                    An alternative database to restore into
  -e, --enable-binlog               Enable binary logging of the restore data
  -h, --host                        The host to connect to
  -u, --user                        Username with privileges to run the dump
  -p, --password                    User password
  -P, --port                        TCP/IP port to connect to
  -S, --socket                      UNIX domain socket file to use for connection
  -t, --threads                     Number of threads to use, default 4
  -C, --compress-protocol           Use compression on the MySQL connection
  -V, --version                     Show the program version and exit
  -v, --verbose                     Verbosity of output, 0 = silent, 1 = errors, 2 = warnings, 3 = info, default 2

[iyunv@mysql93 mydumper-0.6.2]#


[iyunv@mysql93 db_backup]# mydumper -u root -p root -h 192.168.1.93 -t 8 -o /data/db_backup/fullbak_$(date +%F)
[iyunv@mysql93 db_backup]# myloader -u root -p root -h 192.168.1.93 -t 8 -o -d ./fullbak_2016-12-29/


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-323019-1-1.html 上篇帖子: centos7.3安装paramiko报error: command 'gcc' failed with exit status 1的... 下篇帖子: mysql数据库基本操作
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表