Skip to content
This repository was archived by the owner on May 11, 2022. It is now read-only.
This repository was archived by the owner on May 11, 2022. It is now read-only.

Master-Replicant Setup #1

@ag2244

Description

@ag2244

Allow MariaDB port
sudo ufw allow 3306

Edit Config File
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf

#bind-address (Comment out)
server-id        = X
report_host    = masterX
log_bin          = /var/log/mysql/mysql-bin.log
relay_log       = /var/lib/mysql/relay-bin
relay_log_index = /var/lib/mysql/relay-bin.index
log-slave-updates
auto_increment_increment=2
auto_increment_offset=X

Where X is the master number

Create User on Database 1

CREATE USER 'repl'@'%' IDENTIFIED BY 'repl_passwd';
GRANT REPLICATION SLAVE ON *.* TO 'repl'@'%';

Create User on Database 2

CREATE USER 'repl2'@'%' IDENTIFIED BY 'repl_passwd2';
GRANT REPLICATION SLAVE ON *.* TO 'repl2'@'%';

Create Slave on Database 1

CHANGE MASTER TO MASTER_HOST='10.0.2.4', MASTER_USER='repl_master2', MASTER_PASSWORD='repl_passwd2';
START SLAVE;

Create Slave on Database 2

CHANGE MASTER TO MASTER_HOST='10.0.2.15', MASTER_USER='repl', MASTER_PASSWORD='repl_passwd';
START SLAVE;

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions