• Resolved ferdisn

    (@ferdisn)


    Hi,

    I set up a MariaDB Master Slave Replication using many resources on the internet. So far, it’s good. Every new database created got replicated to the slave.

    I then proceed to install WordPress on the master db. All this goes smooth.

    However, when I create a blogpost, the replication does not work.

    I got this error from the slave:
    Could not execute Write_rows event on table testblog2.wp_options; Duplicate entry ‘132’ for key ‘PRIMARY’, Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event’s master log mariadb-bin.000001, end_log_pos 1170967

    This is a new server installation, both master and slave using CentOS 7.2 and MariaDB 5.5.52.

    After searching on how to bypass this error, replication is normal again. Then, I tried creating another post, and the replication is halted again.

    I stumbled upon this post:
    https://www.ads-software.com/support/topic/recommended-setup-for-mysql-replication/
    in which recommends that Percona to be used instead of MariaDB.

    I was wondering whether there are new information or not regarding this issue. I will try to use Percona, but if i can keep to use both MariaDB as DBMS, I’d like that.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You may want to troubleshoot replication. Percona isn’t necessarily exempt from the same error. Either way, it isn’t a WordPress specific issue.

    A starting point: “Could not execute Write_rows event on table” “handler error HA_ERR_FOUND_DUPP_KEY” (Link goes to Google)

    Thread Starter ferdisn

    (@ferdisn)

    Hi, Clayton. Thank you for the pointers.

    I found the problem in my installation.

    I follow many different guides.
    But reading from here [1], I deduce to only add this directive: server-id = 1, to my.cnf. Previously, I have --binlog-format=row, too, in my.cnf.

    In the link here [2] there is this statement: “Personally, I would switch binary-format to STATEMENT” which then followed to this link, [3] and below the table possible value, there is this sentence, “Statement-based is the default in MySQL 5.5.”

    This causes me to check the my.cnf again. I removed that directive, so that mariadb reverts to its default setting.

    I set up replication, empty database. Reinitialize WordPress. Got the initialization to the other side. I then create a blogpost, and it doth appear on the slave server (I create another WP installation with wp-config.php already set).

    Thank you very much for the pointers, Clayton.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WordPress with MariaDB Master Slave Replication in CentOS 7’ is closed to new replies.