- 论坛徽章:
- 0
|
MySQL数据库备份和恢复方案ZRM for MySQL手册中文翻译-mysql-zrm.conf样本
配置文件mysql-zrm.conf可以设置ZRM for MySQL备份的选项。默认的配置文件为:/etc/mysql-zrm/mysql-zrm.conf
配置ZRM for MySQL备份选项包括如下三个步骤:
- 评估当前的备份环境和备份需求,这些将决定需要备份那些数据库/表、是否要压缩/加密备份等。请参考“要备份什么”了解更多信息。
- 在配置文件,取消注释你要使用的备份选项。复制修改后的配置文件作为全局配置文件或者备份组配置文件。如此使用不同的备份选项多次运行备份命令,如完全备份/增量备份,裸备份/逻辑备份,压缩等等。最后形成最优化的适合自己的备份要求的选项。
- 使用备份报表获取各种备份指标,如备份大小、备份时间、读锁时间、写锁时间等。最后确定自己的备份选项。
带注释的配置文件实例:
分段描述不同的备份选项。- #
- # Template for Zmanda Recovery Manager for MySQL configuration file
- #
- # Copy Global configuration file to /etc/mysql-zrm/mysql-zrm.conf
- #
- # If backup set specific options are required.
- # The file should be copied to /etc/mysql-zrm/<backup set name>/mysql-zrm.conf
- #
- # MySQL ZRM configuration file describes the backup configuration for
- # a backup set. This file is organized into five sections for convenience
- # - Backup parameters,
- # - Databases/tables that are part of backup set,
- # - MySQL server parameters
- # - ZRM parameters.
- # - ZRM plugin parameters.
- #
- # For more information about Zmanda Recovery Manager for MySQL, please
- # see mysql-zrm(1) and/or Administration manual at
- # http://mysqlbackup.zmanda.com
- #
- # Any line starting with '#' are comments and will be ignored
- #
复制代码 Backup parameters部分决定怎么备份,包括压缩、加密、备份目录、备份保留策略等。- # Backup parameters
- #
- # Backup comment. This is a text string which can be retrieved
- # using the mysql-zrm-reporter(1) tool. You can store some notes
- # about the backup set.
- # This parameter is optional and has no defaults.
- # comment=This is a comment
- #
- # Backup Level. It can be full or incremental
- # Use 0 for full and 1 for incremental backups
- # This parameter is optional and default value is full backup.
- # backup-level=0
- #
- # Backup method
- # Values can be "raw" or "logical". Logical backup are backups using
- # mysqldump(1) tool
- # This parameter is optional and default value is "raw".
- # backup-mode=raw
- #
- # Backup type
- # Specifies the type of backup. Values can be "regular" or "quick".
- # Quick backup type uses the snapshot itself as the backup
- # without copying the data from the snapshot volume
- # backup-type=quick
- #
- # Size of LVM snapshot.
- # This parameter is optional and is required only
- # for "raw" backup-mode and if the MySQL database data are stored in
- # LVM logical volumes.
- # A size suffix of k for kilobyte, m for megabyte, g for gigabyte
- # or t for terabyte
- # snapshot-size=10M
- #
- # snapshot-plugin="/usr/share/mysql-zrm/plugins/lvm-snapshot.pl"
- #
- # Directory to which backups are done. All backups are stored under this
- # directory. This parameter is optional and the default
- # value is "/var/lib/mysql-zrm"
- # destination=/var/lib/mysql-zrm
- #
- # Directory to use for temporary storage. This parameter is optional
- #tmpdir=/tmp
- #
- # Retention:
- # Specifies how long the backup should be retained. The value can be
- # specified in days (suffix D), weeks (suffix: W), months (suffix: M) or
- # years (suffix Y). 30 days in a month and 365 days in a year are assumed
- # This parameter is optional and the default is the backups are retained
- # forever.
- # retention-policy=10W
- #
- # Replication
- # This parameter should be set to 1 if MySQL ZRM backups are being on done on a
- # MySQL replication slave.
- # replication=1
- #
- # Compress
- # This parameter should be set to 1 if backups should be compressed. If this
- # parameter is set, gzip(1) command is used by default. If different
- # compression algorithm should be used, it must be set in "compress-plugin"
- # parameter. Default: There is no data compression.
- # compress=1
- #
- # Compression Utility
- # This specifies the program to be used for compression. The "compression"
- # parameter must be set for this parameter to be used. The compression
- # command should also support -d option for uncompress backup images. If
- # value is not specified then gzip(1) is used for compression.
- # compress-plugin=/usr/bin/gzip
- #
- # Encrypt
- # This parameter should be set to 1 if backups should be encrypted.
- # The "encrypt-plugin" parameter must be configured. Default: There is no
- # data encryption.
- # encrypt=1
- #
- # Encryption Utility
- # This parameter specifies that the program that should be used for
- # backup data encryption. "decrypt-option" parameter should also be specified.
- # encrypt-plugin="/usr/share/mysql-zrm/plugins/encrypt.pl"
- #
- # Decryption Options
- # This specifies the option to be passed to the encryption
- # program specified as "encrypt-plugin" parameter for decryption.
- # decrypt-option="-d"
复制代码 Databases/Tables部分指定要备份的数据库/表- # Databases/Tables in the backup set
- # One of the "all-databases" or "databases" or "tables"/"database" parameters
- # should be specified. If none of the them are specified, "all-databases"
- # is assumed.
- #
- # This parameter should be set to 1 if all databases are part of this backup set
- #all-databases=1
- #
- #
- # List of databases that are part of this backup set. Multiple database
- # names are separated by space character. This parameter is ignored if
- # "all-databases" is set 1.
- #databases=wikidb forums
- #
- #
- # List of specific tables that are part of this backup set. This parameter
- # should not be specified if all tables in the databases in "databases"
- # parameter are part of the backup set. Multiple table names should be
- # separated by space character. The database to which these tables belong
- # to should be specified in "database" parameter.
- #tables=text user page
- #
- #database="wikidb"
复制代码 MySQL server parameters指定MySQL数据库服务器的选项-
- # MySQL server parameters
- # MySQL database user used for backup and recovery of the backup set.
- # This parameter is optional. If this parameter is not specified, values from
- # my.cnf configuration file.
- #user="wikiuser"
- #
- # MySQL database user password.
- # This parameter is optional. If this parameter is not specified, values from
- # my.cnf configuration file or no password is used.
- #password="userwiki"
- #
- # Fully qualified domain name of the MySQL server.
- # This parameter is optional. If this parameter is not specified, values from
- # my.cnf configuration file.
- #host="localhost.company.com"
- #
- # Port to which the MySQL server is listening to. This parameter is optional
- # and default value is 3306
- #port=3306
- #
- #Name of Socket file that can be used for connecting to MySQL
- #socket=/var/lib/mysql/mysql.sock
- #
- # ssl-options are arguments that are passed to MySQL client commands
- # for SSL connection to the MySQL server. This parameter is optional and is
- # required only if MySQL server allows SSL connections.
- #ssl-options="--ssl --ssl-ca=file1 --ssl-cert=file2 --ssl-key=file3"
- #
- # This can be set to specify that mysqldump should dump stored routines also. This paramter is optional and
- # the default is that stored routines are not dumped mysqldump
- #routines=1
- #
- # This can be used to specif the character set name that mysqldump should use as default. This parameter
- # is optional. If not specified utf8 is used as the default character set.
- #default-character-set=utf8
- #
- # Directory where MySQL commands can be found. The parameter is optional.
- #mysql-binpath="/opt/lampp/bin"
- #
- # Directory where MySQL binary logs can be found. The parameter is optional.
- #mysql-binlog-path="/var/log/mysql"
- #
复制代码 ZRM parameters指定备份输出信息、备份管理员邮件和备份报表和RSS信息等。-
- #
- # ZRM parameters
- #
- # This parameter controls the verbosity of MySQL ZRM logging. The MySQL ZRM logs
- # are available at /var/log/mysql-zrm/mysql-zrm.log. This parameter is optional
- # default value is 0 (less verbose).
- # The valid values are 0 and 1
- #verbose=1
- #
- # Mailto Address
- # After a backup run the backup report is emailed to the mailto address
- # This parameter is optional and default behavior is not to send mail
- # notifications.
- #mailto="root@localhost"
- #
- # The list of backup reports that are generated after each backup run if
- # "html-report-directory" parameter is specified.
- # If this parameter is not specified, "backup-status-info" report is generated.
- # Valid report names are : backup-method-info, backup-status-info,
- # backup-retention-info, backup-performance-info,
- # restore-full-info, restore-incr-info,
- # replication-info, backup-app-performance-info
- # See mysql-zrm-reporter(1) for details of backup reports.
- # Multiple report names should be separated by ",".
- #html-reports=backup-status-info
- #
- # Directory in which Text/HTML reports will be created by mysql-zrm-reporter(1)
- # tool. If this parameter is specified, the mysql-zrm-reporter(1) creates the
- # backup reports in this directory after each successful or unsuccessful
- # backup run.
- # Text reports will be created under "text" sub-directory
- # HTML reports will be created under "html" sub-directory
- #html-report-directory=/var/www/mysql-zrm/reports/
- #
- #
- # If backup reports are required as RSS feed, "webserver-url" parameter must
- # be specified. The value must be set to a valid location on the web server
- # in which HTML reports are located and that URL can be used by
- # administrator/user to browse HTML reports and can get to the RSS feeds.
- # If this parameter is not specified, backup reports are not generated as
- # RSS feeds. The list of reports that are available as RSS feed is specified
- # in "html-reports".
- #webserver-url=http://www.company.com/reports/html/
- #
- # Location of RSS header file. Administrators can customize RSS channel
- # properties using this file. A template for RSS header is available in
- # /usr/share/mysql-zrm/plugins/RSS.header file. Location of RSS header
- # must be provided if "webserver-url" is specified.
- #rss-header-location=/etc/mysql-zrm/
- #
复制代码 ZRM plugin parameters部分指定与备份相关插件的选项。-
- #
- # ZRM plugin parameters.
- # ZRM provides plugin interfaces to allow MySQL administrators to customize
- # the backup to their environment.
- #
- # COPY plugin: Only one copy-plugin must be configured for a backup set.
- #
- # Socket Copy plugin is to used to transfer backup files from MySQL server to
- # the machine running ZRM for MySQL with sockets.
- #
- # Please read the Notes at /usr/share/doc/mysql-zrm/README-plugin-socket-copy
- #
- #copy-plugin=/usr/share/mysql-zrm/plugins/socket-copy.pl
- #
- # SSH Copy plugin is to used to transfer backup files from MySQL server to
- # the machine running ZRM for MySQL with ssh
- #
- # Please read the Notes at /usr/share/doc/mysql-zrm/README-plugin-ssh-copy
- #
- #copy-plugin=/usr/share/mysql-zrm/plugins/ssh-copy.pl
- #
- # PRE-BACKUP plugin: Plugin that will be called before a backup run for
- # the backup set.
- #pre-backup-plugin="/usr/share/mysql-zrm/plugins/pre-backup.pl"
- #
- # Set of parameters passed to the pre-backup-plugin. These parameters are
- # passed to "pre-backup-plugin" before a backup run for the backup set.
- # "pre-backup-plugin" parameter must be specified.
- #pre-backup-plugin-options="option1 option2"
- #
- # POST-BACKUP plugin: Plugin that will be called after a backup run for
- # the backup set.
- #post-backup-plugin="/usr/share/mysql-zrm/plugins/post-backup.pl"
- #
- # Set of parameters passed to the post-backup-plugin. These parameters are
- # passed to "post-backup-plugin" after a backup run for the backup set.
- # "post-backup-plugin" parameter must be specified.
- #post-backup-plugin-options="option1 option2"
- #
- # PRE-SCHEDULER plugin: Plugin that can be used to dynamically determine the
- # start time for a backup run.
- #pre-scheduler-plugin="/usr/share/mysql-zrm/plugins/pre-scheduler.pl"
- #
- # ZRM Plugin configuration parameters
- #
- # This parameter is used by the encrypt plugin and
- # specifies the file containing the passphrase.
- #passfile="/tmp/a.pass"
- #
- # This parameter is used by ssh-plugin.pl plugin to specify the user to be
- # used to ssh to the remote host
- #ssh-user="root"
- #
- # This parameter is used by the ssh-copy.pl and socket-copy.pl plugins
- # to specify the location of mysql client binaries on the remote host.
- #remote-mysql-binpath="/usr/bin"
- #
- # This parameter is used by the socket-copy.pl plugin to specify the port
- # to be opened on the remote host.
- #socket-remote-port="25300"
复制代码
中文项目主页:http://www.lazysa.com/zrm-for-mysql
[ 本帖最后由 longkaty 于 2009-9-24 20:51 编辑 ] |
|