Re: 2 x Mysql + shared storage SAN - R/W question

2008-03-07 Thread Joerg Bruehe

Hi Mihai, all !


Mihai Tanasescu wrote:

Hello all,


I have a quite silly question I guess but it's been bugging me up recently.


A client has just acquired a SAN for his servers.
Between these servers he also has 2 mysql ones.

What would happen if I were to define a single shared disk on the SAN
and I place both Mysqls to work in the same directory on the SAN ?


If you do just this:
You would be asking for trouble - and you would get it.

(Assuming your operating systems can handle this - an operating system 
managing a file system, space allocation etc, has similar issues as a 
DBMS managing its data.)


What would be the purpose of such a setup ?
The MySQL way to use multiple machines is scale out, which means you 
split your data across the servers (typically by application), or 
replication (master/slave setup).





[[...]]

Please explain if you had a similar curiosity in the past or
experimented (either with SAN, NFS, Group Filesystem, etc and same
installation/working directory for several Mysql instances)


The key to database performance is caching:
You want to reduce disk accesses, and would like to never wait for them 
(read ahead into cache, write behind).
This goal is limited by your needs for stable storage (committed 
transactions must be logged, so that they can be reconstructed) if you 
use a transaction-oriented handler, but it is still a goal.


So you would love if your server could answer all queries from its 
cache, and just write the changes to disk at some convenient time.


If two servers follow this approach on a shared disk, ...
Figure yourself !


The only way to avoid such trouble would be to have servers which are 
aware of the situation and then add cross-server synchronization 
mechanisms to solve (or prevent) any conflicts.
MySQL of course does this for parallel threads within the same server 
instance, but (by default) not across machines.

MySQL *can* do this if instructed, but that includes performance costs:
http://dev.mysql.com/doc/refman/5.0/en/external-locking.html

If you are aiming at increased availability, you can install MySQL 
servers on two machines and point them at shared data, but you would 
need some mechanism (heartbeat) that prevents them from being active 
simultaneously (failover, primary/backup).



Jörg

--
Joerg Bruehe, Senior Production Engineer
MySQL AB, www.mysql.com


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



Re: 2 x Mysql + shared storage SAN - R/W question

2008-03-07 Thread Mihai Tanasescu

Joerg Bruehe wrote:

Hi Mihai, all !


Mihai Tanasescu wrote:

Hello all,


I have a quite silly question I guess but it's been bugging me up 
recently.



A client has just acquired a SAN for his servers.
Between these servers he also has 2 mysql ones.

What would happen if I were to define a single shared disk on the SAN
and I place both Mysqls to work in the same directory on the SAN ?


If you do just this:
You would be asking for trouble - and you would get it.

(Assuming your operating systems can handle this - an operating system 
managing a file system, space allocation etc, has similar issues as a 
DBMS managing its data.)


What would be the purpose of such a setup ?
The MySQL way to use multiple machines is scale out, which means you 
split your data across the servers (typically by application), or 
replication (master/slave setup).





[[...]]

Please explain if you had a similar curiosity in the past or
experimented (either with SAN, NFS, Group Filesystem, etc and same
installation/working directory for several Mysql instances)


The key to database performance is caching:
You want to reduce disk accesses, and would like to never wait for 
them (read ahead into cache, write behind).
This goal is limited by your needs for stable storage (committed 
transactions must be logged, so that they can be reconstructed) if you 
use a transaction-oriented handler, but it is still a goal.


So you would love if your server could answer all queries from its 
cache, and just write the changes to disk at some convenient time.


If two servers follow this approach on a shared disk, ...
Figure yourself !


The only way to avoid such trouble would be to have servers which are 
aware of the situation and then add cross-server synchronization 
mechanisms to solve (or prevent) any conflicts.
MySQL of course does this for parallel threads within the same server 
instance, but (by default) not across machines.

MySQL *can* do this if instructed, but that includes performance costs:
http://dev.mysql.com/doc/refman/5.0/en/external-locking.html

If you are aiming at increased availability, you can install MySQL 
servers on two machines and point them at shared data, but you would 
need some mechanism (heartbeat) that prevents them from being active 
simultaneously (failover, primary/backup).



Jörg



Hello all,



Thank you for the help and explanations.


You're really great.


-
Mihai


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



Re: table lock

2008-03-07 Thread Raj Shekhar
Eli Shemer wrote:

  
 
 The web site on the other end reads all the data from the table and
 generates standard html/css code with the information from the table.

 How can I make all of the apache child processes wait for the external
 script to complete its operation once it has started?

Alternatively,

Create  a new table which has similar table definition as the one to which
your script is writing the data.  
'
CREATE TABLE new_tbl LIKE orig_tbl;
'

populate new_tbl with your data and then rename it to orig_tbl - 'rename
table new_tbl to orig_tbl'  (rename is atomic operation)




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



DBDesigner 4 and MySQL

2008-03-07 Thread Jørn Dahl-Stamnes
Hello,

This my be a bit off-topic...

I installed DBDesigner 4 and tried to connect to two of my MySQL servers, one 
running 4.1 and one running 5.1.

But no mather what I try, it failes to connect. The servers are behind a 
firewall and I can see that when trying to connect to the 4.1 server, my 
client do send a tcp-package to the server. But when client tries to connect 
to the 5.1 server, there is no tcp packages comming from the client.

On both servers I have issues a

GRANT ALL ON *.* TO 'username'@'client.hostname' identified by 'some 
password';
flush privileges;

DBDesigner claim that the user/password is invalid.

Any idea what can be wrong?

I whish to do a reverse engineering on a big database in order to save time 
making the visual design in DBDesigner.

-- 
Jørn Dahl-Stamnes
homepage: http://www.dahl-stamnes.net/dahls/

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



Comma's in data?

2008-03-07 Thread J. Todd Slack
Hi All,

I have a client that wants to insert data into a VarChar field that contains
commas. These are property addresses.

Example:
2966 Moorpark Ave, San Jose, CA, 95128

1 Infinite Loop, Cupertino, CA, 95

How can I allow this?

Thanks!
-Jason