Skip to content

Commit 114cfe4

Browse files
committed
Add tabs for how-to and added next steps for both articles
1 parent e4e1d25 commit 114cfe4

File tree

2 files changed

+50
-30
lines changed

2 files changed

+50
-30
lines changed

articles/mysql/flexible-server/concepts-data-out-replication.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,7 @@ Refer to the following general guidance on the replication filter:
4747

4848
## Next steps
4949

50-
- How to configure Data-out replication
51-
- How to configure Data-in replication
50+
- How to configure [Data-out replication](how-to-data-out-replication.md)
51+
- Learn about [Data-in replication](concepts-data-in-replication.md)
52+
- How to configure [Data-in replication](how-to-data-in-replication.md)
53+

articles/mysql/flexible-server/how-to-data-out-replication.md

Lines changed: 46 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Configure Data-out replication - Azure Database for MySQL Flexible Server
3-
description: This article describes how to set up Data-in replication for Azure Database for MySQL Flexible Server.
3+
description: This article describes how to set up Data-out replication for Azure Database for MySQL Flexible Server.
44
author: VandhanaMehta
55
ms.author: vamehta
66
ms.reviewer: maghan
@@ -49,23 +49,33 @@ If the variable log_bin is returned with the value "ON", binary logging is enabl
4949

5050
1. **Create a new replication role and set up permission**
5151

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 on your source server.
53-
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.
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.
5453

55-
**SQL Command**
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+
58+
#### [SQL Command](#tab/command-line)
59+
60+
**Replication with SSL**
5661

57-
Replication with SSL
5862
To require SSL for all user connections, use the following command to create a user:
59-
SQLCopy
63+
64+
```bash
6065
CREATE USER 'syncuser'@'%' IDENTIFIED BY 'yourpassword';
6166
GRANT REPLICATION SLAVE ON *.* TO ' syncuser'@'%' REQUIRE SSL;
62-
Replication without SSL
67+
```
68+
69+
**Replication without SSL**
70+
6371
If SSL isn't required for all connections, use the following command to create a user:
64-
SQLCopy
72+
73+
```bash
6574
CREATE USER 'syncuser'@'%' IDENTIFIED BY 'yourpassword';
6675
GRANT REPLICATION SLAVE ON *.* TO ' syncuser'@'%';
76+
```
6777

68-
**MySQL Workbench**
78+
#### [MySQL Workbench](#tab/mysql-workbench)
6979

7080
To create the replication role in MySQL Workbench, open the Users and Privileges panel from the Management panel and select Add Account.
7181

@@ -94,6 +104,10 @@ The results should appear similar to the following. Make sure to note the binary
94104

95105
:::image type="content" source="media/how-to-data-out-replication/mysql-workbench-result.png" alt-text="Screenshot of results.":::
96106

107+
#### [Azure Data Studio](#tab/azure-data-studio)
108+
109+
<-----------Content here----------->
110+
97111
## Dump and restore the source server.
98112

99113
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:
@@ -106,12 +120,12 @@ Follow the below steps if the source server has existing data to migrate to the
106120
You can use mysqldump to dump databases from your primary server. For details, refer to Dump & Restore. It's unnecessary to dump the MySQL library and test library.
107121

108122
1. Set the source server to read/write mode.
109-
After dumping the database, change the source MySQL server back to read/write mode.
123+
After dumping the database, change the source MySQL server to read/write mode.
110124
SQLCopy
111125
SET GLOBAL read_only = OFF;
112126
UNLOCK TABLES;
113127

114-
1. Restore dump file to new server.
128+
1. Restore dump file to the new server.
115129
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.
116130

117131
> [!NOTE]
@@ -120,24 +134,24 @@ Restore the dump file to the server created in the Azure Database for MySQL Flex
120134
## Configure the replica server to start Data-out replication.
121135

