Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit d396d2e

Browse files
bgavrilovicMSMashaMSFT
authored andcommitted
Deployment upgrade
Restore formatting of unchanged parts Restore service update metadata Pick up recent changes Apply suggestions from code review Co-authored-by: Masha Thomas (MSFT) <32783170+MashaMSFT@users.noreply.github.com> Update Note Update Note Update azure-sql/database/elastic-scale-configure-deploy-split-and-merge.md fixing bookmark fixing things
1 parent 2aa1d80 commit d396d2e

2 files changed

Lines changed: 73 additions & 98 deletions

File tree

azure-sql/database/elastic-scale-configure-deploy-split-and-merge.md

Lines changed: 72 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
title: Deploy a split-merge service
33
description: Use the split-merge too to move data between sharded databases.
4-
author: bgavrilMS
5-
ms.author: bogavril
4+
author: bgavrilovicMS
5+
ms.author: bgavrilovic
66
ms.reviewer: wiassaf, mathoma, randolphwest
7-
ms.date: 06/25/2024
7+
ms.date: 08/13/2024
88
ms.service: azure-sql-database
99
ms.subservice: scale-out
1010
ms.topic: how-to
@@ -13,159 +13,134 @@ ms.custom:
1313
---
1414
# Deploy a split-merge service to move data between sharded databases
1515

16-
[!INCLUDE [appliesto-sqldb](../includes/appliesto-sqldb.md)]
16+
[!INCLUDE[appliesto-sqldb](../includes/appliesto-sqldb.md)]
1717

1818
The split-merge tool lets you move data between sharded databases. See [Moving data between scaled-out cloud databases](elastic-scale-overview-split-and-merge.md).
1919

20-
> [!NOTE]
21-
> The split-merge tool is intended to work with Cloud Services (Classic) and not App Services.
22-
23-
## Download the Split-Merge packages
24-
25-
1. Download the latest NuGet version from [NuGet](/nuget/install-nuget-client-tools).
26-
27-
1. Open a command prompt and navigate to the directory where you downloaded **nuget.exe**. The download includes PowerShell commands.
28-
29-
1. Download the latest Split-Merge package into the current directory with the following command:
30-
31-
```cmd
32-
nuget install Microsoft.Azure.SqlDatabase.ElasticScale.Service.SplitMerge
33-
```
34-
35-
The files are placed in a directory named `Microsoft.Azure.SqlDatabase.ElasticScale.Service.SplitMerge.<x.x.xxx.x>` where `<x.x.xxx.x>` reflects the version number. Find the split-merge service files in the `content\splitmerge\service` subdirectory, and the Split-Merge PowerShell scripts (and required client DLLs) in the `content\splitmerge\powershell` subdirectory.
20+
> [!NOTE]
21+
> The split-merge tool is intended for Azure Web Apps. The end of life for the Cloud Services (Classic) is August 31, 2024. If you were using the split-merge tool on Cloud Services (Classic), migrate to Azure Web Apps before August 31, 2024.
3622
3723
## Prerequisites
3824

