PDA

View Full Version : Flush of logs failed



feed1
June 17th, 2008, 03:01 AM
When I try to backup one database from a remote MySQL server, I get the following situation:

<snip>
test1:backup:INFO: mysql-zrm-version=ZRM for MySQL Enterprise Edition - version 2.2
test1:backup:INFO: mysql-version=4.1.18-standard-log
test1:backup:INFO: backup-directory=/var/lib/mysql-zrm/test1/20080617123120
test1:backup:INFO: backup-level=0
test1:backup:INFO: backup-mode=logical
test1:backup:INFO: PHASE END: Initialization
test1:backup:INFO: PHASE START: Running pre backup plugin
test1:backup:INFO: Executing pre-backup-plugin
test1:backup:INFO: PHASE END: Running pre backup plugin
test1:backup:INFO: PHASE START: Flushing logs
test1:backup:INFO: Flushing the logs
test1:backup:INFO: "/usr/bin"/mysqladmin --user="backupuser" --password="*****" --host="xxx.xxx.xxx.xxx" --port="3306" flush-logs
test1:backup:ERROR: Flush of logs failed
test1:backup:INFO: PHASE START: Cleanup
test1:backup:INFO: backup-status=Backup failed
test1:backup:INFO: Backup failed
</snip>

Any ideas what might be the reason?

biju
June 17th, 2008, 04:04 AM
Please set "verbose=1" in your mysql-zrm.conf file and run the backup again. Then, please include your /var/log/mysql-zrm/mysql-zrm.log file so we can have a look. Thank you

feed1
June 17th, 2008, 04:17 AM
Ok, here is the log with verbose=1

