Azure Stack Hub の MySQL リソース プロバイダーを更新する

重要

Azure Stack Hub ビルド 2108 以降では、アクセスが許可されているサブスクリプションに SQL と MySQL リソース プロバイダーが提供されます。 この機能の使用を開始する場合、または以前のバージョンからアップグレードする必要がある場合は、サポート ケースを開くと、サポート エンジニアがデプロイまたはアップグレード プロセスを説明します。

重要

リソース プロバイダーを更新する前に、新しい機能、修正、およびデプロイに影響を与える可能性のある既知の問題に関する詳細については、リリース ノートを確認してください。 リリース ノートには、リソース プロバイダーに必要な Azure Stack Hub の最小バージョンも指定されています。

重要

リソース プロバイダーを更新しても、ホスティング MySQL Server は更新されません。

Azure Stack Hub が新しいビルドをリリースすると、新しい MySQL リソース プロバイダー アダプターがリリースされる場合があります。 既存のアダプターが動作し続けている場合でも、できるだけ早く最新のビルドに更新することをお勧めします。

サポートされる Azure Stack Hub のバージョン MySQL RP バージョン RP サービスが実行されている Windows Server
2206, 2301, 2306 MySQL RP バージョン 2.0.13.x Microsoft AzureStack Add-on RP Windows Server 1.2009.0
2108, 2206 MySQL RP バージョン 2.0.6.x Microsoft AzureStack Add-on RP Windows Server 1.2009.0

MySQL Server リソース プロバイダー V2 の更新

既に MySQL RP V2 をデプロイしていて、更新プログラムを確認する場合は、リソース プロバイダーに更新プログラムを適用する方法に関するページをご確認ください。

MySQL RP V1 から MySQL RP V2 に更新する場合は、最初に MySQL RP V1.1.93.x に更新してから、メジャー バージョンのアップグレード プロセスを適用して MySQL RP V1 から MySQL RP V2 にアップグレードします。

MySQL RP V1.1.93.x から MySQL RP V2.0.6.0 への更新

前提条件

  1. MySQL RP V1 が最新の 1.1.93.x に更新されていることを確認します。 [既定のプロバイダー サブスクリプション] で RP リソース グループを見つけます (名前付け形式: system.<region>.mysqladapter)。 リソース グループで、バージョン タグと MySQL RP VM 名を確認します。 まだ古いバージョンを使用していて、1.1.93.x に更新する必要がある場合は、サポート ケースを開いてヘルプを参照してください。

  2. サポート ケースを開いて MajorVersionUpgrade パッケージを取得し、お使いのサブスクリプションを今後の V2 バージョンの ASH マーケットプレースの許可リストに追加します。

  3. Microsoft AzureStack Add-On RP Windows Server 1.2009.0 をマーケットプレースにダウンロードします。

  4. Azure Stack Hub がデータセンター統合の前提条件を満たしていることを確認します。

    前提条件 リファレンス
    条件付き DNS フォワーダーが正しく設定されている。 Azure Stack Hub とデータセンターの統合 - DNS
    リソース プロバイダー用の受信ポートが開いている。 Azure Stack Hub データセンターの統合 - ポートとプロトコル (受信)
    PKI 証明書のサブジェクトと SAN が正しく設定されている。 Azure Stack Hub デプロイの必須 PKI 前提条件
    Azure Stack Hub デプロイの PaaS 証明書の前提条件
  5. (切断されている環境の場合) MySQL リソース プロバイダーのデプロイに使用される更新プロセスと同様に、必要な PowerShell モジュールをインストールします。

  6. 必要なバージョンで MySQL コネクタ URI を準備します。 詳細については、MySQL リソースプロバイダーのデプロイに関するページを参照してください。 例: https://<storageAcountName>.blob.<region>.<FQDN>/<containerName>/mysql-connector-net-8.0.21.msi

MajorVersionUpgrade のトリガー

管理者特権の PowerShell コンソールから次のスクリプトを実行して、メジャー バージョンのアップグレードを実行します。

Note

スクリプトを実行するクライアント コンピューターの OS バージョンが Windows 10 または Windows Server 2016 以降であり、クライアント コンピューターに X64 オペレーティング システム アーキテクチャが存在することを確認してください。

重要

デプロイまたは更新スクリプトを実行する前に、Clear-AzureRmContext -Scope CurrentUser および Clear-AzureRmContext -Scope Process を使用してキャッシュをクリアすることを強くお勧めします。

# Check Operating System version
$osVersion = [environment]::OSVersion.Version
if ($osVersion.Build -lt 10240)
{
    Write-Host "OS version is too old: $osVersion."
    return
}

