Last edited 08/18/2010
This tutorial describes how to set up database replication in MySQL using an SSL connection for encryption (to make it impossible for hackers to sniff out passwords and data transferred between the master and slave). MySQL replication allows you to have an exact copy of a database from a master server on another server (slave), and all updates to the database on the master server are immediately replicated to the database on the slave server so that both databases are in sync. This is not a backup policy because an accidentally issued DELETE command will also be carried out on the slave; but replication can help protect against hardware failures though.
I do not issue any guarantee that this will work for you!
1 Preliminary Note
In this tutorial I will show how to replicate the database exampledb from the server server1.example.com (master) with the IP address 192.168.0.100 to the server server2.example.com (slave) with the IP address 192.168.0.101. Both systems are running Debian Lenny; however, the configuration should apply to almost all distributions with little or no modifications. The database exampledb with tables and data is already existing on the master, but not on the slave.
I'm running all the steps in this tutorial with root privileges, so make sure you're logged in as root.
2 Installing MySQL 5 And Enabling SSL Support
If MySQL 5 isn't already installed on server1 and server2, install it now:
server1/server2:aptitude install mysql-server mysql-clientYou will be asked to provide a password for the MySQL root user - this password is valid for the user root
No comments:
Post a Comment