Master/Slave Database [Deleted]

What is the purpose of having master and slave database?
I'm sorry for this newbie question.

Is this the same as replicating same data from the maser database?
Or just sync two different database server from new data (threads/post/comments/) ?
 
If my master server is using mariadb then my slave server must be using mariadb also?
Or any mysql distru will do?
Like percona.
You probably could use different forks/versions, but not sure why you would want to. Probably would want to check the documentation of whatever you are using to make sure... It's just normal MySQL replication that's used.
 
  • Like
Reactions: rdn
So recommended to have closely the same server specs where you have the master and slave?
Or it's fine if I have less server specs on the slave?
 
I'd say close would be ideal. Might just want to Google the best master/slave setup for your MySQL fork/version. Setting up your DB servers is more a question for your DB administrator since it's going to be specific to your hardware, site traffic, etc.
 
  • Like
Reactions: rdn
Interesting.....
Have you considered implementing a system to disallow write actions on the forums when the master goes down?
That way you can have a truly redundant XenForo setup.
 
Interesting.....
Have you considered implementing a system to disallow write actions on the forums when the master goes down?
That way you can have a truly redundant XenForo setup.
Nah... if people want to change their master server, it really should be handled at the server level, not the application level.

Also, tossing the system into read-only mode definitely is not a redundant setup. :)

If you want a truly redundant setup, you would be using something like MySQL Cluster (every node is fully write capable):

To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.

MySQL Cluster is actually what I use now for my site.
 
Nah... if people want to change their master server, it really should be handled at the server level, not the application level.

Also, tossing the system into read-only mode definitely is not a redundant setup. :)

If you want a truly redundant setup, you would be using something like MySQL Cluster (every node is fully write capable):

To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.

MySQL Cluster is actually what I use now for my site.
Won't every node being write capable lead to a tonne of race conditions, similar to why you need to stick requests using this addon?

EDIT: Also, how are you managing XenForo connecting to this cluster? HAProxy?
 
Won't every node being write capable lead to a tonne of race conditions, similar to why you need to stick requests using this addon?
Nope, MySQL Cluster is designed to do be fully write capable on all nodes (with full ACID compliance).

EDIT: Also, how are you managing XenForo connecting to this cluster? HAProxy?
There is a SQL node on every web server, so the MySQL IP/hostname is just "localhost". If there's a PHP fatal error of any sort (including being unable to connect to the DB server), Nginx routes around it and just automatically tries again on a different PHP-FPM server.
 
Nope, MySQL Cluster is designed to do be fully write capable on all nodes (with full ACID compliance). There is a SQL node on every web server, so the MySQL IP/hostname is just "localhost". If there's a PHP fatal error of any sort (including being unable to connect to the DB server), Nginx routes around it and just automatically tries again on a different PHP-FPM server.
Nope, MySQL Cluster is designed to do be fully write capable on all nodes (with full ACID compliance). There is a SQL node on every web server, so the MySQL IP/hostname is just "localhost". If there's a PHP fatal error of any sort (including being unable to connect to the DB server), Nginx routes around it and just automatically tries again on a different PHP-FPM server.
I must then ask how you personally handle the data and internal_data directories.
 
Is this still being maintained?
Yep... just hasn't needed anything lately... still working fine with the latest versions of XenForo.

And not a whole lot of new features you can really do with something like this... it either works or it doesn't for the most part. :)
 
I haven't tried it myself since I haven't upgraded to 1.5, but there's no reason it shouldn't. I also haven't heard any issues from sites using it with 1.5, so...
 
Many connections still connect to master (select queries)

I add
$this->_force_master = null;
after $this->_force_master = @(int)$_COOKIE['xf_fm'];

so the code will be as follow

$this->_force_master = @(int)$_COOKIE['xf_fm'];
$this->_force_master = null;

The problem is solved :D
movie torrents
 
Last edited:
Top Bottom