mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-31 09:35:39 -05:00
Finished Failover Clustering Notebook and preliminary Availability Group Notebook. (#14339)
* WIP changes * toc.yml edit * added first cell to AG page * Changed to SSMS instructions, will need to change steps. * switched back to SQL * added clarification of primary server database requirement. * fixed spaces * split adding nodes to its own page. * more changes * added message for prerequisites step * test with invoke command added * added run direct command to failover cluster notebook * test-cluster temp file added * added module change and changed readme * fixed domain name * fixed escape * Test Cluster changed to comment again due to permissions issue * moved additional failover cluster to first notebook * more cleanup * more changes added * added endpoint url * fixed commas * failover cluster wording changed * added select for sqlvm name * added a check for service account * fixed secure password string * first availability group command added * Current Availability Group Page * small change * configure-ag change * more changes * changes made to notebooks
This commit is contained in:
@@ -59,6 +59,8 @@
|
||||
url: hadr/backup-to-blob
|
||||
- title: Create Failover Cluster
|
||||
url: hadr/configure-failover
|
||||
- title: Create Availability Group
|
||||
url: hadr/configure-ag
|
||||
- title: Offline Migration
|
||||
url: /offline-migration/readme
|
||||
not_numbered: true
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
{
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"name": "powershell",
|
||||
"display_name": "PowerShell",
|
||||
"language": "powershell"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "powershell",
|
||||
"codemirror_mode": "shell",
|
||||
"mimetype": "text/x-sh",
|
||||
"file_extension": ".ps1"
|
||||
}
|
||||
},
|
||||
"nbformat_minor": 2,
|
||||
"nbformat": 4,
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"# Create and Configure Availability Group\n",
|
||||
"\n",
|
||||
"## Description\n",
|
||||
"\n",
|
||||
"Notebook to walk through creating an Availability Group via PowerShell commands"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "ff486dfd-93d4-4a5d-8985-6a352b87ad5e"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"Note: before running the steps below, make sure that the following requirements have been satisfied:\n",
|
||||
"\n",
|
||||
"- Verify host instances of SQL Server each resides on a different node of a single failover cluster.\n",
|
||||
"- Verify server instances met the other server-instance prerequisites.\n",
|
||||
"- All the other Always On availability groups requirements are met and that all recommendations are considered.\n",
|
||||
"- Primary server must have at least one user made database in order to create secondary replicas.\n",
|
||||
"- Domain account must have sysadmin fixed server role, andeither CREATE AVAILABILITY GROUP server permission, ALTER ANY AVAILABILITY GROUP permission, or CONTROL SERVER permission.\n",
|
||||
"\n",
|
||||
"More information can be found in the [Prerequisites for Always On Availability](https://docs.microsoft.com/sql/database-engine/availability-groups/windows/prereqs-restrictions-recommendations-always-on-availability?view=sql-server-ver15).\n",
|
||||
"\n",
|
||||
"SQL Server Failover Cluster Instances (FCI) do not support automatic failover by availability groups, so any availability replica hosted by an FCI can only be configured for manual failover. Here is a listing of variables that will be used to create the availability group:\n",
|
||||
"\n",
|
||||
"| Line # | Name | Description | Example |\n",
|
||||
"| --- | --- | --- | --- |\n",
|
||||
"| 1 | **ResourceGroupName** | Name of existing resource group (RG) hosting the Availability Group. An Azure Resource Group is a collection of Azure resources that share the same permissions, policies, etc. | \"TestRG1\" |\n",
|
||||
"| 9 | **SqlVmName** | Name of the first (primary) SQL server replica added on the domain and used in cluster creation as shown in the previous notebook. | \"Server1\" |\n",
|
||||
"| 2 | **Instance** | Name of the instance hosted on the primary server. If unnamed, by default it is \"MSSQLSERVER\". Include the SQLVM name as part of the path. | \"sqlvmname\\\\MSSQLSERVER\" |\n",
|
||||
"| 3 | **DatabaseNames** | Names of user made databases hosted on the primary server. Databases must not end with AUTO\\_CLOSE, cannot be in another availability group, and cannot be configured for database mirroring. | \"MyDatabase\" |\n",
|
||||
"| 5 | **EndpointURL** | Endpoint URL for a node in the cluster, used to listen for Always On availability group messages from Availability Replicas hosted by other server instances. | \"TCP://PrimaryComputer.domain.com:5022\" |\n",
|
||||
"| 6 | **PrimaryBackupFile** | Backup of a database located on the primary replica, used for restore on secondary replica. | \"\\\\share\\\\backups\\\\MyDatabase.bak\" |\n",
|
||||
"| 7 | **PrimaryBackupLog** | Transaction log of a database located on the primary replica, used for restore on secondary replica. | \"\\\\share\\\\backups\\\\MyDatabase.log\" |"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "1ec5da17-225c-4161-95a9-846ba3fbda57"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"#Set Parameters\r\n",
|
||||
"\r\n",
|
||||
"$ResourceGroupName = \"\"\r\n",
|
||||
"$SqlVmName = \"\"\r\n",
|
||||
"$Instance = \"\"\r\n",
|
||||
"$DatabaseNames = \"\"\r\n",
|
||||
"$EndpointURL = \"TCP://<computer domain address>:5022\"\r\n",
|
||||
"$PrimaryBackupFile = \"\"\r\n",
|
||||
"$PrimaryBackupLog = \"\"\r\n",
|
||||
""
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "4dd15d1c-29fe-44e9-bb1b-7191ec4676ea",
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"output_type": "stream",
|
||||
"name": "stdout",
|
||||
"text": ""
|
||||
}
|
||||
],
|
||||
"execution_count": 2
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"### **Install SQLServer Module**\n",
|
||||
"\n",
|
||||
"###This module is required to run the commands below. **(This process may take a very long time, please wait for the process to finish.)**"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "abb93904-a184-4126-b150-e72790e7476a"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"#Creating temporary file to store Install Module command\r\n",
|
||||
"echo \"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12\" >> InstallModuleCommand.ps1\r\n",
|
||||
"echo \"Install-PackageProvider -Name NuGet -Force\" >> InstallModuleCommand.ps1\r\n",
|
||||
"echo \"Install-Module -Name SqlServer -AllowClobber -Force\" >> InstallModuleCommand.ps1\r\n",
|
||||
"\r\n",
|
||||
"#Running command on SQL VM\r\n",
|
||||
"$run = Invoke-AzVMRunCommand -ResourceGroupName $ResourceGroupName -VMName $SqlVmName -CommandId \"RunPowerShellScript\" -ScriptPath \"InstallModuleCommand.ps1\"\r\n",
|
||||
"Write-Output $run\r\n",
|
||||
"\r\n",
|
||||
"#Deleting Test-Cluster temporary file.\r\n",
|
||||
"if (Test-Path \"InstallModuleCommand.ps1\") {\r\n",
|
||||
" Remove-Item \"InstallModuleCommand.ps1\"\r\n",
|
||||
"}"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "44d71a3e-937b-4d7f-b77b-03dbc063d6b0",
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"execution_count": null
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"### **Create in-memory representation of the primary replica. (To be added)**"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "5e4f50b8-2762-44b5-9cb3-9e1c2b20be81"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# To be added. "
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "d203ace2-52ab-400f-8f3c-121cebaf45c3"
|
||||
},
|
||||
"outputs": [],
|
||||
"execution_count": null
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -37,25 +37,24 @@
|
||||
"- One or more domain joined VMs in Azure running SQL Server 2016 (or later) in the _same_ availability set or _different_ availability zones that have been registered with the SQL IaaS Agent extension\n",
|
||||
"- Domain joined VMs must have either a \"Enterprise\" or \"Developer\" image SKU to create a cluster in this notebook\n",
|
||||
"\n",
|
||||
"Tutorial on how to set up a domain with VMs can be found [here.](https://docs.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/availability-group-manually-configure-prerequisites-tutorial)\n",
|
||||
"Refer to the Tutorial on [How to Setup a Domain with VMs in Azure](https://docs.microsoft.com/azure/azure-sql/virtual-machines/windows/availability-group-manually-configure-prerequisites-tutorial) (only follow the steps up to setting the SQL Server Service Accounts)\n",
|
||||
"\n",
|
||||
"Here is a listing of variables that will be used to create the failover cluster:\n",
|
||||
"\n",
|
||||
"| Line # | Name | Example | Description |\n",
|
||||
"| Line # | Name | Description | Example |\n",
|
||||
"| --- | --- | --- | --- |\n",
|
||||
"| 1 | **ResourceGroup** | \"TestRG1\" | Name of new or existing resource group (RG). An Azure Resource Group is a collection of Azure resources that share the same permissions, policies, etc. |\n",
|
||||
"| 2 | **Location** | \"East US\" | Value representing the region or location of the RG. See [Azure Geographies](https://azure.microsoft.com/en-us/global-infrastructure/geographies/ \"https://azure.microsoft.com/en-us/global-infrastructure/geographies/\") for more information. |\n",
|
||||
"| 3 | **PublisherName** | \"MicrosoftSQLServer\" | Name of publisher that offers SQL Server configurations that can be installed on virtual machines. Default is MicrosoftSQLServer |\n",
|
||||
"| 4 | **StorageAccountName** | \"TestStorageAccount\" | Name of the storage account that will be used as a file share witness. See [Cloud Witness](https://docs.microsoft.com/en-us/windows-server/failover-clustering/deploy-cloud-witness) for more information. |\n",
|
||||
"| 5 | **StorageSku** | \"Standard_LRS\" | Name of SKU for a storage account. There are SKUs for different types of storage such as Standard_LRS for Standard Locally Redundant Storage. See [Storage Redundancy](https://docs.microsoft.com/en-us/azure/storage/common/storage-redundancy) for more information. |\n",
|
||||
"| 6 | **ClusterName** | \"TestCluster\" | Name of the failover cluster that will be created. A failover cluster is a group of independent computers that work together to increase the availability and scalability of clustered roles. See [Failover Cluster](https://docs.microsoft.com/en-us/windows-server/failover-clustering/failover-clustering-overview) for more information. |\n",
|
||||
"| 7 | **FQDN** | \"test.domain.com\" | Fully Qualified Domain Name, this localized URL address is created as shown in the domain setup. |\n",
|
||||
"| 8 | **ServerSku** | \"SQL2016SP1-WS2016\" | SQL Server SKU offer name. The SKU determines the edition and operating system of a SQL Server VM. Use the same type of SKU for all SQL VMs in the domain. Make sure to use Developer or Enterprise edition when creating the SQL VMs. |\n",
|
||||
"| 9 | **SqlVm1Name** | \"Server1\" | Name of the first SQL server added on the domain as shown in the domain setup. |\n",
|
||||
"| 10 | **SqlVm2Name** | \"Server2\" | Name of the second SQL server added on the domain (more SQL servers can be added to the cluster as explained below) |\n",
|
||||
"| 11 | **ServiceAccount** | \"serviceaccount@domain.com\" | Username for the SQL server service account for the domain (password is required to run commands). Any active directory account with sufficient permissions such as the installation account may be used as the service account. |\n",
|
||||
"| 12 | **OperatorAccount** | \"operatoraccount@domain.com\" | Username for the cluster operator account, may or may not be the same as the service account. |\n",
|
||||
"| 13 | **BootstrapAccount** | \"bootstrapaccount@domain.com\" | Username for the bootstrap account, may or may not be the same as the service account |",
|
||||
"| 1 | **Subscription** | Azure Subscription ID/Name with permission to host a domain. | ToolsSubscription_1234 |\n"
|
||||
"| 2 | **ResourceGroup** | Name of new or existing resource group (RG). An Azure Resource Group is a collection of Azure resources that share the same permissions, policies, etc. | \"TestRG1\" |\n",
|
||||
"| 3 | **Location** | Value representing the region or location of the RG. See [Azure Geographies](https://azure.microsoft.com/global-infrastructure/geographies/) for more information. | \"East US\" |\n",
|
||||
"| 4 | **Publisher** | Name of publisher that offers SQL Server configurations that can be installed on virtual machines. Default is MicrosoftSQLServer | \"MicrosoftSQLServer\" |\n",
|
||||
"| 5 | **StorageAccountName** | Name of the storage account that will be used as a file share witness. See [Cloud Witness](https://docs.microsoft.com/windows-server/failover-clustering/deploy-cloud-witness) for more information. | \"TestStorageAccount\" |\n",
|
||||
"| 6 | **StorageSku** | Name of SKU for a storage account. There are SKUs for different types of storage such as Standard\\_LRS for Standard Locally Redundant Storage. See [Storage Redundancy](https://docs.microsoft.com/azure/storage/common/storage-redundancy) for more information. | \"Standard\\_LRS\" |\n",
|
||||
"| 7 | **ClusterName** | Name of the failover cluster that will be created. A failover cluster is a group of independent computers that work together to increase the availability and scalability of clustered roles. See [Failover Cluster](https://docs.microsoft.com/windows-server/failover-clustering/failover-clustering-overview) for more information. | \"TestCluster\" |\n",
|
||||
"| 8 | **FQDN** | Fully Qualified Domain Name, this localized URL address is created as shown in the domain setup. | \"domain.testsite.com\" |\n",
|
||||
"| 9 | **ServerSku** | Edition of SQL Server, each has different capabilities based on purpose, only supported versions are Enterprise or Developer. | \"Enterprise\" |\n",
|
||||
"| 10 | **ServiceAccount** | Username for the SQL server service account for the domain (password is required to run commands). Any active directory account with sufficient permissions such as the installation account may be used as the service account. (will be used on all SQL VMs running in the cluster) | \"serviceaccount@domain.testsite.com\" |\n",
|
||||
"| 11 | **OperatorAccount** | Username for the cluster operator account, may or may not be the same as the service account. (will be used on all SQL VMs running in the cluster) | \"operatoraccount@domain.testsite.com\" |\n",
|
||||
"| 12 | **BootstrapAccount** | Username for the bootstrap account, may or may not be the same as the service account. (will be used on all SQL VMs running in the cluster) | \"bootstrapaccount@domain.testsite.com\" |"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "b911ea4f-a3d8-4ac1-bff6-6c5eb1b514f9"
|
||||
@@ -65,30 +64,27 @@
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"#Set general parameters\r\n",
|
||||
"$ResourceGroupName = \"\" # Resource group name (it should be case insensitive)\r\n",
|
||||
"$Location = \"\" # Specify the valid Location such as 'West US 2','EASTUS' etc...\r\n",
|
||||
"$PublisherName = \"\" # Name of Publisher, Default would be 'MicrosoftSQLServer'\r\n",
|
||||
"$Subscription = \"\"\r\n"
|
||||
"$ResourceGroup = \"\"\r\n"
|
||||
"$Location = \"\"\r\n"
|
||||
"$Publisher = \"\"\r\n"
|
||||
"\r\n",
|
||||
"#Create Storage Account\r\n",
|
||||
"$StorageAccountName = \"\" # Name of Storage Account used for cloud witness.\r\n",
|
||||
"$StorageSku = \"\" # Specify a valid storage SKU...Such as 'Standard_LRS'\r\n",
|
||||
"$StorageAccountName = \"\"\r\n",
|
||||
"$StorageSku = \"\"\r\n",
|
||||
"\r\n",
|
||||
"#Define Cluster Media\r\n",
|
||||
"$ClusterName = \"\" # The name of the SQL VM Cluster.\r\n",
|
||||
"$FQDN = \"\" # Name of the domain set by Domain Controller.\r\n",
|
||||
"$ServerSku = \"\" # SKU of Servers, must be either \"Enterprise\" or \"Developer\".\r\n",
|
||||
"$ClusterName = \"\"\r\n",
|
||||
"$FQDN = \"\"\r\n",
|
||||
"$ServerSku = \"\"\r\n",
|
||||
"\r\n",
|
||||
"#Add VMs to the cluster\r\n",
|
||||
"$SqlVm1Name = \"\" # The name of the first SQL VM.\r\n",
|
||||
"$SqlVm2Name = \"\" # The name of the second SQL VM.\r\n",
|
||||
"$ServiceAccount = \"\" # SQL Server Service account\r\n",
|
||||
"$ServiceAccountPassword = \"\" # Password for SQL Server Service Account\r\n",
|
||||
"$OperatorAccount = \"\" # Cluster Operator Account (may be same or different as Service Account)\r\n",
|
||||
"$OperatorAccountPassword = \"\" # Password for Cluster Operator Account\r\n",
|
||||
"$BootstrapAccount = \"\" # Bootstrap Account (may be same or different as Service Account)\r\n",
|
||||
"$BootstrapAccountPassword = \"\" # Password for Bootstrap Account\r\n",
|
||||
"\r\n",
|
||||
"$SqlPath = \"sqlserver:\\sql\\$($env:COMPUTERNAME)\" #This script will generate Sql Path"
|
||||
"$ServiceAccount = \"\"\r\n",
|
||||
"$ServiceAccountPassword = \"\"\r\n",
|
||||
"$OperatorAccount = \"\"\r\n",
|
||||
"$OperatorAccountPassword = \"\"\r\n",
|
||||
"$BootstrapAccount = \"\"\r\n",
|
||||
"$BootstrapAccountPassword = \"\"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "7ad525ec-4993-4e14-9677-4f77433b2123",
|
||||
@@ -116,29 +112,8 @@
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"### <b>Sign in to Azure </b>\r\n",
|
||||
"Sign in to your Azure Subscription with the _Connect-AzAccount_ command and follow the on-screen directions."
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "5dd9519d-3957-46ef-8988-440a043535b2"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"Connect-AzAccount"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "18c920f2-a19a-49d6-9766-2d7539f6fe43"
|
||||
},
|
||||
"outputs": [],
|
||||
"execution_count": null
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"### <b>Get Subscription</b>\r\n",
|
||||
"Below command will open a _**Dialouge Box**_ with list of subscriptions. Selecting one of those will set that Subscription for rest of the commands."
|
||||
"### **Set Subscription**\r\n",
|
||||
"Set the subscription for rest of the commands."
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "cc6cb8c6-76b7-41a0-ab26-7713e72c2f7d"
|
||||
@@ -147,8 +122,12 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"$Subscription = Get-AzSubscription | Out-GridView -PassThru\r\n",
|
||||
"Set-AzContext -SubscriptionName $Subscription"
|
||||
"if(!$Subscription){\r\n",
|
||||
" $Subscription = Get-AzSubscription | Out-GridView -PassThru\r\n",
|
||||
"}\r\n",
|
||||
"\r\n",
|
||||
"Set-AzContext -SubscriptionName $Subscription\r\n",
|
||||
"Connect-AzAccount -Subscription $Subscription"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "741c35fa-7923-4200-8c3a-497d62b4ae66"
|
||||
@@ -160,7 +139,7 @@
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"\r\n",
|
||||
"### <b>Create a resource group</b>\r\n",
|
||||
"### **Create a resource group**\r\n",
|
||||
"Create an Azure resource group with _New-AzResourceGroup_. A resource group is a logical container into which Azure resources are deployed and managed."
|
||||
],
|
||||
"metadata": {
|
||||
@@ -171,13 +150,11 @@
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# Create Azure resource group, if necessary\r\n",
|
||||
"$ResourceGroup = Get-AzResourceGroup -Name $ResourceGroupName\r\n",
|
||||
"\r\n",
|
||||
"if (!$ResourceGroup)\r\n",
|
||||
"if (!(Get-AzResourceGroup -Name $ResourceGroup))\r\n",
|
||||
"{\r\n",
|
||||
" # Need to create a new resource group\r\n",
|
||||
" Write-Output \"Resource Group $ResourceGroupName does not exist. Creating...\"\r\n",
|
||||
" $ResourceGroup = New-AzResourceGroup -Name $ResourceGroupName -Location $Location\r\n",
|
||||
" Write-Output \"Resource Group $ResourceGroup does not exist. Creating...\"\r\n",
|
||||
" New-AzResourceGroup -Name $ResourceGroup -Location $Location\r\n",
|
||||
"}"
|
||||
],
|
||||
"metadata": {
|
||||
@@ -189,7 +166,7 @@
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"### <b>Create a storage account</b>\r\n",
|
||||
"### **Create a storage account**\r\n",
|
||||
"Create a standard, general-purpose storage account with LRS replication by using _New-AzStorageAccount_. Next, get the storage account context that defines the storage account you want to use. When acting on a storage account, reference the context instead of repeatedly passing in the credentials. Use the following example to create a storage account called storageaccountazure with locally redundant storage (LRS) and blob encryption (enabled by default)."
|
||||
],
|
||||
"metadata": {
|
||||
@@ -199,7 +176,7 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"$StorageAccount = New-AzStorageAccount -ResourceGroupName $ResourceGroupName -Name $StorageAccountName `\r\n",
|
||||
"$StorageAccount = New-AzStorageAccount -ResourceGroupName $ResourceGroup -Name $StorageAccountName `\r\n",
|
||||
" -SkuName $StorageSku -Location $Location -Kind StorageV2 `\r\n",
|
||||
" -AccessTier Hot -EnableHttpsTrafficOnly $true\r\n",
|
||||
"\r\n",
|
||||
@@ -214,7 +191,7 @@
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"### <b>Create a container</b>\r\n",
|
||||
"### **Create a container**\r\n",
|
||||
"Blobs are always uploaded into a container. Blobs can be organized in groups like files in folders.\r\n",
|
||||
"Set the container name, then create the container by using _New-AzStorageContainer_. Set the permissions to blob to allow public access of the files. The container name in this example is quickstartblobs."
|
||||
],
|
||||
@@ -238,7 +215,7 @@
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"### <b>Get Azure Storage Acount Key</b>\r\n",
|
||||
"### **Get Azure Storage Acount Key**\r\n",
|
||||
"This script will get the key for Storage Account which is been created."
|
||||
],
|
||||
"metadata": {
|
||||
@@ -250,7 +227,7 @@
|
||||
"source": [
|
||||
"$StorageAccountKey = `\r\n",
|
||||
" (Get-AzStorageAccountKey `\r\n",
|
||||
" -ResourceGroupName $ResourceGroupName `\r\n",
|
||||
" -ResourceGroupName $ResourceGroup `\r\n",
|
||||
" -Name $StorageAccountName).Value[0]"
|
||||
],
|
||||
"metadata": {
|
||||
@@ -263,7 +240,7 @@
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"### <b>Get Azure Storage Container Uri</b>\r\n",
|
||||
"### **Get Azure Storage Container Uri**\r\n",
|
||||
"The following script can be used to get the Uri of Storage container."
|
||||
],
|
||||
"metadata": {
|
||||
@@ -273,7 +250,7 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
" $StorageUri = (Get-AzStorageAccount -ResourceGroupName $ResourceGroupName -Name $StorageAccountName | Get-AzStorageContainer | Where-Object { $_.Name -eq $AzureContainerName }).CloudBlobContainer.Uri.AbsoluteUri "
|
||||
" $StorageUri = (Get-AzStorageAccount -ResourceGroupName $ResourceGroup -Name $StorageAccountName | Get-AzStorageContainer | Where-Object { $_.Name -eq $AzureContainerName }).CloudBlobContainer.Uri.AbsoluteUri "
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "615d8e6e-2cbf-4001-8da0-1826185a06bf"
|
||||
@@ -288,7 +265,7 @@
|
||||
"\n",
|
||||
"Run the following command to get updated list of offers for Microsoft SQL Server in your location. Pick the offer that matches the operating system version of the VM servers.\n",
|
||||
"\n",
|
||||
"Note that the SQL Version is first then appended with an operating system version. E.g.: \"WS2019\" means Windows Server 2019. Along with various versions of Windows Servers, there are also enterprise Linux versions such as RedHat Enterprise, Suse Enterprise, and Ubuntu. Some versions are BYOL (Bring Your Own License) aka [Hybrid Benefit](https://azure.microsoft.com/en-us/pricing/hybrid-benefit/)."
|
||||
"Note that the SQL Version is first then appended with an operating system version. E.g.: \"WS2019\" means Windows Server 2019. Along with various versions of Windows Servers, there are also enterprise Linux versions such as RedHat Enterprise, Suse Enterprise, and Ubuntu. Some versions are BYOL (Bring Your Own License) aka [Hybrid Benefit](https://azure.microsoft.com/pricing/hybrid-benefit/)."
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "c17d224e-e514-4dfd-b181-06d2cde378e4"
|
||||
@@ -297,7 +274,7 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"$Offer = Get-AzVMImageOffer -Location $Location -Publisher $PublisherName | Out-GridView -PassThru"
|
||||
"$Offer = Get-AzVMImageOffer -Location $Location -Publisher $Publisher | Out-GridView -PassThru"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "6b2fa291-43cb-4619-a010-3a373dababcc"
|
||||
@@ -321,9 +298,17 @@
|
||||
"source": [
|
||||
"$StorageAccountUrl = \"https://$StorageAccountName.blob.core.windows.net/\"\r\n",
|
||||
"$SecureSAKey = ConvertTo-SecureString $StorageAccountKey -AsPlainText -Force\r\n",
|
||||
"if($OperatorAccount -eq \"\"){\r\n",
|
||||
" $OperatorAccount = $ServiceAccount\r\n",
|
||||
" $SecureOAPassword = ConvertTo-SecureString $ServiceAccountPassword -AsPlainText -Force\r\n",
|
||||
"}\r\n",
|
||||
"if($BootstrapAccount -eq \"\"){\r\n",
|
||||
" $BootstrapAccount = $ServiceAccount\r\n",
|
||||
" $SecureBAPassword = ConvertTo-SecureString $ServiceAccountPassword -AsPlainText -Force\r\n",
|
||||
"}\r\n",
|
||||
"\r\n",
|
||||
"$group = New-AzSqlVMGroup -Name $ClusterName -Location $Location `\r\n",
|
||||
" -ResourceGroupName $ResourceGroupName -Offer $Offer.Offer `\r\n",
|
||||
" -ResourceGroupName $ResourceGroup -Offer $Offer.Offer `\r\n",
|
||||
" -Sku $ServerSku -DomainFqdn $FQDN -ClusterOperatorAccount $OperatorAccount `\r\n",
|
||||
" -ClusterBootstrapAccount $BootstrapAccount -SqlServiceAccount $ServiceAccount `\r\n",
|
||||
" -StorageAccountUrl $StorageAccountUrl `\r\n",
|
||||
@@ -339,9 +324,9 @@
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"### **Add VMs to the cluster**\n",
|
||||
"### **Select a VM to add to the cluster**\n",
|
||||
"\n",
|
||||
"Adding the first SQL Server VM to the cluster creates the cluster. The <mark>Update-AzSqlVM</mark> command creates the cluster with the name previously given, installs the cluster role on the SQL Server VMs, and adds them to the cluster. Subsequent uses of the command adds more SQL Server VMs to the newly created cluster. <b>(This will take some time, please wait for the process to finish.)</b>"
|
||||
"Selecting and adding the first SQL Server VM to the cluster creates the cluster. Additional SQL Server VM nodes can be added by running this cell again. **(This will take some time, please wait for the process to finish.)**"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "cca91ca6-bf10-4e32-9b4f-80133049c1b5"
|
||||
@@ -350,25 +335,21 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"$sqlvm1 = Get-AzSqlVM -Name $SqlVm1Name -ResourceGroupName $ResourceGroupName\r\n",
|
||||
"$sqlvm2 = Get-AzSqlVM -Name $SqlVm2Name -ResourceGroupName $ResourceGroupName\r\n",
|
||||
"$SecureOAPassword = ConvertTo-SecureString $OperatorAccountPassword -AsPlainText -Force\r\n",
|
||||
"$sqlvm = Get-AzSqlVM -ResourceGroupName $ResourceGroup | Out-GridView -PassThru\r\n",
|
||||
"$SecureSAPassword = ConvertTo-SecureString $ServiceAccountPassword -AsPlainText -Force\r\n",
|
||||
"$SecureBAPassword = ConvertTo-SecureString $BootstrapAccountPassword -AsPlainText -Force\r\n",
|
||||
"if(!$SecureOAPassword){\r\n",
|
||||
" $SecureOAPassword = $SecureSAPassword\r\n",
|
||||
"}\r\n",
|
||||
"if(!$SecureBAPassword){\r\n",
|
||||
" $SecureBAPassword = $SecureSAPassword\r\n",
|
||||
"}\r\n",
|
||||
"\r\n",
|
||||
"$sqlvmconfig1 = Set-AzSqlVMConfigGroup -SqlVM $sqlvm1 `\r\n",
|
||||
"$sqlvmconfig = Set-AzSqlVMConfigGroup -SqlVM $sqlvm `\r\n",
|
||||
" -SqlVMGroup $group -ClusterOperatorAccountPassword $SecureOAPassword `\r\n",
|
||||
" -SqlServiceAccountPassword $SecureSAPassword `\r\n",
|
||||
" -ClusterBootstrapAccountPassword $SecureBAPassword\r\n",
|
||||
"\r\n",
|
||||
"Update-AzSqlVM -ResourceId $sqlvm1.ResourceId -SqlVM $sqlvmconfig1\r\n",
|
||||
"\r\n",
|
||||
"$sqlvmconfig2 = Set-AzSqlVMConfigGroup -SqlVM $sqlvm2 `\r\n",
|
||||
" -SqlVMGroup $group -ClusterOperatorAccountPassword $SecureOAPassword `\r\n",
|
||||
" -SqlServiceAccountPassword $SecureSAPassword `\r\n",
|
||||
" -ClusterBootstrapAccountPassword $SecureBAPassword\r\n",
|
||||
"\r\n",
|
||||
"Update-AzSqlVM -ResourceId $sqlvm2.ResourceId -SqlVM $sqlvmconfig2"
|
||||
"Update-AzSqlVM -ResourceId $sqlvm.ResourceId -SqlVM $sqlvmconfig"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "9b21ab69-5be2-4d09-ac4b-3d43521a1188",
|
||||
@@ -380,26 +361,30 @@
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"### **Validate cluster (done locally on server)**\n",
|
||||
"### **Validate Failover Cluster**\n",
|
||||
"\n",
|
||||
"Connect to a SQL VM in the cluster (ex. RDP) and run the below command via Powershell.\n",
|
||||
"After adding all the nodes to the cluster, connect to the virtual machine (ex. RDP) using an administrator account to run the following command via PowerShell:\n",
|
||||
"\n",
|
||||
"For a failover cluster to be supported by Microsoft, it must pass cluster validation. Failure to do so leaves your cluster in an unsupported state."
|
||||
"**Test-Cluster**\n",
|
||||
"\n",
|
||||
"The cluster must pass validation to be supported by Microsoft. Failure to do so leaves your cluster in an unsupported state."
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "63b41df3-6fe6-421e-9587-e5d65a0a5592"
|
||||
"azdata_cell_guid": "3ce199e7-f88f-4592-b61c-e03ed2c7235a"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"Test-Cluster"
|
||||
"### **Post cluster creation steps**\n",
|
||||
"\n",
|
||||
"You can add additional nodes in the following notebook, then verify after doing so.\n",
|
||||
"\n",
|
||||
"Once all the desired SQL VMs in the domain have been added as nodes and the cluster verified, proceed to creating the [availability group](.\\configure-ag.ipynb)"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "e195e874-6178-4f87-b5e8-94524cbc6ea1"
|
||||
},
|
||||
"outputs": [],
|
||||
"execution_count": null
|
||||
"azdata_cell_guid": "0d7d63f0-ef95-4e40-9139-69957c53e85f"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -11,3 +11,4 @@ Notebooks to help with HADR tasks in a Hybrid Cloud environment.
|
||||
|
||||
### Availability Group Configuration:
|
||||
- [Create Failover Cluster](configure-failover.ipynb)
|
||||
- [Create Availability Group](configure-ag.ipynb)
|
||||
|
||||
@@ -27,7 +27,7 @@ The **Azure SQL Hybrid Cloud Toolkit** is a [Jupyter Book](https://jupyterbook.o
|
||||
## Goals and Methodology
|
||||
The toolkit better positions a customer with regards to planning, migrating, and thriving in a hybrid cloud environment by:
|
||||
|
||||
* Providing SQL'zure users with reliable free software and content that is well-written and executable
|
||||
* Providing SQL Azure users with reliable free software and content that is well-written and executable
|
||||
* Greatly simplifying the integration of Azure Data services into an existing environment
|
||||
* Positioning Azure to be the natural cloud services choice with a low-friction experience
|
||||
* Notebooks are executable by a normal user (unless otherwise specificed) on minimal hardware
|
||||
|
||||
Reference in New Issue
Block a user