T
T
Timi02222021-04-15 18:28:28
css
Timi0222, 2021-04-15 18:28:28

mariadb database replication?

Good afternoon, tell me why replication does not work, what did I enter wrong?
There are 2 servers, 2 bases, but they are not synchronized as master/master. I did this:

1 server
nano /etc/mysql/mariadb.conf.d/50-server.cnf
[mysqld]
log-bin
server_id=1
replicate-do-db=zabbix
bind-address=IP 1 server

systemctl restart mariadb

mysql -u root -p
CREATE USER '$zabbixrep'@'%' IDENTIFIED BY 'PASSWORD';
GRANT REPLICATION SLAVE ON *.* TO '$zabbixrep'@'%';
FLUSH PRIVILEGES;
SHOW MASTER STATUS;

+------------------+----------+--------------+---- --------------+
| file | position | Binlog_Do_DB | Binlog_Ignore_DB|
+------------------+----------+--------------+---- --------------+
| mariadb-bin.000002 | 626 | | |
+------------------+----------+--------------+---- --------------+
1 row in set (0.00 sec)

2 server
nano /etc/mysql/mariadb.conf.d/50-server.cnf
[mysqld]
log-bin
server_id= 2
replicate-do-db=zabbix
bind-address=IP 2 server

systemctl restart mariadb

mysql -u root -p
CREATE USER '$zabbixrep2'@'%' IDENTIFIED BY 'PASSWORD';
GRANT REPLICATION SLAVE ON *.* TO '$zabbixrep2'@'%';
FLUSH PRIVILEGES;

SLAVE STOP;
CHANGE MASTER TO MASTER_HOST = 'IP 1 server', MASTER_USER = '$zabbixrep', MASTER_PASSWORD = 'PASSWORD', MASTER_LOG_FILE = 'mariadb-bin.000002', MASTER_LOG_POS = 626 ;
SLAVE START;
SHOW MASTER STATUS;

+------------------+----------+--------------+---- --------------+
| file | position | Binlog_Do_DB | Binlog_Ignore_DB|
+------------------+----------+--------------+---- --------------+
| mariadb-bin.000002 | 635 | | |
+------------------+----------+--------------+---- --------------+
1 row in set (0.00 sec)

=
On the first server do:
mysql -u root -p
CHANGE MASTER TO MASTER_HOST = 'IP 2 server', MASTER_USER = '$zabbixrep2', MASTER_PASSWORD = '$PASSWORD', MASTER_LOG_FILE = 'mariadb-bin.000002', MASTER_LOG_POS = 635 ;
SLAVE START;

Both servers show what connected:
Slave_IO_State: Connecting to master
Master_Host: IP servera
Master_User: $zabbixrep2
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mariadb-bin.000002
Read_Master_Log_Pos: 635
Relay_Log_File: mysqld-relay-bin.000001 Relay_Log_Master
:
: mariadb-bin.000002
Slave_IO_Running: Connecting
Slave_SQL_Running: Yes
Replicate_Do_DB: zabbix

Ports skipped 3306.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
A person from Kazakhstan, 2018-07-09
@LenovoId

https://codepen.io/panfilov/pen/GogJVy on css3
https://bkosborne.com/jquery-waterwheel-carousel

L
litash, 2018-07-09
@litash

https://lukeed.com/demo/bee3D/#/effects/coverflow see

D
Dimonchik, 2021-04-15
@Timi0222

did you do this?
https://winitpro.ru/index.php/2019/09/03/mariadb-r...
look for a step where I missed something)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question