Continuent Developer Community
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Migrating from native mysql replication (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Migrating from native mysql replication
#639
Chris Beauchamp (User)
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
Migrating from native mysql replication 5 Months, 3 Weeks ago Karma: 0  
We've currently got native MySQL replication running, but would like to migrate to Tungsten. This of course means that we've got good replica copies available for the slaves, but is it possible to use these, and setup replication without bringing down the master? Where does the replicator start in the binary logs? From the start of the logs? Is is possible to tell the master where to continue from, as obviously the Native slave knows where its got to in the master logs? As far as I can see, one should be able to fake an entry in the history table, but are there any implications to doing this?

Thanks

Chris
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#640
Chris Beauchamp (User)
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
Re:Migrating from native mysql replication 5 Months, 3 Weeks ago Karma: 0  
OK - at the risk of answering my own question, how does this sound:

  • Start the replicator on the master - this will start to fill up the history table.

  • Bring down slave, make a copy, and record details from master.info on where replication has got to.

  • Find the seqno on the master which corresponds to the position in master.info: eg, if position is 693:
    Code:

    select * from history where eventid like '%693%';
    will cut down the number of rows to review.
  • Create a new slave, removing the native replication config (master.info, any binlogs, and relay binlogs, relay.info).
  • Do a mysqldump of the tungsten database, without any data, and import that into a new tungsten database on the slave.
  • Create a row in the trep_commit_seqno table, with the seqno found in stage 3.
  • Start the replicator on the new slave.
This should start replication from the right point. Any new slaves can now be provisioned from the existing slave. I've managed to get this working in my test environment, but does this sound good to those with more experience with this. Any pitfalls I might need to know about? Thanks Chris
 
Report to moderator   Logged Logged  
 
Last Edit: 2010/03/19 12:38 By chris@chillibean.tv. Reason: formatting
  The administrator has disabled public write access.
#642
Robert Hodges (Moderator)
Moderator
Posts: 218
graph
User Offline Click here to see the profile of this user
Location: Berkeley California
Re:Migrating from native mysql replication 5 Months, 3 Weeks ago Karma: 1  
Hi Chris,

Great question. And your procedure is essentially correct but you will need to add a dummy row in tungsten.history with the seqno and eventid that match where you want to start replicating on the master.

Tungsten will start asking for sequence numbers from the master starting after the max value of seqno in tungsten.history. It will start applying based on the seqno in tungsten.trep_commit_seqno.

Meanwhile, I'm also putting in a feature in Tungsten 1.3 that will make this process easier. However, your procedure should work just as easily.

Cheers, Robert
 
Report to moderator   Logged Logged  
 
Robert Hodges
Continuent CTO
  The administrator has disabled public write access.
#643
Chris Beauchamp (User)
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
Re:Migrating from native mysql replication 5 Months, 2 Weeks ago Karma: 0  
Hi Robert,

Thanks for the confirmation - regarding dummy rows, in my testing I didn't put in a dummy row at all: what I found was that as I'd started Master before I'd taken a copy of the slave, the binary logs in the tungsten database were already in place, therefore there were rows available which matched where I needed to start the slave from.

Is it the case that the slave will pull over rows from the Master before it starts replicating? Or will it just not complain if there aren't any, and wait patiently until they appear?

Thanks

Chris
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#650
Robert Hodges (Moderator)
Moderator
Posts: 218
graph
User Offline Click here to see the profile of this user
Location: Berkeley California
Re:Migrating from native mysql replication 5 Months, 2 Weeks ago Karma: 1  
Hi!

The slave will just wait if the master does not have any rows to send. (Did I understand this correctly?)

Cheers, Robert
 
Report to moderator   Logged Logged  
 
Robert Hodges
Continuent CTO
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop