Answer the question
In order to leave comments, you need to log in
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
https://codepen.io/panfilov/pen/GogJVy on css3
https://bkosborne.com/jquery-waterwheel-carousel
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question