Fout (de opgegeven sleutel is niet aanwezig in de woordenlijst) en SQL Server FCI-installatie mislukt op een Azure-VM in Server 2019

Dit artikel helpt u bij het oplossen van het probleem dat optreedt wanneer u probeert een Microsoft SQL Server Failover Clustered Instance (FCI) te installeren in Windows Server 2019 op een virtuele Machine (VM) van Microsoft Azure.

Van toepassing op: SQL Server in VM - Windows, Windows Server 2019
Origineel KB-nummer: 4525647

Symptomen

Wanneer u probeert een Microsoft SQL Server Failover Clustered Instance (FCI) te installeren in Windows Server 2019 op een virtuele Microsoft Azure-machine (VM), mislukt de installatie en ontvangt u het volgende foutbericht:

De opgegeven sleutel was niet aanwezig in de woordenlijst.

In dit geval ziet u de volgende aanvullende informatie in het Details.txt-logboekbestand in de SQL Server installatiemap:

Actiegegevens: Feature = SQL_Engine_Core_Inst_sql_engine_core_inst_Cpu64 Scenario = install Timing = ConfigNonRC ConfigObjectType = Microsoft.SqlServer.Configuration.ClusterConfiguration.FailoverClusterNamePrivateConfigObject FeatureName = SQL_Engine_Core_Inst FeatureCpuType = Cpu64 FeaturePackageId = sql_engine_core_inst FeatureClusterState = CompleteFailoverCluster Configuratieactie is mislukt voor functie-SQL_Engine_Core_Inst tijdens de timing ConfigNonRC en scenario ConfigNonRC. De opgegeven sleutel was niet aanwezig in de woordenlijst. De configuratiefoutcategorie van de huidige uitzondering is ConfigurationFailure Configuratieactie mislukt voor functie-SQL_Engine_Core_Inst tijdens timing ConfigNonRC en scenario ConfigNonRC. System.Collections.Generic.KeyNotFoundException: de opgegeven sleutel was niet aanwezig in de woordenlijst. bij System.ThrowHelper.ThrowKeyNotFoundException() bij System.Collections.Generic.Dictionary2.get_Item(TKey key) at Microsoft.SqlServer.Configuration.ClusterConfiguration.FailoverClusterNamePrivateConfigObject.CreateFailoverClusterNameResource(FailoverClusterNamePublicConfigObject pubConfig) at Microsoft.SqlServer.Configuration.ClusterConfiguration.FailoverClusterNamePrivateConfigObject.Install(ConfigActionTiming timing, Dictionary2 actionData, PublicConfigurationBase spcb) at Microsoft.SqlServer.Configuration.SqlConfigBase.PrivateConfigurationBase.Execute(ConfigActionScenario scenario, ConfigActionTiming timing, ConfigBaseAction action, Dictionary2 actionData, PublicConfigurationBase spcbCurrent) at Microsoft.SqlServer.Configuration.SqlConfigBase.SqlFeatureConfigBase.Execute(ConfigActionScenario scenario, ConfigActionTiming timing, ConfigBaseAction action, Dictionary2 actionData, PublicConfigurationBase spcbCurrent) at Microsoft.SqlServer.Configuration.SqlConfigBase.SlpConfigAction.ExecuteAction(String actionId) at Microsoft.SqlServer.Configuration.SqlConfigBase.SlpConfigAction.Execute(String actionId, TextWriter errorStream) Het volgende is een uitzonderingsstack met de uitzonderingen in buitenste tot binnenste volgorde Binnenste uitzonderingen worden ingesprongen Uitzonderingstype: System.Collections.Generic.KeyNotFoundException Message: De opgegeven sleutel was niet aanwezig in de woordenlijst. HResult: 0x80131577 Data: SQL. Setup.FailureCategory = ConfigurationFailure WatsonConfigActionData = INSTALL@CONFIGNONRC@SQL_ENGINE_CORE_INST WatsonExceptionFeatureIdsActionData = System.String[] Stack: at System.ThrowHelper.ThrowKeyNotFoundException() at System.Collections.Generic.Dictionary2.get_Item(TKey key) at Microsoft.SqlServer.Configuration.ClusterConfiguration.FailoverClusterNamePrivateConfigObject.CreateFailoverClusterNameResource(FailoverClusterNamePublicConfigObject pubConfig) at Microsoft.SqlServer.Configuration.ClusterConfiguration.FailoverClusterNamePrivateConfigObject.Install(ConfigActionTiming timing, Dictionary2 actionData, PublicConfigurationBase spcb) at Microsoft.SqlServer.Configuration.SqlConfigBase.PrivateConfigurationBase.Execute(ConfigActionScenario scenario, ConfigActionTiming timing, ConfigBaseActionAction action, Dictionary2 actionData, PublicConfigurationBase spcbCurrent) at Microsoft.SqlServer.Configuration.SqlConfigBase.SqlFeatureConfigBase.Execute(ConfigActionScenario scenario, ConfigActionTiming timing, ConfigBaseAction action, Dictionary2 actionData, PublicConfigurationBase spcbCurrent) bij Microsoft.SqlServer.Configuration.SqlConfigBase.SlpConfigAction.ExecuteAction(String actionId) bij Microsoft.SqlServer.Configuration.SqlConfigBase.SlpConfigAction.Execute(String actionId, TextWriter errorStream)

