MySQL replication questions before I go ahead

Maximus

Well-Known Member
Joined
Apr 13, 2004
Messages
209
Reaction score
0
Location
.
Hi guys,

I'm about to configure replication on an existing and fast growing database and have some questions before I proceed.

I am planning to stop all services including the mysql daemon and then to directly copy the database to my replication slave server. Doing a mysqldump and restore on the slave side is going to take too long hence my reason for wanting to copy the database files across. The database is around 6GB in size (main table has over 30 million records and growing by ~500,000 per day), I also can't afford hours of downtime on the Master server.

I have recently converted all the tables in the database to InnoDB to make things a bit easier.

Question 1:
Is it correct that I copy all the files under: /var/lib/mysql/mydbname/
as well as the /var/lib/mysql/ibdata1 file to the slave server? (Note: I have no other databases using InnoDB on the server)

Question 2:
Which TCP port should I open up on the firewall so that Slave can communicate with the Master?

Question 3:
I'm guessing that only after the database is copied to the slave server do I then start up the Master MySQL daemon again, get the locks on the Master database and then get the binary log coordinates? The reason why I am asking is that I want to stop the MySQL daemon before copying the files so that there are no read/write access to the files while the copy is in progress, so locking the database beforehand doesn't make sense as the MySQL daemon won't be running anyway.

Any help will be greatly appreciated!
 
Top
Sign up to the MyBroadband newsletter
X