122136
1. Filtering
123-
Suppose data-out replication is being set up between Azure MySQL and an external MySQL on other cloud providers or on-premises. In that case, you must use the replication filter to filter out Azure custom tables. This can be achieved by setting Replicate_Wild_Ignore_Table = "mysql.\_\_%" to filter the Azure mysql internal tables. To modify this parameter from the Azure portal, navigate to Azure Database for MySQL Flexible server used as source and select on "Server parameters" to view/edit the "Replicate_Wild_Ignore_Table" parameter. Refer to MySQL :: MySQL 5.7 Reference Manual :: 13.4.2.2 CHANGE REPLICATION FILTER Statement for more details on modifying this server parameter.
137+
Suppose data-out replication is being set up between Azure MySQL and an external MySQL on other cloud providers or on-premises. In that case, you must use the replication filter to filter out Azure custom tables. This can be achieved by setting Replicate_Wild_Ignore_Table = "mysql.\_\_%" to filter the Azure mysql internal tables. To modify this parameter from the Azure portal, navigate to Azure Database for MySQL Flexible server used as source and select "Server parameters" to view/edit the "Replicate_Wild_Ignore_Table" parameter. Refer to MySQL :: MySQL 5.7 Reference Manual :: 13.4.2.2 CHANGE REPLICATION FILTER Statement for more details on modifying this server parameter.
124138

125139
1. Set the replica server by connecting to it and opening the MySQL shell on the replica server. From the prompt, run the following operation, which configures several MySQL replication settings at the same time:
126-
CHANGE THE REPLICATION SOURCE TO
127-
SOURCE_HOST='<master_host>',
128-
SOURCE_USER='<master_user>',
129-
SOURCE_PASSWORD='<master_password>',
130-
SOURCE_LOG_FILE='<master_log_file>,
131-
SOURCE_LOG_POS=<master_log_pos>
132-
133-
- master_host: hostname of the source server (example – 'source.mysql.database.Azure.com')
134-
- master_user: username for the source server (example -'syncuser'@'%')
135-
- master_password: password for the source server
136-
- master_log_file: binary log file name from running show master status
137-
- master_log_pos: binary log position from running show master status
140+
CHANGE THE REPLICATION SOURCE TO
141+
SOURCE_HOST='<master_host>',
142+
SOURCE_USER='<master_user>',
143+
SOURCE_PASSWORD='<master_password>',
144+
SOURCE_LOG_FILE='<master_log_file>,
145+
SOURCE_LOG_POS=<master_log_pos>
146+
147+
- master_host: hostname of the source server (example – 'source.mysql.database.Azure.com')
148+
- master_user: username for the source server (example -'syncuser'@'%')
149+
- master_password: password for the source server
150+
- master_log_file: binary log file name from running show master status
151+
- master_log_pos: binary log position from running show master status
138152

139153
> [!NOTE]
140-
> To use SSL for the connection, add the attribute SOURCE_SSL=1 to the command. For more information about using SSL in replication context, please refer - https://dev.mysql.com/doc/refman/8.0/en/change-replication-source-to.html
154+
> To use SSL for the connection, add the attribute SOURCE_SSL=1 to the command. For more information about using SSL in a replication context, please refer - https://dev.mysql.com/doc/refman/8.0/en/change-replication-source-to.html
141155
142156
1. Activate the replica server using the following command.
143157
START REPLICA;
@@ -146,11 +160,15 @@ At this point, the replica instance will begin replicating any changes made to t
146160
1. Check replication status.
147161
Call the show slave status\G command on the replica server to view the replication status.
148162
Show slave status;
149-
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 isn't "0", it means that the replica is processing updates.
163+
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".
150164

151165
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, see Manage firewall rules using the portal.
152166

153167
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.
154168

155-
Next steps
156-
Learn more about Data-out replication (hyperlinked to data-out concepts page) for Azure Database for MySQL Flexible Server.
169+
## Next step
170+
171+
- Learn about [Data-out replication](concepts-data-out-replication.md)
172+
- Learn about [Data-in replication](concepts-data-in-replication.md)
173+
- How to configure [Data-in replication](how-to-data-out-replication.md)
174+

0 commit comments

Comments
 (0)