List:Replication« Previous MessageNext Message »
From:Truls Bergskaug Date:July 15 2013 7:39am
Subject:Re: 2 slaves - one Master; continues to fail
View as plain text  
On 2013-07-15 02:26, McGranahan, Jamen wrote:
> But I get this error when I start the slave:
>
> Last_SQL_Error: Error 'Duplicate entry 'bmaoro7earquaq0jd4bn4a4cm0' for key
> 'sessions_pkey'' on query. Default database: 'ojs_new'. Query: 'INSERT INTO sessions
>                  (session_id, ip_address, user_agent, created, last_used, remember,
> data, acting_as)
>                  VALUES
>                  ('bmaoro7earquaq0jd4bn4a4cm0', '66.249.75.188', 'Mozilla/5.0
> (compatible; Googlebot/2.1; +http://www.google.com/bot.html)', 1373844331, 1373844331, 0,
> '', 0)'
>
> I don't understand why it is trying to insert it when it is already in the table on
> the slave. The start point in the Master is this:
>
> mysql> show master status;
> +------------------+-----------+--------------+------------------+
> | File             | Position  | Binlog_Do_DB | Binlog_Ignore_DB |
> +------------------+-----------+--------------+------------------+
> | mysql-bin.000468 | 441900005 |              |                  |
> +------------------+-----------+--------------+------------------+
> 1 row in set (0.00 sec)
>
> So, I used the CHANGE command on the SLAVE:
>
> CHANGE MASTER TO
> MASTER_HOST='mysql.library.vanderbilt.edu',MASTER_USER='slave4',MASTER_PASSWORD='xxxxxxx',MASTER_LOG_FILE='mysql-bin.000468',MASTER_LOG_POS=441900005;
>
>
> Jamen McGranahan
> Systems Services Librarian
> Vanderbilt University Library
>
 From your config, it seems that your server is using MyISAM based 
tables mostly. If you are using MyISAM and aborts an operation on 
master, the slave may get inconsistent due to MyISAM's non transactional 
behaviour (does not roll back data).

Instead of starting the slave on a new position, the command

*|SET GLOBAL sql_slave_skip_counter =/|N|/;
|*

could be used (see: 
http://dev.mysql.com/doc/refman/5.5/en/replication-problems.html )

You also use an old version of MySQL: 5.5.17, and in the next version of 
MySQL: 5.5.18 there is a fix for problems that can create similar 
problems ( 
http://dev.mysql.com/doc/relnotes/mysql/5.5/en/news-5-5-18.html ). Also 
in newer versions of MySQL, there is several fixes for bugs and performance.

-- 
Truls Bergskaug
Senior System Consultant

Basefarm AS

Thread
2 slaves - one Master; continues to failJamen McGranahan14 Jul
  • Re: 2 slaves - one Master; continues to failSuresh Kuna14 Jul
    • RE: 2 slaves - one Master; continues to failJamen McGranahan14 Jul
      • Re: 2 slaves - one Master; continues to failSuresh Kuna14 Jul
  • RE: 2 slaves - one Master; continues to failJamen McGranahan15 Jul
    • RE: 2 slaves - one Master; continues to failJohan De Meersman15 Jul
    • Re: 2 slaves - one Master; continues to failTruls Bergskaug15 Jul
  • Re: 2 slaves - one Master; continues to failJesper Wisborg Krogh15 Jul
    • Re: 2 slaves - one Master; continues to failDivesh Kamra16 Jul
Re: 2 slaves - one Master; continues to failJohan De Meersman15 Jul
  • RE: 2 slaves - one Master; continues to failJamen McGranahan15 Jul
    • Re: 2 slaves - one Master; continues to failJohan De Meersman15 Jul
      • Re: 2 slaves - one Master; continues to failSuresh Kuna15 Jul
        • RE: 2 slaves - one Master; continues to failJamen McGranahan15 Jul
          • Re: 2 slaves - one Master; continues to failSuresh Kuna15 Jul
            • RE: 2 slaves - one Master; continues to failJamen McGranahan15 Jul
              • Re: 2 slaves - one Master; continues to failSuresh Kuna15 Jul
Re: 2 slaves - one Master; continues to failJohan De Meersman17 Jul
Re: 2 slaves - one Master; continues to failJohan De Meersman18 Jul
  • RE: 2 slaves - one Master; continues to failJamen McGranahan18 Jul
    • Re: 2 slaves - one Master; continues to failMarcus Bointon18 Jul
      • RE: 2 slaves - one Master; continues to failJamen McGranahan18 Jul
        • Re: 2 slaves - one Master; continues to failSuresh Kuna18 Jul
          • RE: 2 slaves - one Master; continues to failJamen McGranahan18 Jul
        • Re: 2 slaves - one Master; continues to failMarcus Bointon18 Jul
          • RE: 2 slaves - one Master; continues to failJamen McGranahan18 Jul
            • Re: 2 slaves - one Master; continues to failMarcus Bointon18 Jul
              • RE: 2 slaves - one Master; continues to failJamen McGranahan18 Jul
              • RE: 2 slaves - one Master; continues to failJamen McGranahan22 Jul
                • Re: 2 slaves - one Master; continues to failSuresh Kuna22 Jul