LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-11-2009, 08:09 PM   #1
neoform
Member
 
Registered: Apr 2009
Posts: 41

Rep: Reputation: 15
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
 
Old 04-11-2009, 08:18 PM   #2
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
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.
 
Old 04-11-2009, 08:49 PM   #3
neoform
Member
 
Registered: Apr 2009
Posts: 41

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jstephens84 View Post
Then under your etc rc locate the mysql startup file and change the my.cnf file that is loaded.
That's just my problem though.. in the file /etc/rc.d/init.d/mysql there's no mention of the file my.cnf file anywhere..

 
Old 04-11-2009, 09:18 PM   #4
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by neoform View Post
That's just my problem though.. in the file /etc/rc.d/init.d/mysql there's no mention of the file my.cnf file anywhere..

the /etc/init.d and /etc/rc.d/init.d mysql is the binary. You actully want to look in inittab and find out your systems default runtime. Then find the file that has and S99 or K99 or something to that effect. That will be the loading script that contains the call to load mysql with the specified my.cnf file. what distro are you using for this?
 
Old 04-11-2009, 09:37 PM   #5
neoform
Member
 
Registered: Apr 2009
Posts: 41

Original Poster
Rep: Reputation: 15
I'm not sure I understand..
 
Old 04-11-2009, 10:02 PM   #6
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
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.
 
Old 04-11-2009, 10:33 PM   #7
neoform
Member
 
Registered: Apr 2009
Posts: 41

Original Poster
Rep: Reputation: 15
I'm using Fedora 10.
 
Old 04-12-2009, 05:29 AM   #8
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
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.
 
Old 04-12-2009, 10:43 AM   #9
neoform
Member
 
Registered: Apr 2009
Posts: 41

Original Poster
Rep: Reputation: 15
Thanks for the find..

I'm gonna have to read into mysqld_multi..
 
  


Reply

Tags
instances, lamp, linux, mysql, replication



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple instances of KMix replica9000 Linux - Software 2 02-18-2009 10:59 AM
Multiple instances tekmann33 Linux - Newbie 1 01-28-2008 03:05 PM
kickstart; how-to info needed for multiple instances of RH OS's and multiple unique v Joe_Wulf Linux - Server 4 06-21-2007 11:18 PM
Multiple Instances of MPlayer? Levitate Linux - Software 2 01-13-2005 12:04 PM
Multiple instances of same user justinv Linux - General 7 01-19-2003 04:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration