Enter the password and the host (the hostname of the master server or its IP Address).Now in PHPMyAdmin enter the username of the replication user you created in step 13.Stop and start your MySQL service on the slave server.Copy the line of code that shows your new server id and paste this entire line into the MySQL config file on your slave database server.Then click the link to configure this server as slave replication.From within PHPMyAdmin on the slave, click the replication tab.That’s all we need to do on the master server, now lets move over to the slave.On the privileges screen ensure the new user has both replication permissions checked and click “Go”.Create a user and password, set the host to “Any” and click “Go”.Lastly, we need to create a replication user so click on the link that says “Add slave replication user”.You will be redirected to the Replication screen which now looks like this.Once the service has restarted, click on “Go” on the PHPMyAdmin screen.Restart the MySQL services on the master server, leave PHPMyAdmin Open though.Copy and paste the code this screen provides into the very bottom of your MySQL config file (my.ini on Windows) AND add a line that says binlog_format=ROW (this fixes an error when running an external DB enrollment sync with replication).Select your Moodle database from the available list (see below).Select “Ignore all databases, replicate:”.Now click the link to configure this as the master server.Now, on your master database log in to PHPMyAdmin and click the Replication Tab.Take an SQL dump of your master database and restore it on your slave database.Your primary Moodle Database is referred to as the “master”, the replicated server will be referred to as the “slave”.You need 2 MySQL servers, each running a copy of PHPMyAdmin.( This is a long tutorial with many steps but I needed to make sure I didn’t miss any out, as it won’t work if you skip them) You will need basic MySQL skills to set this up and you need PHPMyAdmin installed on both of your database servers. So grab a cup of coffee (or tea if you’re British) and follow this tutorial to get replication up and running in less than an hour. So what would you tell your staff and students if you lost a full day of their work? You can’t tell tutors to mark their assignments again, or tell students to re-submit assignments, re-take quizzes and remember what they said in a forum. Not to mention forum posts, comments, messages, quiz attempts and pretty much everything else. However, what happens if your database fails at say 4pm in the afternoon and your last automated backup was 11:00pm the night before? Well potentially you have lost over a full days worth of data. Now in a busy college or school environment that could be a lot of assignment hand-ins, or tutor marks and feedback. Most organisations take nightly SQL dumps so if the database server fails they can simply restore from a complete backup. Replace = Log position from the master (ex.Let’s assume you have Moodle up and running and you are backing up your MySQL database on a regular basis, well what happens if your database server goes down, gets corrupt or your disk array melts? This is when you find out that your backup is only ever as good as when it was last taken. Configure server id, log file location and which databases are allowed to be replicated (pico /etc/mysql/my.cnf) Configure master to listen on all ip addresses (pico /etc/mysql/my.cnf)Ģ. You must have at least one master and one slave but you can use multiple slaves.ġ. In this tutorial we’ll create a simple one-way master/slave database replication. MySql database replication (master/slave) Ástþór IP
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |