How to Set Up MariaDB Master-Slave Replication on Ubuntu/Debian



How to Set Up MariaDB Master-Slave Replication on Ubuntu/Debian

How to Set Up MariaDB Master-Slave Replication on Ubuntu/Debian

How to Set Up MariaDB Master-Slave Replication on Ubuntu 22.04 | 21.04 | 19.04 | 18.04 LTS

πŸ‘‰ Code in this video : https://github.com/totatca/MariaDB-Master-Slave-Replication.git

πŸ‘‰ How to Install and Configure MariaDB server on Ubuntu | Debian | Linux Mint : https://youtu.be/fenPhR4iHu8

πŸ‘‰ How to Configure MariaDB Master-Master Replication on Ubuntu | Debian | Linux Mint : https://youtu.be/Xqv1IEjFUGw

πŸ‘‰ How to Configure MySQL Master-Slave Replication on Ubuntu/Debian/Mint : https://youtu.be/hPv-KBzKups

πŸ‘‰ How to Configure MySQL Master-Master Replication on Ubuntu/Debian/Mint : updating

πŸ“Œ In this video will be showing you how to set up MariaDB master-slave replication on Ubuntu 18.04/20.04/21.04/22.04 server. MariaDB is a mature, stable, open-source relational database forked from MySQL. Replication is a feature in MariaDB that allows data on one server to be mirrored on another server. There’re several types of replication in MariaDB, including:

β€’ Master-slave replication
β€’ Master-master replication
β€’ Multi-source replication
β€’ Circular replication
πŸ“Œ Master-slave replication is a type of replication in which data is replicated one-way only. A server replicating data from another server is called a slave, while the other server is called the master. Data changes happen on the master server, while the slave server automatically replicates the changes from master server. You can change the data on slave server, but the changes will not be replicated to master server.

Master-slave replication can be used for several purposes.

β€’ Scalability: Write operations can be performed on the master, while read operations can be spread across two or more slave servers, improving performance.
β€’ High availability: Increase data redundancy for improving fault tolerance.
β€’ Dedicated Backup: You can have multiple slave servers and one of them can be used for backup and backup only. No queries are sent to this dedicated backup slave server. The workload on the master and remaining slaves will not be interrupted when a backup is created.

πŸ“Œ How Master-Slave Replication Works in MariaDB

βœ” MariaDB replication is based on the binary log (binlog). The purpose of binary log is to allow replication, backup and restore databases. You must enable binary logging on the master server in order for replication to work. Binary logging is not required on the slave server, but it’s recommended.

βœ” For replication to work, the master and slave server must have the same data at first. Then changes to the data (aka transactions) happen on the master server. The master assigns every transaction a global transaction ID (GTID) and writes the transaction to its binary log. A slave will periodically check the binary log on the master. If there are new transactions, the slave will write the new transaction to its own relay log and execute the transaction.

βœ” The master-slave replication in MariaDB is called asynchronous replication, which means that the master executes transactions immediately and does not wait for any of the slaves to replicate the transaction, so it does not affect write performance. In asynchronous replication, there’s no need for a permanent connection between the slaves and the master.

βœ” The opposite of asynchronous replication is synchronous replication, which is often used in multi-master cluster. With synchronous replication, a transaction is executed after its changes have been replicated to every node in the cluster.

Comments are closed.