544 Part (Http web server) V . Advanced Performance When good
544 Part V . Advanced Performance When good replication goes bad Monitoring replication regularly, you may encounter errors. For example, an error occurred within in my replication set (as shown in Figure 18-13). I attempted to restart the replication by using the RESET SLAVE command but because the ecommerce database already exists, the replication failed. Behind the scenes, the RESET SLAVE statement tells the slave server to forget its position in the replication logs and start over. For updates and changes, this can cause replication to fail on that slave server. The slave server attempts to re-create the database or table or perform some other statement. However; a conflict exists thus the statement will fail. In an instance such as this, you must restart replication across your replication set. The procedure to use follows some of the same steps you took to start replication: 1. Stop the MySQL server on the master. 2. Take a snapshot of the data. 3. Start the MySQL server on the master. 4. Copy the snapshot of the data to the slaves. 5. Stop the slave server. 6. Move the snapshot data into the data directory on the slave. 7. Start the slave server. The master and slave(s) now have the same starting point for data and can begin replicating from that known good set of data. Kick-starting replication revealed As a replication best practice, I make one snapshot of data on the master and copy that to a separate location on the master server. Then, when I have to restart replication on one or more slave servers, I can simply take that snapshot from the beginning of the replication and copy it to the slave server. Restarting replication on the slave server with that known data and issuing a RESETSLAVEstatement causes the slave to play back the entire replication log from the beginning, thus catching up with the master server. 1. Copy the snapshot of the data to the slaves. 2. Stop the slave server.
You want to have a cheap webhost for your apache application, then check apache web hosting services.