View previous topic :: View next topic |
Author |
Message |
kashani Advocate
Joined: 02 Sep 2002 Posts: 2032 Location: San Francisco
|
Posted: Thu Oct 28, 2004 10:11 pm Post subject: Trying to run multiple Mysql servers on a single machine |
|
|
I'm building a nice little database backup machine for a number of my database server. Since Mysql can only have one master I need to run three or four separate Mysql servers, not threads or processes, but actual separate servers. Each Mysql server on the backup machine will have a different master so I can replicate each production database to a single machine.
Ideally the would each run on a different port 3306, 3307, etc and have data in different dirs like /var/lib/mysql, /var/lib/mysql2, etc.
Unfortunately it appears that the ebuild hardcodes a number of things into the binary or I haven't found the right config setting to get two instances running at the same time. I'd prefer to handling everything via separate configs and not have to recompile mysql a number of times. Something like this:
cp -a /var/lib/mysql/ /var/lib/mysql2/
cp -a /var/log/mysql/ /var/log/mysql2
cp -a /var/run/mysqld/ /var/run/mysqld2/
cp -a /etc/mysql/ /etc/mysql2/
and then editting config files as needed. Has anyone done something like this? Or am I going to have to mess with the ebuild and install in /usr/local/mysql1, /usr/local/mysql2, and so on?
kashani _________________ Will personally fix your server in exchange for motorcycle related shop tools in good shape. |
|
Back to top |
|
|
hds Advocate
Joined: 21 Aug 2004 Posts: 2629 Location: Sprockhoevel [GER]
|
Posted: Thu Oct 28, 2004 10:22 pm Post subject: Re: Trying to run multiple Mysql servers on a single machine |
|
|
kashani wrote: | Or am I going to have to mess with the ebuild and install in /usr/local/mysql1, /usr/local/mysql2, and so on?
|
thats what i would do, but i wouldnt use the ebuild then, i would compile from the source tarball and use different --prefix parameters. |
|
Back to top |
|
|
kashani Advocate
Joined: 02 Sep 2002 Posts: 2032 Location: San Francisco
|
Posted: Fri Oct 29, 2004 2:26 pm Post subject: |
|
|
It's actually not that hard to do from the ebuild, but you have to be careful. Assuming I'm stuck doing it that way, I imagine this might work.
1. uninstall mysql
2. modify the ebuild to use ../mysql5/, run the emerge
3. modify the ebuild to use ../mysql4/, run the emerge
...
6. run sync again, emerge mysql
This worked for qmail when I needed multiple instances, though mysql src isn't near the mess qmail is with the 10 odd patches I would have manually had to apply. Hmmm, well I guess I know how I'm burning the next few hours.
kashani _________________ Will personally fix your server in exchange for motorcycle related shop tools in good shape. |
|
Back to top |
|
|
EnricoHorn Apprentice
Joined: 23 Apr 2003 Posts: 165 Location: Koenigsee, Thuringia, Germany
|
Posted: Fri Oct 29, 2004 7:26 pm Post subject: |
|
|
Did you look at mysqld_multi? Did not try it, but seems a possible solution. |
|
Back to top |
|
|
hds Advocate
Joined: 21 Aug 2004 Posts: 2629 Location: Sprockhoevel [GER]
|
Posted: Sun Oct 31, 2004 9:51 pm Post subject: |
|
|
kashani wrote: | It's actually not that hard to do from the ebuild |
it is - on the long run.
imagine "-u world".. how are you going to handle that one? well, you would have to inject the package, perhaps, though..
i am still unsure what happens if you inject a package (mplayer in my case - of course). sofar this works out nice, but infact a new version gets marked stable, what will happen then?
thats why i would not use the ebuild.
what i did (with mplayer, just as an example) was emerging it, just to make sure it does every dependency. then i unmerged it using "-C" and installed it from source.
this makes sure portage does not complain about it in the future.
yes, portage is nice, but i dislike to have it takeing care for me about everything ;( |
|
Back to top |
|
|
kashani Advocate
Joined: 02 Sep 2002 Posts: 2032 Location: San Francisco
|
Posted: Mon Nov 01, 2004 4:21 pm Post subject: |
|
|
You're assuming I'd touch Mysql again on this box. If I were to get everything to work at any point, I'm slapping a package.mask in and never touching Mysql again. Since it's internal only and just needs to run Mysql reasonably well, doing an emerge -u world is just asking for trouble.
mysqld_multi looks exactly like what I want, but I can't figure out how to make it work. All the config examples are the same and using them doesn't appear to actually do anything on my system. Oddly I can't find anyone who actually seems to be using it.
kashani _________________ Will personally fix your server in exchange for motorcycle related shop tools in good shape. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|