PDA

View Full Version : Possible MySQL-ZRM bug??!



mrigank.mishra
September 5th, 2008, 09:43 PM
I don't know if this is expected behaviour of ZRM or not, but I had been having problems with passwordless backup. I have posted my issues on this THREAD (http://forums.zmanda.com/showpost.php?p=4609&postcount=5). Kindly follow the same..

Initially I had been using backup-mode=raw (default) and it kept asking for password..
I then checked the backup with backup-mode=logical. Surprisingly enough, this time the backup completed without asking for any password...
I tried doing the backup-mode=raw thing again (hoping for a "pleasant accident" that might have fixed something...) but it started asking for password again...

Any explanations for this behaviour?!!

The log for backup-mode=logical is below:

backup:~ # mysql-zrm-scheduler --backup-set DailyBackup_SSH --backup-level 0 -now
schedule:INFO: ZRM for MySQL Community Edition - version 2.0
Logging to /var/log/mysql-zrm/mysql-zrm-scheduler.log
backup:INFO: ZRM for MySQL Community Edition - version 2.0
DailyBackup_SSH:backup:INFO: START OF BACKUP
DailyBackup_SSH:backup:INFO: PHASE START: Initialization
DailyBackup_SSH:backup:INFO: Mail address: root@localhost is ok
DailyBackup_SSH:backup:INFO: ZRM Temporary configuration file = /etc/mysql-zrm/DailyBackup_SSH/tmpBye2Y.conf
DailyBackup_SSH:backup:INFO: {
DailyBackup_SSH:backup:INFO: verbose=1
DailyBackup_SSH:backup:INFO: encrypt-plugin=/usr/share/mysql-zrm/plugins/encrypt.pl
DailyBackup_SSH:backup:INFO: retention-policy=30D
DailyBackup_SSH:backup:INFO: decrypt-option=-d
DailyBackup_SSH:backup:INFO: password=******
DailyBackup_SSH:backup:INFO: tables=student
DailyBackup_SSH:backup:INFO: backup-mode=logical
DailyBackup_SSH:backup:INFO: compress-plugin=/usr/bin/gzip
DailyBackup_SSH:backup:INFO: user=mysql_backup_usr
DailyBackup_SSH:backup:INFO: copy-plugin=/usr/share/mysql-zrm/plugins/ssh-copy.pl
DailyBackup_SSH:backup:INFO: backup-level=0
DailyBackup_SSH:backup:INFO: quiet=0
DailyBackup_SSH:backup:INFO: encrypt=/usr/share/mysql-zrm/plugins/encrypt.pl
DailyBackup_SSH:backup:INFO: mailto=root@localhost
DailyBackup_SSH:backup:INFO: ssh-user=mysql
DailyBackup_SSH:backup:INFO: host=remote.mysql.net
DailyBackup_SSH:backup:INFO: database=sample
DailyBackup_SSH:backup:INFO: compress=/usr/bin/gzip
DailyBackup_SSH:backup:INFO: }
DailyBackup_SSH:backup:INFO: Getting mysql variables
DailyBackup_SSH:backup:INFO: mysqladmin --user="mysql_backup_usr" --password="*****" --host="remote.mysql.net" variables
DailyBackup_SSH:backup:INFO: datadir is /usr/local/mysql/var/
DailyBackup_SSH:backup:INFO: mysql_version is 5.0.67-log
DailyBackup_SSH:backup:INFO: InnoDB data file are /usr/local/mysql/var/ibdata1
DailyBackup_SSH:backup:INFO: InnoDB log dir is /usr/local/mysql/var/.
DailyBackup_SSH:backup:INFO: backup set being used is DailyBackup_SSH
DailyBackup_SSH:backup:INFO: backup-set=DailyBackup_SSH
DailyBackup_SSH:backup:INFO: backup-date=20080905170240
DailyBackup_SSH:backup:INFO: mysql-server-os=Linux/Unix
DailyBackup_SSH:backup:INFO: host=remote.mysql.net
DailyBackup_SSH:backup:INFO: backup-date-epoch=1220614360
DailyBackup_SSH:backup:INFO: retention-policy=30D
DailyBackup_SSH:backup:INFO: mysql-zrm-version=ZRM for MySQL Community Edition - version 2.0
DailyBackup_SSH:backup:INFO: mysql-version=5.0.67-log
DailyBackup_SSH:backup:INFO: backup-directory=/var/lib/mysql-zrm/DailyBackup_SSH/20080905170240
DailyBackup_SSH:backup:INFO: backup-level=0
DailyBackup_SSH:backup:INFO: backup-mode=logical
DailyBackup_SSH:backup:INFO: PHASE END: Initialization
DailyBackup_SSH:backup:INFO: PHASE START: Running pre backup plugin
DailyBackup_SSH:backup:INFO: Executing pre-backup-plugin
DailyBackup_SSH:backup:INFO: PHASE END: Running pre backup plugin
DailyBackup_SSH:backup:INFO: PHASE START: Flushing logs
DailyBackup_SSH:backup:INFO: Flushing the logs
DailyBackup_SSH:backup:INFO: mysqladmin --user="mysql_backup_usr" --password="*****" --host="remote.mysql.net" flush-logs
DailyBackup_SSH:backup:INFO: Getting master logname using command mysql --user="mysql_backup_usr" --password="*****" --host="remote.mysql.net" -e "show master status"
DailyBackup_SSH:backup:INFO: PHASE END: Flushing logs
DailyBackup_SSH:backup:INFO: PHASE START: Creating logical backup
DailyBackup_SSH:backup:INFO: Command used for logical backup is mysqldump --opt --extended-insert --single-transaction --create-options --default-character-set=utf8 --user="mysql_backup_usr" --password="*****" --host="remote.mysql.net" sample student > "/var/lib/mysql-zrm/DailyBackup_SSH/20080905170240/backup.sql"
DailyBackup_SSH:backup:INFO: Logical backup done for the following table(s)
student
For the database: sample
DailyBackup_SSH:backup:INFO: logical-tables=student
logical-databases=sample
DailyBackup_SSH:backup:INFO: PHASE END: Creating logical backup
DailyBackup_SSH:backup:INFO: PHASE START: Calculating backup size & checksums
DailyBackup_SSH:backup:INFO: next-binlog=mysql-bin.000177
DailyBackup_SSH:backup:INFO: last-backup=/var/lib/mysql-zrm/DailyBackup_SSH/20080905170221
DailyBackup_SSH:backup:INFO: backup-size=0.00 MB
DailyBackup_SSH:backup:INFO: PHASE END: Calculating backup size & checksums
DailyBackup_SSH:backup:INFO: PHASE START: Compression/Encryption
DailyBackup_SSH:backup:INFO: Compressing Encrypting backup
DailyBackup_SSH:backup:INFO: Command used is 'tar --same-owner -cpsC "/var/lib/mysql-zrm/DailyBackup_SSH/20080905170240" --exclude=backup-data --exclude=index --exclude=zrm_checksum . 2>/tmp/KiRhIOdLPz | "/usr/bin/gzip" 2>/tmp/nGPE2HATke | "/usr/share/mysql-zrm/plugins/encrypt.pl" > "/var/lib/mysql-zrm/DailyBackup_SSH/20080905170240/backup-data" 2>/tmp/ZKLNk50tLq'
DailyBackup_SSH:backup:INFO: compress=/usr/bin/gzip
DailyBackup_SSH:backup:INFO: encrypt=/usr/share/mysql-zrm/plugins/encrypt.pl
DailyBackup_SSH:backup:INFO: decrypt-option=-d
DailyBackup_SSH:backup:INFO: backup-size-compressed=0.00 MB
DailyBackup_SSH:backup:INFO: Removing all of the uncompressed/unencrypted data
DailyBackup_SSH:backup:INFO: PHASE END: Compression/Encryption
DailyBackup_SSH:backup:INFO: read-locks-time=00:00:00
DailyBackup_SSH:backup:INFO: flush-logs-time=00:00:01
DailyBackup_SSH:backup:INFO: compress-encrypt-time=00:00:00
DailyBackup_SSH:backup:INFO: backup-time=00:00:01
DailyBackup_SSH:backup:INFO: backup-status=Backup succeeded
DailyBackup_SSH:backup:INFO: Backup succeeded
DailyBackup_SSH:backup:INFO: PHASE START: Running post backup plugin
DailyBackup_SSH:backup:INFO: Executing post-backup-plugin
DailyBackup_SSH:backup:INFO: PHASE END: Running post backup plugin
DailyBackup_SSH:backup:INFO: PHASE START: Mailing backup report
DailyBackup_SSH:backup:INFO: mailing file /tmp/0JTaGXVLBE
DailyBackup_SSH:backup:INFO: mail command is cat "/tmp/0JTaGXVLBE"|mail -s "[ZRM for MySQL Report] backup-set DailyBackup_SSH" root@localhost
DailyBackup_SSH:backup:INFO: PHASE END: Mailing backup report
DailyBackup_SSH:backup:INFO: PHASE START: Cleanup
DailyBackup_SSH:backup:INFO: PHASE END: Cleanup
DailyBackup_SSH:backup:INFO: END OF BACKUP
/usr/bin/mysql-zrm started successfully




