使用 powershell 为我的 SQL 服务器创建 Azure DB 的副本
Create replica of Azure DB for my SQL Server using powershell
使用 powershell 为我的 SQL 服务器创建 Azure DB 的副本时出现以下错误。请帮我修复一下。
创建数据库服务器副本的命令:
尝试的第一个命令:
$TargetDBServerName2= 获取-AzMySqlServer -ResourceGroupName $ResourceGroupName -ServerName $TargetDBServerName
新 AzMySqlReplica -Master $TargetDBServerName2 -Replica $TargetDBServerName-replica -ResourceGroupName $ResourceGroupName
尝试了第二条命令:
获取-AzMySqlServer -ResourceGroupName $ResourceGroupName -ServerName $TargetDBServerName | New-AzMySqlReplica -副本 $TargetDBServerName-副本 -ResourceGroupName $ResourceGroupName
当我 运行 第一个命令时出错:
PS /home/praveen> New-AzMySqlReplica -Master $TargetDBServerName2 -Replica $TargetDBServerName-replica -ResourceGroupName $ResourceGroupName
New-AzMySqlServer_Create: /usr/local/share/powershell/Modules/Az.MySql/1.0.0/custom/New-AzMySqlReplica.ps1:139
线 |
139 | Az.MySql.internal\New-AzMySqlServer @PS绑定参数
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~
|处理请求时发生意外错误。跟踪 ID:'0268ff12-7c60-49de-8de5-ccdb844d8329'
当我 运行 第二个命令时出错:
PS /home/praveen> Get-AzMySqlServer -ResourceGroupName $ResourceGroupName -ServerName $TargetDBServerName | New-AzMySqlReplica -Replica $TargetDBServerName-replica -ResourceGroupName $ResourceGroupName
New-AzMySqlServer_Create: /usr/local/share/powershell/Modules/Az.MySql/1.0.0/custom/New-AzMySqlReplica.ps1:139
线 |
139 | Az.MySql.internal\New-AzMySqlServer @PS绑定参数
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~
|处理请求时发生意外错误。跟踪 ID:'3aea208b-0a59-4be9-ad95-aef3593b2c71'
The read replica feature is only available for Azure Database for MySQL servers in the General Purpose or Memory Optimized pricing tiers. Ensure the source server is in one of these pricing tiers.
浏览器中的Az PowerShell module installed locally or Azure Cloud Shell
While the Az.MySql PowerShell module is in preview, you must install
it separately from the Az PowerShell module using the following
command: Install-Module -Name Az.MySql -AllowPrerelease
.
以下命令可用于构建只读副本服务器。
Get-AzMySqlServer -Name mydemoserver -ResourceGroupName myresourcegroup |
New-AzMySqlReplica -Name mydemoreplicaserver -ResourceGroupName myresourcegroup
myresourcegroup : 创建副本服务器的资源组。
mydemoreplicaserver : 创建的新副本服务器的名称。
Depending on the storage utilised (v1/v2), your source server may need to restart to ready itself for replication if there are no current replica servers. Please consider restarting the server and do so at off-peak hours. For further information, see Source Server Restart.
有关详细信息,请参阅此 document。
使用 powershell 为我的 SQL 服务器创建 Azure DB 的副本时出现以下错误。请帮我修复一下。
创建数据库服务器副本的命令:
尝试的第一个命令:
$TargetDBServerName2= 获取-AzMySqlServer -ResourceGroupName $ResourceGroupName -ServerName $TargetDBServerName 新 AzMySqlReplica -Master $TargetDBServerName2 -Replica $TargetDBServerName-replica -ResourceGroupName $ResourceGroupName
尝试了第二条命令:
获取-AzMySqlServer -ResourceGroupName $ResourceGroupName -ServerName $TargetDBServerName | New-AzMySqlReplica -副本 $TargetDBServerName-副本 -ResourceGroupName $ResourceGroupName
当我 运行 第一个命令时出错:
PS /home/praveen> New-AzMySqlReplica -Master $TargetDBServerName2 -Replica $TargetDBServerName-replica -ResourceGroupName $ResourceGroupName
New-AzMySqlServer_Create: /usr/local/share/powershell/Modules/Az.MySql/1.0.0/custom/New-AzMySqlReplica.ps1:139
线 |
139 | Az.MySql.internal\New-AzMySqlServer @PS绑定参数
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~
|处理请求时发生意外错误。跟踪 ID:'0268ff12-7c60-49de-8de5-ccdb844d8329'
当我 运行 第二个命令时出错:
PS /home/praveen> Get-AzMySqlServer -ResourceGroupName $ResourceGroupName -ServerName $TargetDBServerName | New-AzMySqlReplica -Replica $TargetDBServerName-replica -ResourceGroupName $ResourceGroupName
New-AzMySqlServer_Create: /usr/local/share/powershell/Modules/Az.MySql/1.0.0/custom/New-AzMySqlReplica.ps1:139
线 |
139 | Az.MySql.internal\New-AzMySqlServer @PS绑定参数
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~
|处理请求时发生意外错误。跟踪 ID:'3aea208b-0a59-4be9-ad95-aef3593b2c71'
The read replica feature is only available for Azure Database for MySQL servers in the General Purpose or Memory Optimized pricing tiers. Ensure the source server is in one of these pricing tiers.
浏览器中的Az PowerShell module installed locally or Azure Cloud Shell
While the Az.MySql PowerShell module is in preview, you must install it separately from the Az PowerShell module using the following command:
Install-Module -Name Az.MySql -AllowPrerelease
.
以下命令可用于构建只读副本服务器。
Get-AzMySqlServer -Name mydemoserver -ResourceGroupName myresourcegroup |
New-AzMySqlReplica -Name mydemoreplicaserver -ResourceGroupName myresourcegroup
myresourcegroup : 创建副本服务器的资源组。
mydemoreplicaserver : 创建的新副本服务器的名称。
Depending on the storage utilised (v1/v2), your source server may need to restart to ready itself for replication if there are no current replica servers. Please consider restarting the server and do so at off-peak hours. For further information, see Source Server Restart.
有关详细信息,请参阅此 document。