ti**************@nvl.army.mil wrote:
Hi.
We're running mysql 4.1.2-alpha on a Redhat linux box. Every time we
have a power outage, or the machine shuts down w/o shutting down the
database, I always have the error
InnoDB: Unable to lock DATADIR/ibdata1 with lock 1, error: 11: fcntl:
Resource temporarily unavailable
(edited location of DATADIR to protect the innocent)
If I rename (or delete) the ib_data1, ib_logfile0, ib_logfile1 files,
then mysql recreates them and I'm up and running again. I don't seem to
be losing any data, as our databases are pretty static; mostly queries
after the tables are loaded.
Is this safe to do? What should I be doing?
Thanks.
I found a thread discussing this symptom at:
http://forums.mysql.com/read.php?22,...2344#msg-22344
It seems to happen regularly if the MySQL server host goes down, and the
MySQL data directory is on an NFS-mounted filesystem. It might be
specific to the Linux NFS implementation.
The ibdata1 file is the default file that contains all InnoDB tables and
indexes. If you don't use the InnoDB table storage type for any of your
databases, then clobbering this file is probably okay for now.
I recommend the better fix is to store your datadir on a local
filesystem, a drive physically local to the server running MySQL.
I always prefer to use a local datadir instead of NFS-mounted, for the
following reasons:
- Performance - a direct SCSI or ATA interface to the hard drive is
faster than a network;
- Reliability - the NFS host or the network could become unavailable or
congested;
- Data integrity - if another MySQL daemon tries to write to the same
datadir, it would be Very Bad.
Regards,
Bill K.