MySQL cluster

4 posts / 0 new
Last post
#1 Thu, 06/18/2009 - 07:03
David.Strejc

MySQL cluster

Is there any way how to setup MySQL to replicate all databases to my slave server?

Or shoul I write some post install scripts that will configure my master and slave databases to behave as cluster?

Thu, 06/18/2009 - 18:53
Joe
Joe's picture

Virtualmin has the ability to manage tables and users across multiple databases, for ndb_cluster tables, but it does not address replication at all, currently.

I was aware there was a good, established, standard for replication in MySQL. Is this feature available stock in any MySQL packages in mainstream distributions? If so, we could start work on providing more automation for this capability.

--

Check out the forum guidelines!

Fri, 06/19/2009 - 03:00
David.Strejc

I've found, that MySQL has ability to replicate one by one database in all distributions - I got FreeBSD and several years ago I've configured MySQL master and slave to do this. It is simple - just adding a line into my.cnf config and than run some replication rutine in mysql> shell. I think it is the same on every MySQL installation. So if you can only implement a option to replicate or not (defined in template of virtual server) it will be enough.

Sorry if you ment something else.

Fri, 06/19/2009 - 04:53
David.Strejc

It was my fault - I am lazy admin ;o)

It is very simple to setup whole MySQL replication through binary-log file.

on master just setup:

[mysqld]

server-id = 1

log-bin = $your_path_to_log

on slave:

[mysqld]

server-id = 2

master-host = $IP.A.D.D.R

master-user = $user

master-password = $pass

and on master grant acces to . to $user via:

grant all on . to '$user'@'$SLAVE.IP.ADD.R' identified by '$pass'

That is all magic. I've tested it and it works - creating and deleting databases etc. Keep attention on firewall and bind-address.

Now comes problem with crashes. I must setup my Joomla! installations to look for mysql on DNS record and switch that record to slave when master crashes. And turn slave into master.

Topic locked