Views: 381
Last Modified: 23.09.2022

Master-master replication setup

Master-master replication setup is similar to the setup for master-slave replication with exception of sone specifics.

Complete the following actions for configuring master-master replication:

  1. Create a group at the Web Cluster menu page (Settings > Web Cluster > Server groups)
  2. Attention: Each web server of a single group must have a defined constant BX_CLUSTER_GROUP in the file dbconn.php, with value matching to the group identifier. For example: define("BX_CLUSTER_GROUP", 1).

    The file dbconn.php mustn't synchronize between groups.

  3. Launch at the New Master-Slave Database Wizard Replication page (Settings > Web Cluster > [_group_name_] > Replication) using the Add master/slave database context panel button.
  4. Complete all the wizard steps. If needed, configure the settings according to the recommendations.

    Note: You also need to indicate the parameter binlog_format=mixed inside the file my.cnf section [mysqld] for InnoDB tables.

    Otherwise, you'll get an error:
    Binary logging not possible. Message: Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'

    After completing the wizard the database will appear in the list, but won't be active.
  5. Select the action Use Database in the database list and proceed according wizard recommendations.

Upon successful connection the list will show the DB status

.

Managed cache specifics in case of master-master replication

If you add a second master server to the second web cluster group, the cache reset (kernel, managed and etc.) won't work at the both nodes without added memcached-servers.



0


Courses developed by Bitrix24