Tue Jun 17 13:54:10 2008: test1:check:INFO: The quick backup-type is supported only for snapshot backups. Setting backup-type to 'regular'
Tue Jun 17 13:54:10 2008: test1:check:INFO: Mail address: xxx@xxx.xxx is ok
Tue Jun 17 13:54:10 2008: test1:check:INFO: Getting mysql variables
Tue Jun 17 13:54:10 2008: test1:check:INFO: "/usr/bin"/mysqladmin --user="backupuser" --password="*****" --host="xxx.xxx.xxx.xxx" --port="3306" variables
Tue Jun 17 13:54:10 2008: test1:check:INFO: datadir is /usr/local/mysql/data/
Tue Jun 17 13:54:10 2008: test1:check:INFO: mysql_version is 4.1.18-standard-log
Tue Jun 17 13:54:10 2008: test1:check:INFO: InnoDB data file are /usr/local/mysql/data/ibdata1
Tue Jun 17 13:54:10 2008: test1:check:INFO: InnoDB log dir is /usr/local/mysql/data/.
Tue Jun 17 13:54:10 2008: test1:check:INFO: License check successful
Tue Jun 17 13:54:10 2008: test1:check:INFO: Configuration check successful
Tue Jun 17 13:54:14 2008: test1:backup:INFO: START OF BACKUP
Tue Jun 17 13:54:14 2008: test1:backup:INFO: PHASE START: Initialization
Tue Jun 17 13:54:14 2008: test1:backup:INFO: The quick backup-type is supported only for snapshot backups. Setting backup-type to 'regular'
Tue Jun 17 13:54:14 2008: test1:backup:INFO: Mail address: xxx@xxx.xxx is ok
Tue Jun 17 13:54:14 2008: test1:backup:INFO: ZRM Temporary configuration file = /etc/mysql-zrm/test1/tmp8djpt.conf
Tue Jun 17 13:54:14 2008: test1:backup:INFO: {
Tue Jun 17 13:54:14 2008: test1:backup:INFO: quiet=0
Tue Jun 17 13:54:14 2008: test1:backup:INFO: retention-policy=7D
Tue Jun 17 13:54:14 2008: test1:backup:INFO: verbose=1
Tue Jun 17 13:54:14 2008: test1:backup:INFO: backup-level=0
Tue Jun 17 13:54:14 2008: test1:backup:INFO: mysql-binpath=/usr/bin
Tue Jun 17 13:54:14 2008: test1:backup:INFO: mailto=xxx@xxx.xxx
Tue Jun 17 13:54:14 2008: test1:backup:INFO: databases=xxxxx
Tue Jun 17 13:54:14 2008: test1:backup:INFO: port=3306
Tue Jun 17 13:54:14 2008: test1:backup:INFO: remote-mysql-binpath=/usr/local/mysql/bin
Tue Jun 17 13:54:14 2008: test1:backup:INFO: host=xxx.xxx.xxx.xxx
Tue Jun 17 13:54:14 2008: test1:backup:INFO: backup-mode=logical
Tue Jun 17 13:54:14 2008: test1:backup:INFO: password=******
Tue Jun 17 13:54:14 2008: test1:backup:INFO: backup-type=regular
Tue Jun 17 13:54:14 2008: test1:backup:INFO: user=backupuser
Tue Jun 17 13:54:14 2008: test1:backup:INFO: compress=
Tue Jun 17 13:54:14 2008: test1:backup:INFO: mysql-binlog-path=/urs/local/mysql/data
Tue Jun 17 13:54:14 2008: test1:backup:INFO: copy-plugin=/usr/share/mysql-zrm/plugins/ssh-copy.pl
Tue Jun 17 13:54:14 2008: test1:backup:INFO: }
Tue Jun 17 13:54:14 2008: test1:backup:INFO: Getting mysql variables
Tue Jun 17 13:54:14 2008: test1:backup:INFO: "/usr/bin"/mysqladmin --user="backupuser" --password="*****" --host="xxx.xxx.xxx.xxx" --port="3306" variables
Tue Jun 17 13:54:14 2008: test1:backup:INFO: datadir is /usr/local/mysql/data/
Tue Jun 17 13:54:14 2008: test1:backup:INFO: mysql_version is 4.1.18-standard-log
Tue Jun 17 13:54:14 2008: test1:backup:INFO: InnoDB data file are /usr/local/mysql/data/ibdata1
Tue Jun 17 13:54:14 2008: test1:backup:INFO: InnoDB log dir is /usr/local/mysql/data/.
Tue Jun 17 13:54:14 2008: test1:backup:INFO: License check successful
Tue Jun 17 13:54:14 2008: test1:backup:INFO: backup set being used is test1
Tue Jun 17 13:54:15 2008: test1:backup:INFO: backup-set=test1
Tue Jun 17 13:54:15 2008: test1:backup:INFO: backup-date=20080617135414
Tue Jun 17 13:54:15 2008: test1:backup:INFO: mysql-server-os=Linux/Unix
Tue Jun 17 13:54:15 2008: test1:backup:INFO: backup-type=regular
Tue Jun 17 13:54:15 2008: test1:backup:INFO: host=xxx.xxx.xxx.xxx
Tue Jun 17 13:54:15 2008: test1:backup:INFO: backup-date-epoch=1213700054
Tue Jun 17 13:54:15 2008: test1:backup:INFO: retention-policy=7D
Tue Jun 17 13:54:15 2008: test1:backup:INFO: mysql-zrm-version=ZRM for MySQL Enterprise Edition - version 2.2
Tue Jun 17 13:54:15 2008: test1:backup:INFO: mysql-version=4.1.18-standard-log
Tue Jun 17 13:54:15 2008: test1:backup:INFO: backup-directory=/var/lib/mysql-zrm/test1/20080617135414
Tue Jun 17 13:54:15 2008: test1:backup:INFO: backup-level=0
Tue Jun 17 13:54:15 2008: test1:backup:INFO: backup-mode=logical
Tue Jun 17 13:54:15 2008: test1:backup:INFO: PHASE END: Initialization
Tue Jun 17 13:54:15 2008: test1:backup:INFO: PHASE START: Running pre backup plugin
Tue Jun 17 13:54:15 2008: test1:backup:INFO: Executing pre-backup-plugin
Tue Jun 17 13:54:15 2008: test1:backup:INFO: PHASE END: Running pre backup plugin
Tue Jun 17 13:54:15 2008: test1:backup:INFO: PHASE START: Flushing logs
Tue Jun 17 13:54:15 2008: test1:backup:INFO: Flushing the logs
Tue Jun 17 13:54:15 2008: test1:backup:INFO: "/usr/bin"/mysqladmin --user="backupuser" --password="*****" --host="xxx.xxx.xxx.xxx" --port="3306" flush-logs
Tue Jun 17 13:54:15 2008: test1:backup:ERROR: Flush of logs failed
Tue Jun 17 13:54:15 2008: test1:backup:INFO: PHASE START: Cleanup
Tue Jun 17 13:54:15 2008: test1:backup:INFO: backup-status=Backup failed
Tue Jun 17 13:54:15 2008: test1:backup:INFO: Backup failed
Tue Jun 17 13:54:15 2008: test1:backup:INFO: mailing file /tmp/TQJ7Rlh5Tc
Tue Jun 17 13:54:15 2008: test1:backup:INFO: mail command is cat "/tmp/TQJ7Rlh5Tc"|mail -s "[ZRM for MySQL Report] ERROR during backup of backup-set test1" xxx@xxx.xxx
Tue Jun 17 13:54:15 2008: test1:backup:INFO: PHASE END: Cleanup
Tue Jun 17 13:54:15 2008: test1:backup:INFO: END OF BACKUP

biju
June 17th, 2008, 04:44 AM
Please check Give Privileges for "backup-user" to connect from remote host
mysql> GRANT LOCK TABLES, SELECT, FILE, CREATE, DROP, INDEX, SHUTDOWN, ALTER, INSERT, ALTER ROUTINE,CREATE ROUTINE, SUPER, RELOAD ON *.* TO 'backup-user'@'remote host' IDENTIFIED BY 'password';

feed1
June 17th, 2008, 05:00 AM
Privileges are ok. When I tried to run the mysqladmin flush-logs command directly from the server where ZRM is installed I got following error:

mysqladmin: refresh failed; error: 'Unknown error'

feed1
June 18th, 2008, 01:35 AM
It was about privileges, I hadn't flushed privileges... After I flushed privileges the backup runs ok.

Thanks for your efforts!

parames
May 27th, 2010, 12:23 AM
I had the same problem as above and i grant the permissions and flush privileges as well. But no luck.

Is it required to enable the log-bin on the mysql server.

Please advice

futbolsalas15
November 2nd, 2012, 01:33 PM
Well, I had the same problem. The solution in my case was change the path where the log files was generated in my.cnf.
For example, I had the following location:

log_error = /var/log/mysql-error.log
slow_query_log_file = /var/log/mysql-slow.log

And I changed to the following location

log_error = /var/log/mysql/mysql-error.log
slow_query_log_file = /var/log/mysql/mysql-slow.log

I have installed MySQL Server 5.5.24 on Ubuntu Server.

Hope it helps.