$osArch = (Get-WmiObject Win32_OperatingSystem).OSArchitecture
if ($osArch -ne "64-bit")
{
    Write-Host "OS Architecture is not 64 bit."
    return
}

# Check LongPathsEnabled registry key
$regPath = 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem'
$longPathsEnabled = 'LongPathsEnabled'
$property = Get-ItemProperty -Path $regPath -Name $longPathsEnabled -ErrorAction Stop
if ($property.LongPathsEnabled -eq 0)
{
    Write-Host "Detect LongPathsEnabled equals to 0, prepare to set the property."
    Set-ItemProperty -Path $regPath -Name $longPathsEnabled -Value 1 -ErrorAction Stop
    Write-Host "Set the long paths property, please restart the PowerShell."
    return
} 

# Use the NetBIOS name for the Azure Stack Hub domain. 
$domain = "YouDomain" 
# For integrated systems, use the IP address of one of the ERCS VMs
$privilegedEndpoint = "YouDomain-ERCS01"
# Provide the Azure environment used for deploying Azure Stack Hub. Required only for Azure AD deployments. Supported values for the <environment name> parameter are AzureCloud, AzureChinaCloud, or AzureUSGovernment depending which Azure subscription you're using.
$AzureEnvironment = "AzureCloud"
# Point to the directory where the resource provider installation files were extracted.
$tempDir = 'C:\extracted-folder\MajorVersionUpgrade-MySQLRP'
# The service admin account can be Azure Active Directory or Active Directory Federation Services.
$serviceAdmin = "admin@mydomain.onmicrosoft.com"
$AdminPass = ConvertTo-SecureString 'xxxxxxxx' -AsPlainText -Force
$AdminCreds = New-Object System.Management.Automation.PSCredential ($serviceAdmin, $AdminPass)
# Add the cloudadmin credential that's required for privileged endpoint access.
$CloudAdminPass = ConvertTo-SecureString 'xxxxxxxx' -AsPlainText -Force
$CloudAdminCreds = New-Object System.Management.Automation.PSCredential ("$domain\cloudadmin", $CloudAdminPass)
# Change the following as appropriate.
$PfxPass = ConvertTo-SecureString 'xxxxxxx' -AsPlainText -Force
# Provide the pfx file path
$PfxFilePath = "C:\tools\mysqlcert\SSL.pfx"
# Local blob uri where stores the required mysql connector
$MySQLConnector = "Provide the MySQL Connector Uri according to Prerequisites step."
# PowerShell modules used by the RP MajorVersionUpgrade are placed in C:\Program Files\SqlMySqlPsh
# The deployment script adds this path to the system $env:PSModulePath to ensure correct modules are used.
$rpModulePath = Join-Path -Path $env:ProgramFiles -ChildPath 'SqlMySqlPsh'
$env:PSModulePath = $env:PSModulePath + ";" + $rpModulePath 
. $tempDir\MajorVersionUpgradeMySQLProvider.ps1 -AzureEnvironment $AzureEnvironment -AzCredential $AdminCreds -CloudAdminCredential $CloudAdminCreds -Privilegedendpoint $privilegedEndpoint -PfxPassword $PfxPass -PfxCert $PfxFilePath -MySQLConnector $MySQLConnector

Note

DNS アドレスと、MySQL RP V2 の対応する IP アドレスは異なります。 新しいパブリック IP を取得するには、サポートに連絡して DRP ブレーク グラスを要求し、MySQLRPVM1130-PublicIP リソースを見つけます。 また、既にエンドポイント テストに合格したクライアント コンピューターから "nslookup mysqlrp.dbadapter.<fqdn>" を実行してパブリック IP を確認することもできます。

アップグレードが成功したことを検証する

  1. MajorVersionUpgrade スクリプトがエラーなしで実行されました。
  2. マーケットプレースのリソース プロバイダーをチェックし、MySQL RP 2.0 が正常にインストールされていることを確認します。
  3. 既定のプロバイダー サブスクリプションの古い system.location>.mysqladapter リソース グループと > リソース グループは、スクリプトによって自動的に削除されません。
  • ストレージ アカウントとKey Vaultは、しばらく mysqladapter リソース グループに保持することをお勧めします。 アップグレード後に、テナント ユーザーが一貫性のないデータベースまたはログイン メタデータを確認した場合、リソース グループからメタデータを復元するサポートを受ける可能性があります。
  • dbadapter.dns リソース グループ内の DNS ゾーンが DNS レコードがない空であることを確認したら、dbadapter.dns リソース グループを削除しても問題ありません。
  • [重要] V1 デプロイ スクリプトを使用して V1 バージョンをアンインストールしないでください。 アップグレードが完了し、アップグレードが正常に完了したことを確認したら、プロバイダー サブスクリプションからリソース グループを手動で削除できます。

