Multiple Instances of MySQL
I'm trying to setup 2 instances of mysql on one machine (Replication of 2 machines, so I can back them up without shutting them down)..
But I can't figure out where in the daemon file the my.cnf file is assigned.. I've already got two copies of my.cnf, two log dirs, two data dirs and I've set up separate daemon files... in /etc/rc.d/init.d/ but after searching through them, I can't figure out where I can assign the conf file... Anyone know? Thanks |
Ok so after looking at the mysql site it looks like you need to specify two cnf files. like my1.cnf and my2.cnf. Then under your etc rc locate the mysql startup file and change the my.cnf file that is loaded. Now each mysql file will need to have different ports , sockets, pid-files, and shared memory base names.
|
Quote:
:( |
Quote:
|
I'm not sure I understand..
|
Ok I think I did get a little confusing on my last post. In short what you are actually looking at is the binary file. Not the script that calls the binary. Also the binary will look for the default my.cnf file. As far as I know. So what you will want is a script that calls the mysqld binary and uses a parameter that specifies which my.cnf file to use.
Can you post what distro you are using? That way I can tell how bootup scripts are called. Also check for things like /etc/rc2.d or /etc/rc.d/rc2 or 3. Under those directories try looking for a mysql script in there. That is what should be specifing what .cnf file is being called. |
I'm using Fedora 10.
|
Ok so further digging led me to here. http://dev.mysql.com/doc/refman/4.1/...qld-multi.html It looks like you will still use the same my.cnf file but specify the multiple instances in your my.cnf file. IE
[mysql0] at the bottom of the page there looks like a good example of a my.cnf file for reference. Hope this clears up a little bit. |
Thanks for the find..
I'm gonna have to read into mysqld_multi.. :) |
All times are GMT -5. The time now is 09:57 PM. |