在MariaDB中配置主从复制,需要完成以下步骤:
server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
binlog_do_db = YOUR_DATABASE_NAME
CREATE USER 'repl'@'slave_ip' IDENTIFIED BY 'password';
GRANT REPLICATION SLAVE ON *.* TO 'repl'@'slave_ip';
SHOW MASTER STATUS;
server-id = 2
CHANGE MASTER TO MASTER_HOST='master_ip', MASTER_USER='repl', MASTER_PASSWORD='password', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=107;
START SLAVE;
SHOW SLAVE STATUS\G;
通过以上配置和步骤,就可以在MariaDB中成功配置主从复制。