MySQL RP V1 以前のバージョンから MySQL RP V1.1.93.x への更新

MySQL リソース プロバイダー V1 の更新プログラムは累積的です。 1.1.93.x バージョンに直接更新することができます。

リソース プロバイダーを 1.1.93.x に更新するには UpdateMySQLProvider.ps1 スクリプトを使用します。 ローカル管理権限を持ち、サブスクリプションの所有者であるサービス アカウントを使用します。 この更新スクリプトは、リソース プロバイダーのダウンロードに含まれています。

リソース プロバイダーを更新するには UpdateMySQLProvider.ps1 スクリプトを使用します。 ローカル管理権限を持ち、サブスクリプションの所有者であるサービス アカウントを使用します。 更新スクリプトは、リソース プロバイダーのダウンロードに含まれています。

更新プロセスは、リソース プロバイダーを展開するために使用されるプロセスに似ています。 更新スクリプトは DeployMySqlProvider.ps1 スクリプトと同じ引数を使用するため、証明書情報を提供する必要があります。

更新スクリプトのプロセス

UpdateMySQLProvider.ps1 スクリプトにより、最新の OS イメージを使用して新しい仮想マシン (VM) が作成され、最新のリソース プロバイダーのコードがデプロイされて、古いリソース プロバイダーから新しいリソース プロバイダーに設定が移行されます。

Note

Marketplace Management から Microsoft AzureStack Add-on RP Windows Server 1.2009.0 イメージをダウンロードすることをお勧めします。 更新プログラムをインストールする必要がある場合は、ローカルの依存関係のパスに MSU パッケージを 1 つ配置できます。 この場所に複数の MSU ファイルがある場合、スクリプトは失敗します。

UpdateMySQLProvider.ps1 スクリプトにより、新しい VM が作成された後、このスクリプトによって古いリソース プロバイダー VM から次の設定が移行されます。

  • データベース情報
  • ホスティング サーバー情報
  • 必要な DNS レコード

重要

デプロイまたは更新スクリプトを実行する前に、Clear-AzureRmContext -Scope CurrentUser および Clear-AzureRmContext -Scope Process を使用してキャッシュをクリアすることを強くお勧めします。

更新スクリプトのパラメーター

UpdateMySQLProvider.ps1 PowerShell スクリプトを実行するときに、コマンド ラインから以下のパラメーターを指定します。 必須パラメーターの指定がない場合、またはいずれかのパラメーターの検証が失敗した場合は、指定することを求められます。

パラメーター名 説明 コメントまたは既定値
CloudAdminCredential 特権エンドポイントへのアクセスに必要な、クラウド管理者の資格情報。 必須
AzCredential Azure Stack Hub サービス管理者アカウントの資格情報。 Azure Stack Hub のデプロイに使用したのと同じ資格情報を使用します。 AzCredential で使用するアカウントに多要素認証 (MFA) が必要な場合、スクリプトは失敗します。 必須
VMLocalCredential MySQL リソース プロバイダー VM のローカル管理者アカウントの資格情報。 必須
PrivilegedEndpoint 特権エンドポイントの IP アドレスまたは DNS 名。 必須
AzureEnvironment Azure Stack Hub のデプロイに使用するサービス管理者アカウントの Azure 環境。 Microsoft Entraデプロイにのみ必要です。 サポートされている環境名は、AzureCloudAzureUSGovernment、または中国のMicrosoft Entra ID を使用している場合は AzureChinaCloud です AzureCloud
DependencyFilesLocalPath 証明書 .pfx ファイルはこのディレクトリにも配置する必要があります。 省略可能 (マルチノードでは 必須)
DefaultSSLCertificatePassword .pfx 証明書のパスワード。 必須
MaxRetryCount エラーが 発生した場合に各操作を再試行する回数。 2
RetryDuration 再試行間のタイムアウト間隔 (秒単位)。 120
アンインストール リソース プロバイダーと関連付けられているすべてのリソースを削除します (以下のメモを参照してください)。 いいえ
DebugMode 障害発生時に自動クリーンアップが行われないようにします。 いいえ
AcceptLicense GPL ライセンスに同意するためのプロンプトをスキップします。 (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html)

更新スクリプトの例

