You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/mariadb/howto-data-in-replication.md
+22-2Lines changed: 22 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ ms.date: 09/24/2018
10
10
11
11
# How to configure Azure Database for MariaDB Data-in Replication
12
12
13
-
In this article, you will learn how to set up Data-in Replication in the Azure Database for MariaDB service by configuring the master and replica servers. Data-in Replication allows you to synchronize data from a master MariaDB server running on-premises, in virtual machines, or database services hosted by other cloud providers into a replica in the Azure Database for MariaDB service.
13
+
In this article, you will learn how to set up Data-in Replication in the Azure Database for MariaDB service by configuring the master and replica servers. Data-in Replication allows you to synchronize data from a master MariaDB server running on-premises, in virtual machines, or database services hosted by other cloud providers into a replica in the Azure Database for MariaDB service. We recommanded you setup the data-in replication with [Global Transaction ID](https://mariadb.com/kb/en/library/gtid/) when your master server's version is 10.2 or above.
14
14
15
15
This article assumes that you have at least some prior experience with MariaDB servers and databases.
16
16
@@ -111,7 +111,16 @@ The following steps prepare and configure the MariaDB server hosted on-premises,
111
111
The results should be like following. Make sure to note the binary file name as it will be used in later steps.
112
112
113
113

114
+
115
+
6. Get GTID position (Optional, needed for replication with GTID)
116
+
117
+
Run the function [`BINLOG_GTID_POS`](https://mariadb.com/kb/en/library/binlog_gtid_pos/) command to get the GTID position for the correspond binlog file name and offset.
@@ -137,17 +146,24 @@ The following steps prepare and configure the MariaDB server hosted on-premises,
137
146
138
147
All Data-in Replication functions are done by stored procedures. You can find all procedures at [Data-in Replication Stored Procedures](reference-data-in-stored-procedures.md). The stored procedures can be run in the MySQL shell or MySQL Workbench.
139
148
140
-
To link two servers and start replication, login to the target replica server in the Azure DB for MariaDB service and set the external instance as the master server. This is done by using the `mysql.az_replication_change_master` stored procedure on the Azure DB for MariaDB server.
149
+
To link two servers and start replication, login to the target replica server in the Azure DB for MariaDB service andset the external instance as the master server. This is done by using the `mysql.az_replication_change_master`or`mysql.az_replication_change_master_with_gtid`stored procedure on the Azure DB for MariaDB server.
- master_log_file: binary log file name from running `show master status`
150
165
- master_log_pos: binary log position from running `show master status`
166
+
- master_gtid_pos: GTID position from running `select BINLOG_GTID_POS('<binlog file name>', <binlog offset>);`
151
167
- master_ssl_ca: CA certificate’s context. If not using SSL, pass in empty string.
152
168
- It is recommended to pass this parameter inas a variable. See the following examples for more information.
153
169
@@ -194,6 +210,10 @@ The following steps prepare and configure the MariaDB server hosted on-premises,
194
210
195
211
If the state of `Slave_IO_Running`and`Slave_SQL_Running` are "yes"and the value of `Seconds_Behind_Master` is “0”, replication is working well. `Seconds_Behind_Master` indicates how late the replica is. If the value is not "0", it means that the replica is processing updates.
196
212
213
+
4. Update correspond server variables to make data-in replication more safe (Only needed for replication without GTID)
214
+
215
+
Because of MariaDB native replication limitation, you need to setup [`sync_master_info`](https://mariadb.com/kb/en/library/replication-and-binary-log-system-variables/#sync_master_info) and [`sync_relay_log_info`](https://mariadb.com/kb/en/library/replication-and-binary-log-system-variables/#sync_relay_log_info) variables on replication without GTID scenario. We recommand you check your slave server's `sync_master_info` and `sync_relay_log_info` variables and change them ot `1` if you want to make sure the data-in replication is stable.
0 commit comments