Oorzaak

Een nieuwe switch, ManagementPointNetworkType, die kan worden aangeroepen door PowerShell-cmdlets voor FailoverClusters is geïntroduceerd in Windows Server 2019. U kunt de volgende opties voor de nieuwe switch gebruiken.

Schakelparameter Gebruik
Singleton Maakt gebruik van de traditionele methode DHCP of statisch IP-adres.
Gedistribueerd Gebruik een gedistribueerde netwerknaam met behulp van IP-adressen van knooppunten.
Automatisch Maakt gebruik van detectie om de juiste instelling te bepalen. Als SQL Server wordt uitgevoerd in Azure, wordt gedistribueerd gebruikt. Als SQL Server on-premises wordt uitgevoerd, gebruikt u Singleton (standaardinstelling).

Als u het Windows-cluster maakt met behulp van het hulpprogramma Windows Clusterbeheer, stelt het hulpprogramma de schakelparameter in op Automatisch. Omdat u op een Virtuele Azure-machine werkt, gebruikt de switch in plaats daarvan een gedistribueerde netwerknaam.

U kunt dit controleren door de volgende PowerShell-opdracht uit te voeren:

C:\windows\system32> Get-clusterresource

De uitvoer die door deze opdracht wordt geretourneerd, ziet er ongeveer als volgt uit:

Name                 State          OwnerGroup                ResourceType
Cloud Witness                       Online Cluster Group      Cloud Witness
Cluster Name                        Online Cluster Group      Distributed Network Name
Cluster Pool 1                      Online 45d8f3c2-e8df-4a01-87b8-f3c383801f3f
                                                              Storage Pool
Cluster Virtual Disk
   (ClusterPerformanceHistory)      Online Cluster Group      Physical Disk
Health                              Online Cluster Group      Health Service
SDDC Management                     Online Cluster Group      SDDC Management
Storage QoS Resource                Online Cluster Group      Storage QoS Policy Manager

De CreateFailoverClusterNameResource(FailoverClusterNamePublicConfigObject pubConfig) functie controleert de resourcenaam waarvan het typeNetworkName is. Dit is om te controleren of de naam van de virtuele server die u hebt ingevoerd al bestaat.

Het installeren van de SQL Server FCI op een Windows-cluster met alleen een gedistribueerde netwerknaam wordt echter niet ondersteund. Het foutbericht dat wordt vermeld in de sectie Symptomen geeft aan dat er geen resource beschikbaar is in Windows Server 2019 waarvan het type IsNetworkName.

Oplossing

U kunt dit probleem oplossen door het huidige cluster te verwijderen en het vervolgens opnieuw te maken met behulp van een PowerShell-opdracht met de volgende parameter:

managementpointnetworktype singleton