MySQL リソース プロバイダーのバージョン 1.1.33.0 以前のバージョンを更新する場合は、PowerShell で特定のバージョンの AzureRm.BootStrapper と Azure Stack Hub モジュールをインストールする必要があります。

MySQL リソース プロバイダーを 1.1.47.0 以降のバージョンに更新する場合は、この手順をスキップできます。 デプロイ スクリプトにより、必要な PowerShell モジュールが自動的にダウンロードされ、パス C:\Program Files\SqlMySqlPsh にインストールされます。

Note

PowerShell モジュールがダウンロードされるフォルダー C:\Program Files\SqlMySqlPsh が既に存在する場合は、更新スクリプトを実行する前にこのフォルダーをクリーンアップすることをお勧めします。 これは、適切なバージョンの PowerShell モジュールがダウンロードされて使用されるようにするためです。

# Run the following scripts when updating to version 1.1.33.0 only.
# Install the AzureRM.Bootstrapper module, set the profile and install the AzureStack module.
# Note that this might not be the most currently available version of Azure Stack Hub PowerShell.
Install-Module -Name AzureRm.BootStrapper -Force
Use-AzureRmProfile -Profile 2018-03-01-hybrid -Force
Install-Module -Name AzureStack -RequiredVersion 1.6.0

Note

接続が切断された場合のシナリオでは、必要な PowerShell モジュールのダウンロードと手動でのリポジトリ登録が前提条件として必要です。 詳細については、MySQL リソース プロバイダーのデプロイに関する記事を参照してください。

管理者特権の PowerShell コンソールから実行できる UpdateMySQLProvider.ps1 スクリプトを次に示します。 変数情報とパスワードは、必要に応じて変更してください。

# Use the NetBIOS name for the Azure Stack Hub domain. On the Azure Stack Hub SDK, the default is AzureStack but could have been changed at install time.
$domain = "AzureStack" 

# For integrated systems, use the IP address of one of the ERCS VMs.
$privilegedEndpoint = "AzS-ERCS01" 

# Provide the Azure environment used for deploying Azure Stack Hub. Required only for Azure AD deployments. Supported environment names are AzureCloud, AzureUSGovernment, or AzureChinaCloud. 
$AzureEnvironment = "<EnvironmentName>"

# Point to the directory where the resource provider installation files were extracted. 
$tempDir = 'C:\TEMP\MYSQLRP' 

# The service admin account (can be Azure Active Directory or Active Directory Federation Services).
$serviceAdmin = "admin@mydomain.onmicrosoft.com" 
$AdminPass = ConvertTo-SecureString 'P@ssw0rd1' -AsPlainText -Force 
$AdminCreds = New-Object System.Management.Automation.PSCredential ($serviceAdmin, $AdminPass) 
 
# Set credentials for the new resource provider VM.
$vmLocalAdminPass = ConvertTo-SecureString 'P@ssw0rd1' -AsPlainText -Force 
$vmLocalAdminCreds = New-Object System.Management.Automation.PSCredential ("mysqlrpadmin", $vmLocalAdminPass) 
 
# And the cloudadmin credential required for privileged endpoint access.
$CloudAdminPass = ConvertTo-SecureString 'P@ssw0rd1' -AsPlainText -Force 
$CloudAdminCreds = New-Object System.Management.Automation.PSCredential ("$domain\cloudadmin", $CloudAdminPass) 

# Change the following as appropriate.
$PfxPass = ConvertTo-SecureString 'P@ssw0rd1' -AsPlainText -Force 

# For version 1.1.47.0 or later, the PowerShell modules used by the RP deployment are placed in C:\Program Files\SqlMySqlPsh
# The deployment script adds this path to the system $env:PSModulePath to ensure correct modules are used.
$rpModulePath = Join-Path -Path $env:ProgramFiles -ChildPath 'SqlMySqlPsh'
$env:PSModulePath = $env:PSModulePath + ";" + $rpModulePath 

# Change directory to the folder where you extracted the installation files.
# Then adjust the endpoints.
.$tempDir\UpdateMySQLProvider.ps1 -AzCredential $AdminCreds -VMLocalCredential $vmLocalAdminCreds -CloudAdminCredential $cloudAdminCreds -PrivilegedEndpoint $privilegedEndpoint -AzureEnvironment $AzureEnvironment -DefaultSSLCertificatePassword $PfxPass -DependencyFilesLocalPath $tempDir\cert -AcceptLicense

リソース プロバイダーの更新スクリプトが終了したら、現在の PowerShell セッションを終了します。

次のステップ

MySQL リソース プロバイダーの維持