红旗Linux案例精选:使用Amanda ZRM备份远程MySQL数据库
本文写道最后的时候,我才发现ZRM for MySQL的一个致命问题,就我目前的理解和测试来看,它恢复数据的时候是采取覆盖的方式,举个
本文写道最后的时候,我才发现ZRM for MySQL的一个致命问题,就我目前的理解和测试来看,它恢复数据的时候是采取覆盖的方式,举个例子,假定某台数据库服务器上有两个数据库test1,test2,你备份了这两个数据库,某一天,test2数据库里的某一个表坏了,那么它无法做到仅仅只是恢复损坏的表,甚至无法做到仅仅恢复test2,而是直接把test1,test2都恢复。那这绝对是一个噩梦。
但愿我目前的理解是错误的,只是我实在找不到控制恢复粒度的地方。下面的文字就当闲着无聊看看吧。
Zmanda Recovery Manager(ZRM)提供了备份MySQL数据库的能力,,并且支持两种备份模式:逻辑备份和裸备份,有关详细的介绍,可以看官方的介绍。下面给出一个备份的实例。
先介绍备份的环境,如果大家看过之前的那篇Amanda集中备份实例,那么大概就知道是什么样的一个网络架构了,承接上文,这里备份服务器还是cp1.domain.com,MySQL数据库分别运行在cp2.domain.com和cp3.domain.com上,需要备份其所有的数据库。
一、服务端的安装和配置
首先从官方站点下载对应系统的服务端程序,然后安装。注意:服务端与perl-DBI,MySQL-client程序库有依赖关系,安装之前先安装这个两个包。
安装完后,/etc/mysql-zrm/是其配置文件的所在地。/etc/mysql-zrm/目录下有一个mysql-zrm.conf文件,这是最重要的配置文件。在/etc/mysql-zrm/目录下,你可以创建一些目录,每一个目录就是一个备份集的名称,我这里为了直观,采取了主机名的方式来创建备份集
cp2.domain.com,cp3.domain.cometc
/etc/mysql-zrm/mysql-zrm.conf可以做为全局配置文件,针对每一台需要备份的数据库的不同,可以在备份集目录里的mysql-zrm.conf再定义,这里的定义可以覆盖全局定义。
首先,我们把一些全局定义信息配置在/etc/mysql-zrm/mysql-zrm.conf文件里
#cat /etc/mysql-zrm/mysql-zrm.conf backup-level=0 backup-mode=logical backup-type=regular destination=/yourpath/db compress=1 compress-plugin==1 encrypt-plugin="/usr/share/mysql-zrm/plugins/encrypt.pl" decrypt-option="-d" all-databases=="securepassword" mailto="your@domain.com"
上面的配置信息应该比较直观。
然后配置每一台MySQL服务器的一些特有参数
=/yourpath/db =/yourpath/db
创建加密的密码文件
root@cp1:~# chmod 700 /etc/mysql-zrm/.passphrase

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Full table scanning may be faster in MySQL than using indexes. Specific cases include: 1) the data volume is small; 2) when the query returns a large amount of data; 3) when the index column is not highly selective; 4) when the complex query. By analyzing query plans, optimizing indexes, avoiding over-index and regularly maintaining tables, you can make the best choices in practical applications.

InnoDB's full-text search capabilities are very powerful, which can significantly improve database query efficiency and ability to process large amounts of text data. 1) InnoDB implements full-text search through inverted indexing, supporting basic and advanced search queries. 2) Use MATCH and AGAINST keywords to search, support Boolean mode and phrase search. 3) Optimization methods include using word segmentation technology, periodic rebuilding of indexes and adjusting cache size to improve performance and accuracy.

Yes, MySQL can be installed on Windows 7, and although Microsoft has stopped supporting Windows 7, MySQL is still compatible with it. However, the following points should be noted during the installation process: Download the MySQL installer for Windows. Select the appropriate version of MySQL (community or enterprise). Select the appropriate installation directory and character set during the installation process. Set the root user password and keep it properly. Connect to the database for testing. Note the compatibility and security issues on Windows 7, and it is recommended to upgrade to a supported operating system.

The difference between clustered index and non-clustered index is: 1. Clustered index stores data rows in the index structure, which is suitable for querying by primary key and range. 2. The non-clustered index stores index key values and pointers to data rows, and is suitable for non-primary key column queries.

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

In MySQL database, the relationship between the user and the database is defined by permissions and tables. The user has a username and password to access the database. Permissions are granted through the GRANT command, while the table is created by the CREATE TABLE command. To establish a relationship between a user and a database, you need to create a database, create a user, and then grant permissions.
