Bhartendu Maheshwari <[EMAIL PROTECTED]> wrote on 07/12/2003
07:56:26:


> I am doing some work in High Availabilty. We have two real servers(just
> 2 PC's) and we want the both PC to run MySQL but uses one common
> database data file. We have one NAS server, we will keep all the data
> file there and mount it on local system and try the MySQL, things are
> half way done I mean I am able to access the data files, table and now
> its data too but the problem its not writing in file at the same time
> and there are some problem in closing the files.
>
> When I checking the table using 'myisamchk' it show the below results:-
>
>
*****************************************************************************

> Checking MyISAM file: pi_dispatcher.MYI
> Data records:       3   Deleted blocks:       0
> myisamchk: warning: 1 clients is using or hasn't closed the table
> properly
> - check file-size
> - check key delete-chain
> - check record delete-chain
> - check index reference
> MyISAM-table 'pi_dispatcher.MYI' is usable but should be fixed
>
*****************************************************************************

>
> My problem is I want the MySQL will write all the data in the file after
> every command and close the files properly, nothing in buffers and
> cache. How can we do that, I tried with --flush but its not helping
> much, is there any good options?

You can force MySQL to flush its tables to disk with FLUSH TABLES.
However, this would, I think, cripple performance. I really don't think
MySQL is designed to work this way. The database files are intended to be
accessed only by one program. This is what myisamchk is telling you -
another program is using the tale it is trying to check, which means that
it may well be invalid.

What I think you need, and what I use for this same purpose, is
replication. This means that you not only have two MySQL's running, but you
have two copies of the data on different disks. Since I have two copies of
the data, I don't bother to RAID it, which cuts costs back down to nearly
the same as doing it with a single block of high-availability disks. There
is the further advantage (which I haven't exploited yet) that, which all
queries must go through the master, selects can go to the slave(s).

Alec


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to