innobackupex failed (File ./ib_logfile0: 'open' returned OS error 71.)

Hi,
I tried to backup my currently running mysql server using the following command:


innobackupex --user=root --password=password /root/percona-backup/

It failed with the following error:


xtrabackup: using O_DIRECT
2014-02-16 03:49:05 7fec9403c720 InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: File ./ib_logfile0: 'open' returned OS error 71. Cannot continue operation
innobackupex: Error: The xtrabackup child process has died at /usr/bin/innobackupex line 2642.

Could anyone please help me with this error?

Thanks

what version of percona xtrabackup you are using ? Can you please post contents of my.cnf.


[root@mirror ~]# xtrabackup -v
xtrabackup version 2.1.7 for Percona Server 5.1.73 unknown-linux-gnu (x86_64) (revision id: 721)


[root@mirror ~]# cat /etc/my.cnf
[mysqld]
# Replication Configs, please do not change
innodb-file-per-table=1
server-id=2
log-bin=mysql-bin
innodb-flush-method=O_DIRECT
max_allowed_packet=52M
innodb-thread-concurrency=0
default-storage-engine=innodb
## end of replication settings
max_connections = 2000
tmp_table_size=512M
max_heap_table_size=512M
thread_cache_size = 4
#table_cache = 256
innodb_buffer_pool_size = 4G
#long_query_time=20
#log_slow_queries=ON
#slow_query_log_file ='/var/log/mysql/slow-query.log'
#log_queries_not_using_indexes=OFF
query_cache_limit=2M
query_cache_size=64M
join_buffer_size=64M
#table_cache=256
#connect_timeout=60
#wait_timeout=120

Hamed,

I had same problem. Found out that in my case the ownership and permissions on /etc/my.cnf were incorrect. After changing to
-rw-r----- mysql root /etc/my.cnf
the innobackupex worked without error. Hope this helps your install.

-dale

Thanks for the reply,
I’ve found the problem.
I should add the following line to my.cnf:

datadir=/var/lib/mysql/

Mine wasn’t working even after checking the my.cnf file permissions and datadir in the [mysqld] section of configuration file. I added the following different section to make it work. Hope it helps :slight_smile:

[xtrabackup]
datadir = /var/lib/mysql