diff --git a/sources/share/20150326 Mydumper--Mysql Database Backup tool.md b/sources/share/20150326 Mydumper--Mysql Database Backup tool.md deleted file mode 100644 index 154919f09b..0000000000 --- a/sources/share/20150326 Mydumper--Mysql Database Backup tool.md +++ /dev/null @@ -1,111 +0,0 @@ -Translating by ictlyh -Mydumper – Mysql Database Backup tool -================================================================================ -Mydumper is a tool used for backing up MySQL database servers much faster than the mysqldump tool distributed with MySQL. It also has the capability to retrieve the binary logs from the remote server at the same time as the dump itself. - -### Mydumper advantages ### - -o Parallelism (hence, speed) and performance (avoids expensive character set conversion routines, efficient code overall) - -o Easier to manage output (separate files for tables, dump metadata,etc, easy to view/parse data) - -o Consistency -- maintains snapshot across all threads, provides accurate master and slave log positions, etc - -o Manageability -- supports PCRE for specifying database and tables inclusions and exclusions - -### Install mydumper on ubuntu ### - -Open the terminal and run the following command - - sudo apt-get install mydumper - -### Using Mydumper ### - -#### Syntax #### - - mydumper [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 -- -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 -- -l, --long-query-guard Set long query timer in seconds, default 60 -- --kill-long-queries Kill long running queries (instead of aborting) -- -b, --binlogs Get a snapshot of the binary logs as well as dump data -- -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 -- -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 - -#### Mydumper Example #### - - mydumper \ - --database=$DB_NAME \ - --host=$DB_HOST \ - --user=$DB_USER \ - --password=$DB_PASS \ - --outputdir=$DB_DUMP \ - --rows=500000 \ - --compress \ - --build-empty-files \ - --threads=2 \ - --compress-protocol - -Description of Mydumper's output data - -Mydumper does not output to files, but rather to files in a directory. The --outputdir option specifies the name of the directory to use. - -The output is two parts - -Schema - -For each table in the database, a file containing the CREATE TABLE statement will be created. It will be named: - -dbname.tablename-schema.sql.gz - -Data - -For each table with number of rows above the --rows parameter, you will have a file called: - -dbname.tablename.0000n.sql.gz - -Where "n" starts with 0 up to the number of. - -If you want to restore these backup you can use Myloader - - myloader \ - --database=$DB_NAME \ - --directory=$DB_DUMP \ - --queries-per-transaction=50000 \ - --threads=10 \ - --compress-protocol \ - --verbose=3 - --------------------------------------------------------------------------------- - -via: http://www.ubuntugeek.com/mydumper-mysql-database-backup-tool.html - -作者:[ruchi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.ubuntugeek.com/author/ubuntufix \ No newline at end of file diff --git a/sources/tech/20150330 2 Ways to Create Your Own Docker Base Image.md b/sources/tech/20150330 2 Ways to Create Your Own Docker Base Image.md deleted file mode 100644 index c9ea39e5fd..0000000000 --- a/sources/tech/20150330 2 Ways to Create Your Own Docker Base Image.md +++ /dev/null @@ -1,58 +0,0 @@ -Translating by ictlyh -2 Ways to Create Your Own Docker Base Image -================================================================================ -Greetings to everyone, today we'll learn about docker base Images and how we can build our own. [Docker][1] is an Open Source project that provides an open platform to pack, ship and run any application as a lightweight container. It has no boundaries of Language support, Frameworks or packaging system and can be run anywhere, anytime from a small home computers to high-end servers. It makes them great building blocks for deploying and scaling web apps, databases, and back-end services without depending on a particular stack or provider. - -Docker Images is a read-only layer which never changes. It Docker uses a **Union File System** to add a read-write file system over the read-only file system. But all the changes go to the top-most writeable layer, and underneath, the original file in the read-only image is unchanged. Since images don't change, images do not have state. Base Images are those images that has no parent. The major benefits of it is that it allows us to have a separate linux OS running. - -Here are the ways on how we can create a custom base image. - -### 1. Creating Docker Base Image using Tar ### - -We can create our own base image using tar, we'll want to start building it with a working Linux Distribution we'll want to package as base image. This process may differ and depends on what distribution we are trying to build. In Debian distribution of Linux, debootstrap is preinstalled. We'll need to install debootstrap before starting the below process. Debootstrap is used to fetch the required packages to build the base system. Here, we'll create image based on Ubuntu 14.04 "Trusty". To do so, we'll need to run the following command in a terminal or shell. - - $ sudo debootstrap trusty trusty > /dev/null - $ sudo tar -C trusty -c . | sudo docker import - trusty - -![creating docker base image using debootstrap](http://blog.linoxide.com/wp-content/uploads/2015/03/creating-base-image-debootstrap.png) - -Here, the above command creates a tar file of the current directory and outputs it to STDOUT, where "docker import - trusty" takes it from STDIN and creates a base image called trusty from it. Then, we'll run a test command inside that image as follows. - - $ docker run trusty cat /etc/lsb-release - -Here are some example scripts that will allow us to build quick base images in [Docker GitHub Repo][2] . - -### 2. Creating Base Image using Scratch ### - -In the Docker registry, there is a special repository known as Scratch, which was created using an empty tar file: - - $ tar cv --files-from /dev/null | docker import - scratch - -![creating docker base image using scratch](http://blog.linoxide.com/wp-content/uploads/2015/03/creating-base-image-using-scratch.png) - - -We can use that image to base our new minimal containers FROM: - -FROM scratch -ADD script.sh /usr/local/bin/run.sh -CMD ["/usr/local/bin/run.sh"] - -The above Dockerfile is from an extremely minimal image. Here, first it starts with a totally blank filesystem, then it copies script.sh that is created to /usr/local/bin/run.sh and then run the script /usr/local/bin/run.sh . - -### Conclusion ### - -Here, in this tutorial, we learned how we can build a custom Docker Base Image out of the box. Building a docker base image is an easy task because there are sets of packages and scripts already available for. Building a docker base image is a lot useful if we want to install what we want in it. So, if you have any questions, suggestions, feedback please write them in the comment box below. Thank you ! Enjoy :-) - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/2-ways-create-docker-base-image/ - -作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ -[1]:https://www.docker.com/ -[2]:https://github.com/docker/docker/blob/master/contrib/mkimage-busybox.sh \ No newline at end of file diff --git a/translated/share/20150326 Mydumper--Mysql Database Backup tool.md b/translated/share/20150326 Mydumper--Mysql Database Backup tool.md new file mode 100644 index 0000000000..97e83e0933 --- /dev/null +++ b/translated/share/20150326 Mydumper--Mysql Database Backup tool.md @@ -0,0 +1,110 @@ +Mydumper - MySQL数据库备份工具 +================================================================================ +Mydumper 是MySQL数据库服务器备份工具,它比MySQL自带的mysqldump快很多。它还有在转储本身的时候检索远程服务器二进制日志文件的能力。 + +### Mydumper 的优势 ### + +o 并行性 (因此有高速度) 和 性能 (避免了昂贵的字符集转换例程, 高效的代码) + +o 更容易管理输出 (每个表独立的文件,转储元数据等,简单的查看/解析数据) + +o 一致性 -- 在所有线程中维护快照, 提供准确的主从结点日志位置等。 + +o 可管理性 -- 支持对包含和排除指定的数据库和表的PCRE操作(译者注:PCRE,Perl Compatible Regular Expression,Perl兼容正则表达式) + +### 在Ubuntu上安装 mydumper ### + +打开终端运行以下命令 + + sudo apt-get install mydumper + +### 使用 Mydumper ### + +#### 语法 #### + + mydumper [options] + +应用程序选项: + +- -B, --database 转储的数据库 +- -T, --tables-list 逗号分隔的转储表列表(不排除正则表达式) +- -o, --outputdir 保存输出文件的目录 +- -s, --statement-size 插入语句的字节大小, 默认是1000000个字节 +- -r, --rows 把表分为每个这么多行的块 +- -c, --compress 压缩输出文件 +- -e, --build-empty-files 尽管表中没有数据也创建输出文件 +- -x, --regex 匹配‘db.table'的正则表达式 +- -i, --ignore-engines 逗号分隔的忽略存储引擎列表 +- -m, --no-schemas 不转储有数据的表架构 +- -k, --no-locks 不执行临时共享读锁. 警告: 这会导致备份的不一致性 +- -l, --long-query-guard 设置长查询的计时器秒数,默认是60秒 +- --kill-long-queries 杀死长查询 (而不是退出) +- -b, --binlogs 获取二进制日志文件和转储数据的快照 +- -D, --daemon 开启守护进程模式 +- -I, --snapshot-interval 每个转储快照之间的间隔时间(分钟), 需要开启 --daemon, 默认是60分钟 +- -L, --logfile 日志文件的名字,默认是stdout +- -h, --host 要连接的主机 +- -u, --user 有转储权限的用户名 +- -p, --password 用户密码 +- -P, --port 连接的TCP/IP端口 +- -S, --socket 用于连接的Unix套接字文件 +- -t, --threads 使用的线程数,默认是4 +- -C, --compress-protocol 在MySQL连接上使用压缩 +- -V, --version 查看程序版本号 +- -v, --verbose 输出信息的等级, 0 = silent, 1 = errors, 2 = warnings, 3 = info, 默认是2 + +#### Mydumper 例子 #### + + mydumper \ + --database=$DB_NAME \ + --host=$DB_HOST \ + --user=$DB_USER \ + --password=$DB_PASS \ + --outputdir=$DB_DUMP \ + --rows=500000 \ + --compress \ + --build-empty-files \ + --threads=2 \ + --compress-protocol + +Mydumper输出数据的说明 + +Mydumper不直接指定输出的文件,而是输出到文件夹的文件中。--outputdir 选项指定要使用的目录名称。 + +输出分为两部分 + +架构 + +对数据库中的每个表,创建包含 CREATE TABLE 语句的文件。文件命名为: + +dbname.tablename-schema.sql.gz + +数据 + +对于每个行数多余--rows参数的表, 创建文件名字为: + +dbname.tablename.0000n.sql.gz + +"n"从0开始. + +你可以使用Myloader恢复这些备份 + + myloader \ + --database=$DB_NAME \ + --directory=$DB_DUMP \ + --queries-per-transaction=50000 \ + --threads=10 \ + --compress-protocol \ + --verbose=3 + +-------------------------------------------------------------------------------- + +via: http://www.ubuntugeek.com/mydumper-mysql-database-backup-tool.html + +作者:[ruchi][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.ubuntugeek.com/author/ubuntufix \ No newline at end of file diff --git a/translated/tech/20150330 2 Ways to Create Your Own Docker Base Image.md b/translated/tech/20150330 2 Ways to Create Your Own Docker Base Image.md new file mode 100644 index 0000000000..63188ebc5b --- /dev/null +++ b/translated/tech/20150330 2 Ways to Create Your Own Docker Base Image.md @@ -0,0 +1,57 @@ +创建你自己的Docker基本映像的2中方式 +================================================================================ +欢迎大家,今天我们学习一下docker基本映像以及如何构建我们自己的docker基本映像。[Docker][1]是一个开源项目,为打包,装载和运行任何应用提供开发平台的轻量级容器。它没有语言支持,框架和打包系统的限制,从小型的家用电脑到高端的服务器,在何时何地都可以运行。这使它们成为不依赖于特定栈和供应商,很好的部署和扩展网络应用,数据库和后端服务的构建块。 + +Docker映像是不可更改的只读层。Docker使用**Union File System**在只读文件系统上增加读写文件系统。但所有更改都发生在最顶层的可写层,最底部,在只读映像上的原始文件仍然不会改变。由于映像不会改变,也就没有状态。基本映像是没有父类的那些映像。Docker基本映像主要的好处是它允许我们有一个独立允许的Linux操作系统。 + +下面是我们如何可以创建自定义基本映像的方式。 + +### 1. 使用Tar创建Docker基本映像 ### + +我们可以使用tar构建我们自己的基本映像,我们从将要打包为基本映像的运行中的Linux发行版开始构建。这过程可以会有些不同,它取决于我们打算构建的发行版。在Linux的发行版Debian中,已经预装了debootstrap。在开始下面的步骤之前,我们需要安装debootstrap。debootstrap用来获取构建基本系统需要的包。这里,我们构建基于Ubuntu 14.04 "Trusty" 的映像。做这些,我们需要在终端或者shell中运行以下命令。 + + $ sudo debootstrap trusty trusty > /dev/null + $ sudo tar -C trusty -c . | sudo docker import - trusty + +![使用debootstrap构建docker基本映像](http://blog.linoxide.com/wp-content/uploads/2015/03/creating-base-image-debootstrap.png) + +上面的命令为当前文件夹创建了一个tar文件并输出到STDOUT中,"docker import - trusty"从STDIN中获取这个tar文件并根据它创建一个名为trusty的基本映像。然后,如下所示,我们将运行映像内部的一条测试命令。 + + $ docker run trusty cat /etc/lsb-release + +[Docker GitHub Repo][2] 中有一些允许我们快速构建基本映像的事例脚本. + +### 2. 使用Scratch构建基本映像 ### + +在Docker的注册表中,有一个被称为Scratch的使用空tar文件构建的特殊库: + + $ tar cv --files-from /dev/null | docker import - scratch + +![使用scratch构建docker基本映像](http://blog.linoxide.com/wp-content/uploads/2015/03/creating-base-image-using-scratch.png) + + +我们可以使用这个映像构建新的小容器: + +FROM scratch +ADD script.sh /usr/local/bin/run.sh +CMD ["/usr/local/bin/run.sh"] + +上面的Docker文件来自一个很小的映像。这里,它首先从一个完全空的文件系统开始,然后它复制新建的/usr/local/bin/run.sh为script.sh,然后运行脚本/usr/local/bin/run.sh。 + +### 结尾 ### + +这这个教程中,我们学习了如果构建一个自定义的Docker基本映像。构建一个docker基本映像是一个很简单的任务,因为这里有很多已经可用的包和脚本。如果我们想要在里面安装想要的东西,构建docker基本映像非常有用。如果有任何疑问,建议或者反馈,请在下面的评论框中写下来。非常感谢!享受吧 :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/2-ways-create-docker-base-image/ + +作者:[Arun Pyasi][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:https://www.docker.com/ +[2]:https://github.com/docker/docker/blob/master/contrib/mkimage-busybox.sh \ No newline at end of file