Posting the backup-mode=raw in the next post since the content is exceeding the post limits..

mrigank.mishra
September 5th, 2008, 09:46 PM
The log for back-mode=raw is below:

backup:~ # mysql-zrm-scheduler --backup-set DailyBackup_SSH --backup-level 0 -now
schedule:INFO: ZRM for MySQL Community Edition - version 2.0
Logging to /var/log/mysql-zrm/mysql-zrm-scheduler.log
backup:INFO: ZRM for MySQL Community Edition - version 2.0
DailyBackup_SSH:backup:INFO: START OF BACKUP
DailyBackup_SSH:backup:INFO: PHASE START: Initialization
DailyBackup_SSH:backup:INFO: Mail address: root@localhost is ok
DailyBackup_SSH:backup:INFO: ZRM Temporary configuration file = /etc/mysql-zrm/DailyBackup_SSH/tmpayQD6.conf
DailyBackup_SSH:backup:INFO: {
DailyBackup_SSH:backup:INFO: verbose=1
DailyBackup_SSH:backup:INFO: encrypt-plugin=/usr/share/mysql-zrm/plugins/encrypt.pl
DailyBackup_SSH:backup:INFO: retention-policy=30D
DailyBackup_SSH:backup:INFO: decrypt-option=-d
DailyBackup_SSH:backup:INFO: password=******
DailyBackup_SSH:backup:INFO: tables=student
DailyBackup_SSH:backup:INFO: backup-mode=raw
DailyBackup_SSH:backup:INFO: compress-plugin=/usr/bin/gzip
DailyBackup_SSH:backup:INFO: user=mysql_backup_usr
DailyBackup_SSH:backup:INFO: copy-plugin=/usr/share/mysql-zrm/plugins/ssh-copy.pl
DailyBackup_SSH:backup:INFO: backup-level=0
DailyBackup_SSH:backup:INFO: quiet=0
DailyBackup_SSH:backup:INFO: encrypt=/usr/share/mysql-zrm/plugins/encrypt.pl
DailyBackup_SSH:backup:INFO: mailto=root@localhost
DailyBackup_SSH:backup:INFO: ssh-user=mysql
DailyBackup_SSH:backup:INFO: host=remote.mysql.net
DailyBackup_SSH:backup:INFO: database=sample
DailyBackup_SSH:backup:INFO: compress=/usr/bin/gzip
DailyBackup_SSH:backup:INFO: }
DailyBackup_SSH:backup:INFO: Getting mysql variables
DailyBackup_SSH:backup:INFO: mysqladmin --user="mysql_backup_usr" --password="*****" --host="remote.mysql.net" variables
DailyBackup_SSH:backup:INFO: datadir is /usr/local/mysql/var/
DailyBackup_SSH:backup:INFO: mysql_version is 5.0.67-log
DailyBackup_SSH:backup:INFO: InnoDB data file are /usr/local/mysql/var/ibdata1
DailyBackup_SSH:backup:INFO: InnoDB log dir is /usr/local/mysql/var/.
DailyBackup_SSH:backup:INFO: backup set being used is DailyBackup_SSH
DailyBackup_SSH:backup:INFO: backup-set=DailyBackup_SSH
DailyBackup_SSH:backup:INFO: backup-date=20080905170618
DailyBackup_SSH:backup:INFO: mysql-server-os=Linux/Unix
DailyBackup_SSH:backup:INFO: host=remote.mysql.net
DailyBackup_SSH:backup:INFO: backup-date-epoch=1220614578
DailyBackup_SSH:backup:INFO: retention-policy=30D
DailyBackup_SSH:backup:INFO: mysql-zrm-version=ZRM for MySQL Community Edition - version 2.0
DailyBackup_SSH:backup:INFO: mysql-version=5.0.67-log
DailyBackup_SSH:backup:INFO: backup-directory=/var/lib/mysql-zrm/DailyBackup_SSH/20080905170618
DailyBackup_SSH:backup:INFO: backup-level=0
DailyBackup_SSH:backup:INFO: backup-mode=raw
DailyBackup_SSH:backup:INFO: PHASE END: Initialization
DailyBackup_SSH:backup:INFO: PHASE START: Running pre backup plugin
DailyBackup_SSH:backup:INFO: Executing pre-backup-plugin
DailyBackup_SSH:backup:INFO: PHASE END: Running pre backup plugin
DailyBackup_SSH:backup:INFO: PHASE START: Flushing logs
DailyBackup_SSH:backup:INFO: Flushing the logs
DailyBackup_SSH:backup:INFO: mysqladmin --user="mysql_backup_usr" --password="*****" --host="remote.mysql.net" flush-logs
DailyBackup_SSH:backup:INFO: Getting master logname using command mysql --user="mysql_backup_usr" --password="*****" --host="remote.mysql.net" -e "show master status"
DailyBackup_SSH:backup:INFO: PHASE END: Flushing logs
DailyBackup_SSH:backup:INFO: Command used for getting engine type mysql --user="mysql_backup_usr" --password="*****" --host="remote.mysql.net" -e "show table status from \`sample\` like 'student'"
DailyBackup_SSH:backup:INFO: For database sample
DailyBackup_SSH:backup:INFO: and for table student
DailyBackup_SSH:backup:INFO: engine
DailyBackup_SSH:backup:INFO: MyISAM
DailyBackup_SSH:backup:INFO: PHASE START: Creating raw backup
DailyBackup_SSH:backup:INFO: Command used for raw backup is /usr/share/mysql-zrm/plugins/ssh-copy.pl --mysqlhotcopy --user="mysql_backup_usr" --password="*****" --host="remote.mysql.net" --quiet sample./^student$/ "/var/lib/mysql-zrm/DailyBackup_SSH/20080905170618" > /tmp/GAuBzDSRlT 2>&1
Password:
Password:
Password:
Password:
DailyBackup_SSH:backup:INFO: raw-tables=student
DailyBackup_SSH:backup:INFO: raw-databases=sample
DailyBackup_SSH:backup:INFO: PHASE END: Creating raw backup
DailyBackup_SSH:backup:INFO: PHASE START: Calculating backup size & checksums
DailyBackup_SSH:backup:INFO: next-binlog=mysql-bin.000181
DailyBackup_SSH:backup:INFO: last-backup=/var/lib/mysql-zrm/DailyBackup_SSH/20080905170543
DailyBackup_SSH:backup:INFO: backup-size=0.01 MB
DailyBackup_SSH:backup:INFO: PHASE END: Calculating backup size & checksums
DailyBackup_SSH:backup:INFO: PHASE START: Compression/Encryption
DailyBackup_SSH:backup:INFO: Compressing Encrypting backup
DailyBackup_SSH:backup:INFO: Command used is 'tar --same-owner -cpsC "/var/lib/mysql-zrm/DailyBackup_SSH/20080905170618" --exclude=backup-data --exclude=index --exclude=zrm_checksum . 2>/tmp/UnYLyAS99Q | "/usr/bin/gzip" 2>/tmp/2eYLRESPYt | "/usr/share/mysql-zrm/plugins/encrypt.pl" > "/var/lib/mysql-zrm/DailyBackup_SSH/20080905170618/backup-data" 2>/tmp/GAuBzDSRlT'
DailyBackup_SSH:backup:INFO: compress=/usr/bin/gzip
DailyBackup_SSH:backup:INFO: encrypt=/usr/share/mysql-zrm/plugins/encrypt.pl
DailyBackup_SSH:backup:INFO: decrypt-option=-d
DailyBackup_SSH:backup:INFO: backup-size-compressed=0.00 MB
DailyBackup_SSH:backup:INFO: Removing all of the uncompressed/unencrypted data
DailyBackup_SSH:backup:INFO: PHASE END: Compression/Encryption
DailyBackup_SSH:backup:INFO: read-locks-time=00:00:14
DailyBackup_SSH:backup:INFO: flush-logs-time=00:00:00
DailyBackup_SSH:backup:INFO: compress-encrypt-time=00:00:00
DailyBackup_SSH:backup:INFO: backup-time=00:00:14
DailyBackup_SSH:backup:INFO: backup-status=Backup succeeded
DailyBackup_SSH:backup:INFO: Backup succeeded
DailyBackup_SSH:backup:INFO: PHASE START: Running post backup plugin
DailyBackup_SSH:backup:INFO: Executing post-backup-plugin
DailyBackup_SSH:backup:INFO: PHASE END: Running post backup plugin
DailyBackup_SSH:backup:INFO: PHASE START: Mailing backup report
DailyBackup_SSH:backup:INFO: mailing file /tmp/23fD6hqjUN
DailyBackup_SSH:backup:INFO: mail command is cat "/tmp/23fD6hqjUN"|mail -s "[ZRM for MySQL Report] backup-set DailyBackup_SSH" root@localhost
DailyBackup_SSH:backup:INFO: PHASE END: Mailing backup report
DailyBackup_SSH:backup:INFO: PHASE START: Cleanup
DailyBackup_SSH:backup:INFO: PHASE END: Cleanup
DailyBackup_SSH:backup:INFO: END OF BACKUP
/usr/bin/mysql-zrm started successfully

kulkarni_mangesh
September 6th, 2008, 12:35 AM
This is expected and not a bug.

Normally we can perform perform backup of MySQL database by two ways in ZRM.

Logical.

Logical backup: Logical backup uses "mysqldump" utility to take a backup of MySQL database. This type of backup exports all data of target Database in the form of SQL statemets. So in summary when we perform Logical backup we don't need to do SSH to the MySQL server as we can dump all data of target database on ZRM server without actually log-in to the Database server.If backup succeeds, you can see "backup.sql" file present at the backup destination directory. This is plain ASCII text file, you can see the content of this file by using "cat, vi etc....."


Raw.

Raw backup: In case of raw backup, ZRM copies all Database related files physically on the ZRM server, hence it requires to login to MySQL Database server machine and copy the files to ZRM server. This is performed by two ways. One by using Socket copy and other by using SSH, hence it requires Socket copy OR SSH to be configured. If backup succeeds, you will find binary files at the backup destination direcotry. These files are similar to the files present at "mysql_datadir" on MySQL server.





As we have mentioned, to do passwordless authenticatrion in SSh, we need to export ssh keys from ZRM server to MySQL Database server for "mysql" user.

Hope we have cleared your doubts.