Removing APS site breaks mirror sync

Discussion in 'General' started by System_Owner, Jun 22, 2014.

  1. System_Owner

    System_Owner Member

    I have noticed, everytime I remove an installed APS site, afterwards the master <-> master replication with mysql between the two servers break. I have to reestablish the replication again.

    Is this a bug? If not, then why does removing an APS site and it removing the mysql database for it continually break the mysql replication?

    Btw, Im running 3.0.5.4p1.

    Thanks.
     
  2. florian030

    florian030 Well-Known Member HowtoForge Supporter

    What´s the mysql-error when the replication stops?
     
  3. System_Owner

    System_Owner Member

    mysql error

    In phpmyadmin the Slave I/O Thread always stops. When I try to control that piece manually and tell it to start, it never starts or fails to start.

    This is just a piece of the data from the mysql error log:

    140622 3:14:58 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe Statement: INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES ('_bp_db_version', '8311', 'yes') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)
    140622 3:19:02 [ERROR] Slave SQL: Error 'Can't drop database 'c5aps1'; database doesn't exist' on query. Default database: 'c5aps1'. Query: 'DROP DATABASE c5aps1', Error_code: 1008
    140622 3:19:02 [Warning] Slave: Can't drop database 'c5aps1'; database doesn't exist Error_code: 1008
    140622 3:19:02 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.000075' position 1324342
    140622 3:20:30 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000075' at position 1324342, relay log './mysqld-relay-bin.000053' position: 1324488
    140622 3:20:30 [ERROR] Slave SQL: Error 'Can't drop database 'c5aps1'; database doesn't exist' on query. Default database: 'c5aps1'. Query: 'DROP DATABASE c5aps1', Error_code: 1008
    140622 3:20:30 [Warning] Slave: Can't drop database 'c5aps1'; database doesn't exist Error_code: 1008
    140622 3:20:30 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.000075' position 1324342
    140622 3:24:50 [ERROR] Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)
    140622 3:24:50 [Note] Slave I/O thread killed while reading event
    140622 3:24:50 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000075', position 1328601


    All I can think of is, the APS is deleting the database, and then ISPConfig is then trying to go back and delete the database again, of which its not there and then makes the Slave I/O Thread choke.
     
  4. florian030

    florian030 Well-Known Member HowtoForge Supporter

    Your problem is related to your sql-replication. You got error 1008 because ispconfig drops the db on one server and afterwards at the second server.

    You can fix it by stoping slave, skipping the error and start the slave again. Or add some skips to your config.

    Please see here.
     
  5. System_Owner

    System_Owner Member

    Break mysql syncing

    Thanks!!

    I took the last option from the article, since it stated it was the best one, and added:

    slave_skip_errors=1007,1008

    to the my.cnf file. I will probably test creating an aps website with a database and then delete the site right after to verify that it doesnt break the master<->master replication.
     

Share This Page