List:Replication« Previous MessageNext Message »
From:Shawn Green Date:December 18 2013 1:57pm
Subject:Re: replication problem's with data base mysql
View as plain text  
Hello Christophe,

On 12/18/2013 4:55 AM, Christophe Carles wrote:
> Hello Shawn,
>
> Thank you very much four reply.
>
>
>
> ...
>> The use of these settings are deprecated. You should only set or change
>> your replication coordinates using a CHANGE MASTER TO... command.
>
> OK, I'l do this
>
>
>
>> The problem is not with your master. The problem is how you told your
>> slave to start replicating.
>
>> This new slave is a copy of some data that corresponds to the state
>> that >
>> the master was in at a particular location in its binary logs (a file
>> name and an offset -or- a GTID value). That is where you needed to have
>> the master was in at a particular location in its binary logs (a file
>> name and an offset -or- a GTID value). That is where you needed to have
>> this slave start replicating from. Because you did not provide the
>> correct coordinates (or any at all) you attempted to start from the
>> first position of the first binary log. As you can see, that file no
>> longer exists.
>
>> What you need to know is what binary log coordinates match the state of
>> the data you created this new VM with. This we cannot tell you as we
>> have no details of where your data originated or how you created the
>> copy.
>
> I'll create the database on the new slave with phpmyadmin
>
> I had try different things to make a transfer
> First : I'll made a dump of the master's database, copy this to the
> slave and import it with phpmyadmin int the new slave.

The master_log_file and master_log_pos values you should have used would 
be written into the dump you created if you had also used the option 
--master-data. If you did not use mysqldump, then follow the directions 
for the tool you did use.

http://dev.mysql.com/doc/refman/5.6/en/mysqldump.html#option_mysqldump_master-data



> Second : I had copied data located to /var/lib/mysql/mydata-base from
> the master to the new slave.

The correct (file,position) coordinates would have been at position 4 of 
the first Binary Log your master created after you restarted it. You 
cannot capture a valid file-level copy of a running mysqld instance 
without taking some serious precautions. The most assured way of getting 
a clean copy file-level copy is with MySQL stopped.

> Third : I had copied data located to /var/lib/mysql/mydata-base from the
> old slave to the new slave.
>

You would have used the replication coordinates that the existing slave 
was using at the exact moment your copy was made.


> And in each case, i have the same erroe in logs.
>

You kept getting the same error because you kept repeating the same 
mistake.

> What is the best way in my case to make this transfer OK ?
>
> Regards,
>

Step 1 - Get a clear mental picture of the replication process.  What 
role does the Binary Log play?  When are events written into the Binary 
Log? What does the Relay Log do? What do the SLAVE_IO and SLAVE_SQL 
threads do? What else can you learn from a SHOW SLAVE STATUS report? 
Once you figure out this information, you should be able to understand 
why your method failed.

Step 2 - Find the reference for the CHANGE MASTER TO ... command for 
your version of MySQL.

Step 3 - Configure your slave to use the proper replication coordinates 
for the backup/restore method you use to initialize the slave's copy of 
the data.

Warmest wishes,

-- 
Shawn Green
MySQL Senior Principal Technical Support Engineer
Oracle USA, Inc. - Hardware and Software, Engineered to Work Together.
Office: Blountville, TN
Thread
replication problem's with data base mysqlChristophe Carles17 Dec
  • Re: replication problem's with data base mysqlShawn Green17 Dec
  • Re: replication problem's with data base mysqlChristophe Carles18 Dec
    • Re: replication problem's with data base mysqlShawn Green18 Dec
      • Re: replication problem's with data base mysqlMarcus Bointon18 Dec
        • Re: replication problem's with data base mysqlShawn Green18 Dec
Re: replication problem's with data base mysqlChristophe Carles20 Dec