Earlier in this chapter, we discussed installing MariaDB on a server. To set up a slave, all you really need to begin the process is set up another database server. If you've already set up two database servers, you're ready to begin. If not, feel free to spin up another VM and follow the process from earlier in this chapter that covered installing MariaDB. Go ahead and set up another server if you haven't already done so. Of your two servers, one should be designated as the master and the other the slave, so make a note of the IP addresses for each.
To begin, we'll first start working on the master. We'll need to edit the
/etc/mysql/conf.d/mysql.cnf file. Currently, the file contains just the following line: