Está en la página 1de 4

Replication for MariaDB

last modified by Manuel Antonio Lazo Reyes

on 2022/07/06 23:11
Linkam tutorials - Replication for MariaDB

Table of Contents
1. Instalación y configuración Ubuntu Server ..................................................................................................................... 3
2. Instalación y configuración Maria DB .............................................................................................................................. 3
3. Configuración MASTER .................................................................................................................................................... 3
4. Configuración SLAVE ........................................................................................................................................................ 3

Page 2 / 4 - last modified by Manuel Antonio Lazo Reyes on 2022/07/06 23:11


Linkam tutorials - Replication for MariaDB

Contents
• 1. Instalación y configuración Ubuntu Server
• 2. Instalación y configuración Maria DB
• 3. Configuración MASTER
• 4. Configuración SLAVE

1. Instalación y configuración Ubuntu Server


Crear 2 servidores Ubuntu de acuerdo al tutorial. Es importante instalar y habilitar las opciones de red.

Ubuntu server setup

2. Instalación y configuración Maria DB


Crear 2 instancias de Maria DB en los servidores anteriormente habilitados.

MariaDB installacion

3. Configuración MASTER
Editar el archivo "my.cnf" ubicado en "/etc/mysql/"

[mariadb]
log-bin
server_id=1
log-basename=master1
binlog-format=mixed
skip-networking=0
bind-address=0.0.0.0

Crear un usuario y darle los permisos para ejecutar la replicación.

CREATE USER 'replication_user'@'%' IDENTIFIED BY 'bigs3cret';


GRANT REPLICATION SLAVE ON *.* TO 'replication_user'@'%';

Ejecutar el siguiente comando habiendo iniciado sesión en el master:

show master status;

4. Configuración SLAVE
Editar el archivo "my.cnf" ubicado en "/etc/mysql/"

[mariadb]
server_id=2

Ejecutar el siguiente comando habiendo iniciado sesión en el slave:

CHANGE MASTER TO
MASTER_HOST='<IP Master Server>',

Page 3 / 4 - last modified by Manuel Antonio Lazo Reyes on 2022/07/06 23:11


Linkam tutorials - Replication for MariaDB

MASTER_USER='replication_user',
MASTER_PASSWORD='bigS3cret',
MASTER_PORT=3306,
MASTER_LOG_FILE='master1-bin.000001',
MASTER_LOG_POS=360,
MASTER_USE_GTID = slave_pos,
MASTER_CONNECT_RETRY=10;

Arrancar el slave y verificar:

START SLAVE;
SHOW SLAVE STATUS;

Verificar que los parámetros Slave_IO_Running y Slave_SQL_Running tengan el valor a "Yes".

Page 4 / 4 - last modified by Manuel Antonio Lazo Reyes on 2022/07/06 23:11

También podría gustarte