Re: running multiple mysqld's

2001-06-11 Thread Kyle Hayes

On Friday 08 June 2001 22:16, Rohit Peyyeti wrote:

  Hello All:

 I have two mysqld runnning in ports: 3307  3308 respectively. I started
 the second one by using 'mysqld_multi start 2'. whereas mysqld running on
 port 3307 is the default mysqld started at the boot time.

 when i issue command such as:
 mysql -u root -p (it connects to my new mysqld running on 3307). Why is
 that it won't connect to mysqld running on port 3308. I also tried giving
 in port / socket options to mysql but to no luck!

 I cannot connect to mysqld running on port 3307 (default mysqld which
 is started at boot time)

(anti-s_p_a_m_b_o_t fodder: database, query)

MySQL runs with two methods of connection.  The first is via Unix sockets 
(assuming that you are using Linux here).  The second is via Internet 
sockets.  The port numbers you have above apply only to Internet sockets. You 
should see two instances of MySQL running if you connect from a different 
machine.

If you connect on the machine which is running the two instances, you'll need 
to specify host and port, or you'll need to make sure that the Unix sockets 
are in different places.

For each instance, make sure that the default Unix socket location (usually 
something like /var/lib/mysql/mysql.sock or /tmp/mysql.sock) is different!  
MySQL will happily run with two instances using the same Unix socket.  
Unfortunately, your results may not be what you want.

We run multiple instances all the time.  The hard part is not configuring 
MySQL, it is getting the clients to talk to the right one :-)

We set up a main directory where all the instances have subdirectories.  You 
could use something like /databases.  Put each instance into a subdirectory.  
We put the logs, Unix socket, pid file, configuration file and databases into 
directories of the main subdirectory:

/database/instance1/etc/my.cnf  config file
/database/instance1/log/... log files
/database/instance1/run/mysql.pid   pid file
/database/instance1/run/mysql.sock  Unix socket
/database/instance1/db_files/...database table files

/database/instance2/etc/my.cnf  config file
... etc...

Then, if we are on the same machine and need to connect with the MySQL 
command-line client, we can just type this:

$ mysql --defaults-file=/database/instance1/etc/my.cnf -u root -p...

You could easily make wrapper scripts to make this easier:

$ mysql_wrapper --instance=1 -uroot -p ...

We run multiple instances for several reasons.  The primary reason is that we 
need to take some down on a nightly basis for various purposes and others 
need to stay up.  We cannot do this with a single instance.  We can also 
control resource usage on a per-type-of-use basis.  Some instances just 
perform dumb data logging, others are used for heavy queries.

Best,
Kyle


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: running multiple mysqld's

2001-06-09 Thread Jaime Teng

Running two copies of mysqld in one single machine *HAS* its purpose.

What if, for whatever reason, mysqld died?

I personally havent seen mysqld died on me, but on a rare occasion,
the database got corrupted and it made mysql useless.

but if I made my application to be a bit more intelligent and either
communicate with two mysqld or use a backup database file you
know what i mean.

jaime


At 03:02 AM 6/9/01 -0230, Neil Zanella wrote:

Sorry about this questions but why would you want to run two copies of
mysqld when it is capable of hosting as many different databases as
you need? Even if you needed two databases with the same name you
could still just create two different MySQL users for it.

Thanks,

Neil

On Sat, 9 Jun 2001, Rohit Peyyeti wrote:


 Hello All:

 I have two mysqld runnning in ports: 3307  3308 respectively. I started
the
 second one by using 'mysqld_multi start 2'. whereas mysqld running on
 port 3307 is the default mysqld started at the boot time.

 when i issue command such as:
 mysql -u root -p (it connects to my new mysqld running on 3307). Why is
 that it won't connect to mysqld running on port 3308. I also tried
giving in
 port / socket options to mysql but to no luck!

 I cannot connect to mysqld running on port 3307 (default mysqld which
 is started at boot time)

 Can any one help here?

 ...Rohit






-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: running multiple mysqld's

2001-06-09 Thread Joseph Bueno

Neil Zanella wrote:
 
 Sorry about this questions but why would you want to run two copies of
 mysqld when it is capable of hosting as many different databases as
 you need? Even if you needed two databases with the same name you
 could still just create two different MySQL users for it.
 
 Thanks,
 

Hi,

I see several reasons for that:

- mysqld is a multithreaded single process. That meens it cannot use
  more than 4Gb of RAM on 32 bits OS (and if fact much less, 2G to 3.5Gb
  depending on OS configuration). Since you can have highend Intel
  servers with more than 4Gb of RAM, you will make much better use
  of your RAM with multiple mysqld instances.

- If you want to have a very high number of simultaneous connections,
  you must have several mysqld running. For instance, mysqld on Linux is
  limited to ~1500 simultaneous connections; if you want more, you have
  to use several mysqld. (Of course, you can do that only if all your
  clients don't use the same database).

- Minimising MySQL downtime: Each time one mysqld process crashes, you
  just have to repair the databases it was managing. For instance, if
  you have 4 databases served by 4 mysqld, you just repair one database
  instead of 4 before restarting. (Please no flames here, I know that
  MySQL is considered as very stable; however, it sometimes crashes:
  there were several reports of mysqld killed by signal 11 on this list)   

Of course, most MySQL users don't need to run more than one mysqld, but you
asked, so here are some reasons.

Regards 
--
Joseph Bueno
NetClub/Trader.com

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: running multiple mysqld's

2001-06-08 Thread Neil Zanella


Sorry about this questions but why would you want to run two copies of
mysqld when it is capable of hosting as many different databases as
you need? Even if you needed two databases with the same name you
could still just create two different MySQL users for it.

Thanks,

Neil

On Sat, 9 Jun 2001, Rohit Peyyeti wrote:


 Hello All:

 I have two mysqld runnning in ports: 3307  3308 respectively. I started the
 second one by using 'mysqld_multi start 2'. whereas mysqld running on
 port 3307 is the default mysqld started at the boot time.

 when i issue command such as:
 mysql -u root -p (it connects to my new mysqld running on 3307). Why is
 that it won't connect to mysqld running on port 3308. I also tried giving in
 port / socket options to mysql but to no luck!

 I cannot connect to mysqld running on port 3307 (default mysqld which
 is started at boot time)

 Can any one help here?

 ...Rohit






-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php