39-
1. Create an Azure SQL Database database that will be used as the split-merge status database. Go to the [Azure portal](https://portal.azure.com). Create a new **SQL Database**. Give the database a name and create a new administrator and password. Be sure to record the name and password for later use.
25+
1. Create a SQL database to be used as the split-merge status database. Go to the [Azure portal](https://portal.azure.com). Create a new **SQL database**. Name the database and create a new administrator and password. Be sure to record the name and password for later use.
4026

41-
1. Ensure that your server allows Azure Services to connect to it. In the portal, in the **Firewall Settings**, ensure the **Allow access to Azure Services** setting is set to **On**. Select the **Save** icon.
27+
1. Ensure that your [logical server in Azure](logical-servers.md) allows Azure Services to connect to it. In the Azure portal, in the **Firewall Settings** for your logical server, ensure the **Allow access to Azure Services** setting is set to **On**. Select the **Save** icon.
4228

4329
1. Create an Azure Storage account for diagnostics output.
4430

45-
1. Create an Azure Cloud Service for your Split-Merge service.
31+
1. Use the public split-merge docker images, or push split-merge docker images to either Azure Container Service or your docker registry of choice.
4632

47-
## Configure your Split-Merge service
33+
## Create two Azure Web Apps for your service
4834

49-
### Split-Merge service configuration
35+
Create two Web Apps - a `worker` and `UI` web app.
5036

51-
1. In the folder into which you downloaded the Split-Merge assemblies, create a copy of the `ServiceConfiguration.Template.cscfg` file that shipped alongside `SplitMergeService.cspkg` and rename it `ServiceConfiguration.cscfg`.
37+
### Worker web app
5238

53-
1. Open `ServiceConfiguration.cscfg` in a text editor such as Visual Studio that validates inputs such as the format of certificate thumbprints.
39+
1. Create a [Web App in the Azure portal](https://portal.azure.com/#create/Microsoft.WebSite).
5440

55-
1. Create a new database or choose an existing database to serve as the status database for Split-Merge operations and retrieve the connection string of that database.
41+
1. In the **Publish** field, select **Container**.
5642

57-
> [!IMPORTANT]
58-
> At this time, the status database must use the Latin collation (`SQL_Latin1_General_CP1_CI_AS`). For more information, see [Windows Collation Name](/sql/t-sql/statements/windows-collation-name-transact-sql).
43+
1. For **Operating System**, select **Windows**.
5944

60-
With Azure SQL Database, the connection string typically is of the form:
45+
1. Proceed to the **Docker** tab.
6146

62-
`Server=<serverName>.database.windows.net; Database=<databaseName>;User ID=<userId>; Password=<password>; Encrypt=True; Connection Timeout=30`
47+
1. Populate the following information:
48+
**Image source**: `Docker hub`
49+
**Access type**: `Public`
50+
**Image and tag**: `mcr.microsoft.com/splitmerge/splitmergeworker:20240812.1`
51+
52+
1. Use **Review + create** to create the web app.
53+
54+
### UI Web App
6355

64-
1. Enter this connection string in the `.cscfg` file in both the **SplitMergeWeb** and **SplitMergeWorker** role sections in the ElasticScaleMetadata setting.
56+
To create the UI web app, follow the same steps you used to create the Worker web app with one difference:
57+
- A different docker image in the **Image and tag** field: `mcr.microsoft.com/splitmerge/splitmergeweb:20240812.1`
6558

66-
1. For the **SplitMergeWorker** role, enter a valid connection string to Azure storage for the `WorkerRoleSynchronizationStorageAccountConnectionString` setting.
59+
## Configure your Split-Merge web apps
6760

6861
### Configure security
6962

7063
For detailed instructions to configure the security of the service, refer to the [Split-Merge security configuration](elastic-scale-split-merge-security-configuration.md).
7164

7265
For the purposes of a simple test deployment for this tutorial, a minimal set of configuration steps are performed to get the service up and running. These steps enable only the one machine/account executing them to communicate with the service.
7366

74-
### Create a self-signed certificate
67+
### Create a self-signed certificate and PFX file
7568

76-
Create a new directory and from this directory execute the following command using a [Developer Command Prompt for Visual Studio](/dotnet/framework/tools/developer-command-prompt-for-vs) window:
69+
Use PowerShell to create a self-signed certificate and PFX file.
7770

78-
```cmd
79-
makecert ^
80-
-n "CN=*.cloudapp.net" ^
81-
-r -cy end -sky exchange -eku "1.3.6.1.5.5.7.3.1,1.3.6.1.5.5.7.3.2" ^
82-
-a sha256 -len 2048 ^
83-
-sr currentuser -ss root ^
84-
-sv MyCert.pvk MyCert.cer
85-
```
86-
87-
At the password prompt to protect the private key, enter a strong password and confirm it. Enter the password again when prompted. Select **Yes** at the end to import it to the Trusted Certification Authorities Root store.
88-
89-
### Create a PFX file
71+
First, create a new directory. Then replace the inline values accordingly and run the following PowerShell commands from the new directory:
9072

91-
Execute the following command from the same window where makecert was executed; use the same password that you used to create the certificate:
92-
93-
```cmd
94-
pvk2pfx -pvk MyCert.pvk -spc MyCert.cer -pfx MyCert.pfx -pi <password>
73+
```powershell
74+
$certname = "{certificateName}" ## Replace {certificateName}
75+
$cert = New-SelfSignedCertificate -Subject "CN=$certname" -CertStoreLocation "Cert:\CurrentUser\My" -KeyExportPolicy Exportable -KeySpec Signature -KeyLength 2048 -KeyAlgorithm RSA -HashAlgorithm SHA256
76+
$mypwd = ConvertTo-SecureString -String "{myPassword}" -Force -AsPlainText ## Replace {myPassword}
77+
Export-PfxCertificate -Cert $cert -FilePath "C:\Users\admin\Desktop\$certname.pfx" -Password $mypwd ## Specify your preferred location
9578
```
9679

97-
### Import the client certificate into the personal store
98-
99-
1. In Windows Explorer, double-click `MyCert.pfx`.
100-
1. In the **Certificate Import Wizard**, select **Current User**, then **Next**.
101-
1. Confirm the file path and select **Next**.
102-
1. Type the password, leave **Include all extended properties** checked, and select **Next**.
103-
1. Leave **Automatically select the certificate store[...]** checked, and select **Next**.
104-
1. Select **Finish** and **OK**.
80+
### Upload the PFX file to the web apps and enable certificate usage
10581

106-
### Upload the PFX file to the cloud service
82+
Repeat the following steps for both `worker` and `UI` Web Apps.
10783

10884
1. Go to the [Azure portal](https://portal.azure.com).
109-
1. Select **Cloud Services**.
110-
1. Select the cloud service you created previously for the Split-Merge service.
111-
1. Select **Certificates** on the top menu.
112-
1. Select **Upload** in the bottom bar.
113-
1. Select the PFX file and enter the same password as before.
85+
1. Select **App Services**.
86+
1. Select the Web App you created above for the split-merge tool.
87+
1. Select **Certificates** from the menu.
88+
1. Select **Bring your own certificates (.pfx)**.
89+
1. Select **Add certificate** from the bar.
90+
1. Select the PFX file and enter the same password as above.
11491
1. Once completed, copy the certificate thumbprint from the new entry in the list.
92+
1. In the Web App menu, open **Settings** / **Configuration**.
93+
1. Set **Client certificate mode** to `Require`.
11594

116-
### Update the service configuration file
95+
### Web app configuration
11796

118-
Paste the certificate thumbprint copied previously into the thumbprint/value attribute of these settings.
119-
For the worker role:
97+
Repeat the following steps for both `worker` and `UI` web apps.
12098

121-
```xml
122-
<Setting name="DataEncryptionPrimaryCertificateThumbprint" value="" />
123-
<Certificate name="DataEncryptionPrimary" thumbprint="" thumbprintAlgorithm="sha1" />
124-
```
99+
1. Open the deployed Web App and go to **Settings** > **Environment variables** > **App settings**. Select **Add**.
125100

126-
For the web role:
101+
1. Add a variable with the name **ElasticScaleMetadata** and the value with the connection string for the previously deployed status database.
127102

128-
```xml
129-
<Setting name="AdditionalTrustedRootCertificationAuthorities" value="" />
130-
<Setting name="AllowedClientCertificateThumbprints" value="" />
131-
<Setting name="DataEncryptionPrimaryCertificateThumbprint" value="" />
132-
<Certificate name="SSL" thumbprint="" thumbprintAlgorithm="sha1" />
133-
<Certificate name="CA" thumbprint="" thumbprintAlgorithm="sha1" />
134-
<Certificate name="DataEncryptionPrimary" thumbprint="" thumbprintAlgorithm="sha1" />
135-
```
103+
> [!IMPORTANT]
104+
> At this time, the status database must use the Latin collation (`SQL\_Latin1\_General\_CP1\_CI\_AS`). For more information, see [Windows Collation Name](/sql/t-sql/statements/windows-collation-name-transact-sql).
105+
106+
With Azure SQL Database, the connection string typically is in the form:
107+
108+
`Server=<serverName>.database.windows.net; Database=<databaseName>;User ID=<userId>; Password=<password>; Encrypt=True; Connection Timeout=30`
109+
110+
1. Add additional variables:
136111

137-
For production deployments separate certificates should be used for the CA, for encryption, the Server certificate and client certificates. For detailed instructions on this, see [Security Configuration](elastic-scale-split-merge-security-configuration.md).
112+
| Name | Value |
113+
|----------|----------|
114+
| WorkerRoleSynchronizationStorageAccountConnectionString | Valid connection string to the previously created Azure storage. |
115+
| DataEncryptionPrimaryCertificateThumbprint | Previously generated certificate thumbprint. |
116+
| MetadataExpirationPeriodInMinutes | 20160 |
117+
| MaxRetryCount | 5 |
118+
| WEBSITE_LOAD_CERTIFICATES | * |
138119

139-
## Deploy your service
120+
1. Select **Apply** and restart the application.
140121

141-
1. Go to the [Azure portal](https://portal.azure.com)
142-
1. Select the cloud service that you created earlier.
143-
1. Select **Overview**.
144-
1. Choose the staging environment, then select **Upload**.
145-
1. In the dialog box, enter a deployment label. For both `Package` and `Configuration`, select `From Local` and choose the `SplitMergeService.cspkg` file and your cscfg file that you configured earlier.
146-
1. Ensure that the checkbox labeled **Deploy even if one or more roles contain a single instance** is checked.
147-
1. Hit the check button in the bottom right to begin the deployment. Expect it to take a few minutes to complete.
122+
1. Repeat the same steps for both `worker` and `UI` web app.
148123

149124
## Troubleshoot the deployment
150125

151126
If your web role fails to come online, it's likely a problem with the security configuration. Check that the TLS/SSL is configured as described previously.
152127

153128
If your worker role fails to come online, but your web role succeeds, it's most likely a problem connecting to the status database that you created earlier.
154129

155-
- Make sure that the connection string in your cscfg is accurate.
130+
- Make sure that the connection string is accurate.
156131
- Check that the server and database exist, and that the user ID and password are correct.
157-
- For Azure SQL Database, the connection string should be of the form:
132+
- For Azure SQL Database, the connection string should be in the form:
158133

159-
`Server=<serverName>.database.windows.net; Database=<databaseName>;User ID=<user>; Password=<password>; Encrypt=True; Connection Timeout=30`
134+
`Server=<serverName>.database.windows.net; Database=<databaseName>;User ID=<user>; Password=<password>; Encrypt=True; Connection Timeout=30`
160135

161136
- Ensure that the server name doesn't begin with `https://`.
162-
- Ensure that your server allows Azure Services to connect to it. To do this, open your database in the portal and ensure that the **Allow access to Azure Services** setting is set to **On****.
137+
- Ensure that your server allows Azure Services to connect to it. To do this, open your database in the portal and ensure that the **Allow access to Azure Services** setting is set to **On**.
163138

164139
## Test the service deployment
165140

166141
### Connect with a web browser
167142

168-
Determine the web endpoint of your Split-Merge service. You can find this in the portal by going to the **Overview** of your cloud service and looking under **Site URL** on the right side. Replace `http://` with `https://`, since the default security settings disable the HTTP endpoint. Load the page for this URL into your browser.
143+
Go to the **Overview** of your `UI` Web App and select **Browse**. Choose the correct certificate, if prompted.
169144

170145
### Test with PowerShell scripts
171146

@@ -298,7 +273,7 @@ An example of this can be seen in the SetupSampleSplitMergeEnvironment.ps1 scrip
298273

299274
The Split-Merge service doesn't create the target database (or schema for any tables in the database) for you. They must be precreated before sending a request to the service.
300275

301-
## Troubleshooting
276+
## Known errors
302277

303278
You might see the following message when running the sample PowerShell scripts:
304279

azure-sql/includes/elastic-scale-include.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ ms.date: 11/25/2018
55
ms.service: azure-sql-database
66
ms.topic: include
77
---
8-
## Additional resources
8+
## Related content
99
Not using elastic database tools yet? Check out our [Getting Started Guide](../database/elastic-scale-get-started.md). For questions, contact us on the [Microsoft Q&A question page for SQL Database](/answers/topics/azure-sql-database.html) and for feature requests, add new ideas or vote for existing ideas in the [SQL Database feedback forum](https://feedback.azure.com/d365community/forum/04fe6ee0-3b25-ec11-b6e6-000d3a4f0da0).

0 commit comments

Comments
 (0)