Junior — Middle
Do you have experience working with a multi-master setup in MariaDB?
sobes.tech AI
Answer from AI
Yes, I have experience working with multi-master in MariaDB. Multi-master is a replication configuration where multiple MariaDB servers can simultaneously accept writes and synchronize data among themselves.
This is useful for increasing fault tolerance and scalability, as the write load is distributed among several masters.
Key points when working with multi-master:
- Configuring each node as both master and slave.
- Using unique server_id for each server.
- Enabling binary logging and GTID for transaction tracking.
- Handling write conflicts that may occur when the same data is modified simultaneously on different nodes.
An example of multi-master configuration includes setting up my.cnf with parameters:
[mysqld]
server-id=1
log_bin
binlog_format=row
gtid_strict_mode=ON
log_slave_updates=ON
plugin_load_add='rpl_semi_sync_master=semisync_master.so;rpl_semi_sync_slave=semisync_slave.so'
# Replication setup
# Other parameters
And subsequent configuration of replication between servers using the CHANGE MASTER TO command.
Overall, multi-master requires careful planning and monitoring but allows achieving high availability and performance.