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/mysql/flexible-server/how-to-data-in-replication.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -145,6 +145,8 @@ The results should appear similar to the following. Make sure to note the binary
145
145
146
146
<-----------Content here----------->
147
147
148
+
---
149
+
148
150
## Dump and restore the source server
149
151
150
152
1. Determine which databases and tables you want to replicate into Azure Database for MySQL Flexible Server and perform the dump from the source server.
Copy file name to clipboardExpand all lines: articles/mysql/flexible-server/how-to-data-out-replication.md
+26-20Lines changed: 26 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,27 +34,31 @@ The following steps prepare and configure the Azure Database for MySQL Flexible
34
34
35
35
1.**Networking Requirements**
36
36
37
-
Ensure that your network settings are established so that source and replica server can communicate seamlessly.
38
-
If the source server is on public access, then ensure that firewall rules allow the replica server IP address. If the replica server is hosted on Azure, please ensure that you select the option of allowing public access from any Azure service from the networking page in the Azure portal.
39
-
If the source server is on private access, ensure that the replica server can connect to the source through Vnet peering or a VNet-to-VNet VPN gateway connection.
40
-
37
+
Ensure that your network settings are established so that source and replica server can communicate seamlessly.
38
+
If the source server is on public access, then ensure that firewall rules allow the replica server IP address. If the replica server is hosted on Azure, please ensure that you select the option of allowing public access from any Azure service from the networking page in the Azure portal.
39
+
If the source server is on private access, ensure that the replica server can connect to the source through Vnet peering or a VNet-to-VNet VPN gateway connection.
40
+
41
41
> [!NOTE]
42
42
> For more information - [Networking overview - Azure Database for MySQL Flexible Server](concepts-networking.md).
43
43
44
44
1.**Turn on binary logging**
45
45
46
-
Check to see if binary logging has been enabled on the source by running the following command:
47
-
SHOW VARIABLES LIKE 'log_bin';
48
-
If the variable log_bin is returned with the value "ON", binary logging is enabled on your server.
49
-
46
+
Check to see if binary logging has been enabled on the source by running the following command:
47
+
48
+
```sql
49
+
SHOW VARIABLES LIKE'log_bin';
50
+
```
51
+
52
+
If the variable log_bin is returned with the value 'ON', binary logging is enabled on your server.
53
+
50
54
1.**Create a new replication role and set up permission**
51
55
52
-
Create a user account on the configured source server with replication privileges. This can be done through SQL commands or a tool such as MySQL Workbench. Consider whether you plan on replicating with SSL, as this will need to be specified when creating the user. Refer to the MySQL documentation to understand how to [add user accounts](https://dev.mysql.com/doc/refman/5.7/en/user-names.html) on your source server.
53
-
54
-
In the following commands, the new replication role can access the source from any machine, not just the one that hosts the source itself. This is done by specifying "syncuser@'%'" in the create user command. See the MySQL documentation to learn more about [setting account names](https://dev.mysql.com/doc/refman/5.7/en/account-names.html).
55
-
56
-
There are a few tools you can use to set account names. Select the one that best fits your environment.
57
-
56
+
Create a user account on the configured source server with replication privileges. This can be done through SQL commands or a tool such as MySQL Workbench. Consider whether you plan on replicating with SSL, as this will need to be specified when creating the user. Refer to the MySQL documentation to understand how to [add user accounts](https://dev.mysql.com/doc/refman/5.7/en/user-names.html) on your source server.
57
+
58
+
In the following commands, the new replication role can access the source from any machine, not just the one that hosts the source itself. This is done by specifying "syncuser@'%'" in the create user command. See the MySQL documentation to learn more about [setting account names](https://dev.mysql.com/doc/refman/5.7/en/account-names.html).
59
+
60
+
There are a few tools you can use to set account names. Select the one that best fits your environment.
61
+
58
62
#### [SQL Command](#tab/command-line)
59
63
60
64
**Replication with SSL**
@@ -111,6 +115,8 @@ The results should appear similar to the following. Make sure to note the binary
111
115
112
116
<-----------Content here----------->
113
117
118
+
---
119
+
114
120
## Dump and restore the source server.
115
121
116
122
Skip this section if it's a newly created source server with no existing data to migrate to the replica. You can, at this point, unlock the tables:
@@ -137,7 +143,7 @@ After dumping the database, change the source MySQL server to read/write mode.
137
143
Restore the dump file to the server created in the Azure Database for MySQL Flexible Server service. Refer to Dump & Restore for restoring a dump file to a MySQL server. If the dump file is large, upload it to a virtual machine in Azure within the same region as your replica server. Restore it to the Azure Database for MySQL Flexible Server server from the virtual machine.
138
144
139
145
> [!NOTE]
140
-
> If you want to avoid setting the database to read-only when you dump and restore, you can use [mydumper/myloader](../migrate/concepts-migrate-mydumper-myloader).
146
+
> If you want to avoid setting the database to read-only when you dump and restore, you can use [mydumper/myloader](../migrate/concepts-migrate-mydumper-myloader.md).
141
147
142
148
## Configure the replica server to start Data-out replication.
143
149
@@ -169,7 +175,7 @@ Restore the dump file to the server created in the Azure Database for MySQL Flex
169
175
START REPLICA;
170
176
```
171
177
172
-
At this point, the replica instance begins replicating any changes made to the source server database. You can test this by creating a sample table on your source database and checking whether it gets replicated successfully.
178
+
At this point, the replica instance begins replicating any changes made to the source server database. You can test this by creating a sample table on your source database and checking whether it gets replicated successfully.
173
179
174
180
1. Check replication status.
175
181
@@ -181,10 +187,10 @@ At this point, the replica instance begins replicating any changes made to the s
181
187
182
188
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. The replica is processing updates if the value isn't `0`.
183
189
184
-
If the replica server is hosted in an Azure VM, set **Allow access to Azure services** to **ON** on the source to allow the source and replica servers to communicate. This setting can be changed from the connection security options. For more information, visit [Manage firewall rules using the portal](how-to-manage-firewall-portal.md).
185
-
186
-
If you used mydumper/myloader to dump the database, you could get the master_log_file and master_log_pos from the /backup/metadata file.
187
-
190
+
If the replica server is hosted in an Azure VM, set **Allow access to Azure services** to **ON** on the source to allow the source and replica servers to communicate. This setting can be changed from the connection security options. For more information, visit [Manage firewall rules using the portal](how-to-manage-firewall-portal.md).
191
+
192
+
If you used mydumper/myloader to dump the database, you could get the master_log_file and master_log_pos from the /backup/metadata file.
193
+
188
194
## Next step
189
195
190
196
- Learn more about [Data-out replication](concepts-data-out-replication.md)
0 commit comments