SlideShare a Scribd company logo
1 of 24
Download to read offline
SQL Server Failover
Cluster Instances
con Amazon FSx in
AWS
Gianluca Hotz
Chi sono?
• Gianluca Hotz | @glhotz | ghotz@ugiss.org
• Consulente indipendente
• 20+ anni su SQL Server (dalla 4.21 nel 1996)
• Modellazione e sviluppo database, dimensionamento e amministrazione
database server, aggiornamenti e migrazioni, performance tuning
• Community
• 20+ anni Microsoft MVP SQL Server/Data Platform (dal 1998)
• VMware Experts SQL Server
• Fondatore e presidente UGISS (PASS Chapter)
• Co-organizzatore DAMAG Meetup Community
Always On
FCI (Failover Cluster Instance)
• Protegge intera istanza
• Tutti i database
• Storage condiviso
• Windows Failover Clustering
• DTC supportato
Always On AG (Availability Group)
• Protegge gruppi di database
• No database di sistema
• Replica tra storage indipendente
• Scenari «clusterless» supportati
• DTC cross-database 2016 SP2+
https://docs.microsoft.com/en-us/sql/sql-server/failover-clusters/install/sql-server-failover-cluster-installation
https://docs.microsoft.com/en-us/sql/database-engine/availability-groups/windows/overview-of-always-on-availability-groups-sql-server
Windows Server Failover Cluster Basics
• Controllo stato risorse e coordinamento Failover
• Meccanismo basato su Quorum e Witness
• Da in carico le risorse e fa ripartire il servizio su un altro nodo
• Può ospitare più istanze di SQL Server (anche diverse versioni)
• Una sola istanza di DEFAULT altre NAMED
SQL Server AlwaysOn FCI Basics
• Servizio installato su più nodi
• 2 con Edizione Standard
• Limite S.O. con Edizione Enterprise (64 da Windows Server 2012)
• Servizio attivo su un solo nodo
• Risorse condivise (es. storage) ONLINE nodo servizio attivo
• Nome di rete e indirizzi IP virtuali indirizzano traffico a servizio attivo
• Terminologia Active-Passive/Active-Active fuorviante
Funzionamento AlwaysOn FCI
Primary Site
Shared Storage
SQLCLUSTER
SQL FCI Primary
SQL02
SAN01
SQLFCI01
ADMINWKS
Router
10.1.0.20
SQL01
10.1.0.10
Quorum Witness
Disk Share Node
10.1.1.100
10.1.1.50
Core Services
DC01 DC02
10.1.0.1 10.1.0.2
Indisponibilità nodo con AlwaysOn FCI
Primary Site
Shared Storage
SQLCLUSTER
SQL FCI Primary
SQL02
SAN01
SQLFCI01
ADMINWKS
Router
10.1.0.20
SQL01
10.1.0.10
Quorum Witness
Disk Share Node
10.1.1.100
10.1.1.50
Core Services
DC01 DC02
10.1.0.1 10.1.0.2
CRASH
Scenario implementazione AWS
https://aws.amazon.com/blogs/storage/simplify-your-microsoft-sql-server-high-availability-deployments-using-amazon-fsx-for-windows-file-server
Implementazione Ambiente AWS (1)
• Regione «Paris» perché «Milan» non dispone ancora di FSx
• Creazione Virtual Private Cloud (VPC)
• Subnet private Multi-AZ (eu-west-3a e eu-west-3b)
• 2 subnet per servizi core (es. Active Directory)
• 2 subnet per istanze EC2 nodi Cluster
• 2 subnet servizi FSx
• Subnet privata Single-AZ (eu-west-3c)
• 1 istanza EC2 «ponte» con strumenti di amministrazione e demo SQL
• 1 servizio FSx per Witness Cluster
• Gateway
• 1 internet gateway per accesso istanza EC2 ponte tramite IP pubblico
• 1 NAT gateway per fare accedere a Internet altre istanze EC2
Implementazione Ambiente AWS (2)
• Creazione AWS Managed Microsoft Active Directory
• Cambio DHCP predefinito VPC con indirizzi fissi DNS
• Creazione istanze EC2
• Auto-join al dominio
• Implementazione Security Groups (scenario «rilassato»)
• Installazione strumentazione su macchina ponte
• RSAT Failover Cluster, AD Tools, DNS Tools
• SQL Server Management Studio, Visual Studio Code, modulo PS dbatools.io
Implementazione Ambiente Windows
• Completamento configurazione istanze EC2 nodi cluster
• Modifica Computer Name
• Assegnazione indirizzi IP fissi
• Apertura porte Firewall
• Preparazione Windows Server Failover Cluster
• Installazione Feature Failover Clustering sui nodi
• Validazione nodi e creazione Cluster da macchina ponte
• Preparazione oggetti Active Directory
• Gruppi utenti (SQLAdmins, SQLComputers)
• Utente da assegnare al servizio (SqlService)
Preparazione servizi FSx
• 1 File System per Cluster Witness
• Single-AZ (eu-west-3c esterna alle 2 AZ con i nodi del cluster)
• Basso throughput 8 MB/s per witness
• Dimensione minima 32 GiB SSD (oppure 2TB magnetico…)
• 1 File System per file SQL Server
• Multi-AZ (eu-west-3a e eu-west-3b)
• Basso throughput 16 MB/s per test minimale (max. 2048 MB/s)
• Creazione share «Continuously Available»
• File dati, t-log, backup, altro (es. errorlog, default trace, dump ecc.)
• Assegnazione permessi a share e directory
Installazione SQL Server
• In modalità Failover Cluster
• Installazione primo nodo, aggiunta secondo nodo
• Puntamento a share SMB al posto di «Shared Volumes»
• Interfaccia dischi condivisi vuota
• Database tempdb posizionato su volume locale istanza EC2
• Best Practice in generale
• Creare directory e assegnare permessi dopo aggiunta nodi
Installazione SQL: niente dischi cluster
Installazione SQL: «data directories»
Installazione SQL: tempdb
Installazione SQL: multi-subnet
DEMO
Automatic Failover
Criticità implementazione
• Auto-join istanze al dominio
• Indirizzi DNS fissi, creato DHCP apposito per VPC
• NAT Gateway per System Manager
• Ricordarsi di assegnare tutti gli IP fissi al NIC eth0 delle istanze EC2
• Altrimenti SQL Server non risponde
• Errore creazione durante installazione
• Cluster resource 'SQL Network Name (SQLFCI01)' of type 'Network Name' in
clustered role 'SQL Server (MSSQLSERVER)' failed. The error code was '0x5' ('Access is
denied.').
• https://techcommunity.microsoft.com/t5/sql-server-support/error-during-
installation-of-an-sql-server-failover-cluster/ba-p/317873
• Container per «memory-optimized filegroup» non funzionano
• Stesso errore durante creazione mancanza dipendenza volumi
Problemi Multi-Subnet con librerie vecchie
• Si applica a
• Librerie vecchie senza supporto MultiSubnetFailover
• Stringhe di connessione non modificabili
• Origine del problema
• Indirizzi IP multipli nel DNS
• «Library timeout» < «TCP timeout» (15 vs 21 sec.)
• Mitigazione
• SQL Client Provider in .NET 4.6.1 automatico!
• Alzare timeout > 30-40 sec.
• se possibile, non sempre funziona…
• Non registrare tutti gli indirizzi IP (colpisce tutti)
• Ridurre latenza aggiornamenti DNS (HostRecordTTL)
• Ridurre scadenza cache DNS sui client
https://docs.microsoft.com/en-us/sql/sql-server/failover-clusters/windows/sql-server-multi-subnet-clustering-sql-server
DEMO
Problemi con Multi-Subnet
Problemi comuni con AlwaysOn AG
• «Basic Availability Groups» con Edizione Standard
• 1 database per Availability Group e Listener
• No Failover coordinato
• Replica del database
• Doppio dello spazio utilizzato (pro per DR)
• Maggiore latenza in scrittura con replica sincrona per failover automatico
• Worker Thread/CPU impegnati per replicare il dato
• Richiede «recovery model» FULL (gestione backup del log)
• No replica database di sistema
• Sincronizzazione manuale (es. login, certificati, job, operatori ecc.)
• Agent Job deve prevedere di terminare se esecuzione replica secondaria
Risorse
• Best Practices and Recommendations for SQL Server Clustering in EC2
• https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/aws-sql-clustering.html
• Simplify your Microsoft SQL Server high availability deployments using Amazon FSx for
Windows File Server
• https://aws.amazon.com/blogs/storage/simplify-your-microsoft-sql-server-high-availability-
deployments-using-amazon-fsx-for-windows-file-server
• Connection Timeouts in Multi-subnet Availability Group
• https://techcommunity.microsoft.com/t5/sql-server-support/connection-timeouts-in-multi-
subnet-availability-group/ba-p/318334
• Improved MultiSubnet Listener Behavior With Newly Released SQL Client Provider in
.NET 4.6.1
• https://techcommunity.microsoft.com/t5/sql-server-support/improved-multisubnet-listener-
behavior-with-newly-released-sql/ba-p/318664
Q&A

More Related Content

What's hot

SQL Server Data Virtualization with Polybase
SQL Server Data Virtualization with PolybaseSQL Server Data Virtualization with Polybase
SQL Server Data Virtualization with PolybaseGianluca Hotz
 
Come utilizzare AWS Database Migration Service per migrare SQL Server ad Amaz...
Come utilizzare AWS Database Migration Service per migrare SQL Server ad Amaz...Come utilizzare AWS Database Migration Service per migrare SQL Server ad Amaz...
Come utilizzare AWS Database Migration Service per migrare SQL Server ad Amaz...Gianluca Hotz
 
Azure SQL Database Ledger
Azure SQL Database LedgerAzure SQL Database Ledger
Azure SQL Database LedgerGianluca Hotz
 
Mettere in sicurezza ambienti sql server
Mettere in sicurezza ambienti sql serverMettere in sicurezza ambienti sql server
Mettere in sicurezza ambienti sql serverGianluca Hotz
 
Best Practices on SQL Server
Best Practices on SQL ServerBest Practices on SQL Server
Best Practices on SQL ServerGianluca Hotz
 
Azure PaaS databases
Azure PaaS databasesAzure PaaS databases
Azure PaaS databasesGianluca Hotz
 
SQL Server Modern Query Processing
SQL Server Modern Query ProcessingSQL Server Modern Query Processing
SQL Server Modern Query ProcessingGianluca Hotz
 
SQL Server Data Virtualization with polybase
SQL Server Data Virtualization with polybaseSQL Server Data Virtualization with polybase
SQL Server Data Virtualization with polybaseGianluca Hotz
 
Azure Data Factory: l'evoluzione della specie della data integration
Azure Data Factory: l'evoluzione della specie della data integrationAzure Data Factory: l'evoluzione della specie della data integration
Azure Data Factory: l'evoluzione della specie della data integrationRoberto Messora
 
Azure PaaS databases
Azure PaaS databasesAzure PaaS databases
Azure PaaS databasesGianluca Hotz
 
Una web farm bilanciata e scalabile con Microsoft Azure
Una web farm bilanciata e scalabile con Microsoft AzureUna web farm bilanciata e scalabile con Microsoft Azure
Una web farm bilanciata e scalabile con Microsoft AzureDavide Benvegnù
 
Novità di SQL Server 2017
Novità di SQL Server 2017Novità di SQL Server 2017
Novità di SQL Server 2017Gianluca Hotz
 
Sql start!2019 Migliorare la produttività per lo sviluppo su SQL Server
Sql start!2019 Migliorare la produttività per lo sviluppo su SQL ServerSql start!2019 Migliorare la produttività per lo sviluppo su SQL Server
Sql start!2019 Migliorare la produttività per lo sviluppo su SQL ServerAlessandro Alpi
 
Implementare e mantenere un progetto azure sql database v.2
Implementare e mantenere un progetto azure sql database v.2Implementare e mantenere un progetto azure sql database v.2
Implementare e mantenere un progetto azure sql database v.2Emanuele Zanchettin
 
Microservices webinar EMEA Aug. 2017
Microservices webinar EMEA Aug. 2017Microservices webinar EMEA Aug. 2017
Microservices webinar EMEA Aug. 2017MongoDB
 
#vBrownBag.IT - Session 1
#vBrownBag.IT - Session 1#vBrownBag.IT - Session 1
#vBrownBag.IT - Session 1Andrea Mauro
 
SQL Saturday 871 - Sardegna 2019 - SQL Server DR on Azure
SQL Saturday 871 - Sardegna 2019 - SQL Server DR on AzureSQL Saturday 871 - Sardegna 2019 - SQL Server DR on Azure
SQL Saturday 871 - Sardegna 2019 - SQL Server DR on AzureMarco Obinu
 
2014.11.14 Implementare e mantenere un progetto Azure SQL Database
2014.11.14 Implementare e mantenere un progetto Azure SQL Database2014.11.14 Implementare e mantenere un progetto Azure SQL Database
2014.11.14 Implementare e mantenere un progetto Azure SQL DatabaseEmanuele Zanchettin
 
JBoss Data Grid Tech Lab
JBoss Data Grid Tech LabJBoss Data Grid Tech Lab
JBoss Data Grid Tech LabUgo Landini
 
Codemotion fuse presentation
Codemotion fuse presentationCodemotion fuse presentation
Codemotion fuse presentationUgo Landini
 

What's hot (20)

SQL Server Data Virtualization with Polybase
SQL Server Data Virtualization with PolybaseSQL Server Data Virtualization with Polybase
SQL Server Data Virtualization with Polybase
 
Come utilizzare AWS Database Migration Service per migrare SQL Server ad Amaz...
Come utilizzare AWS Database Migration Service per migrare SQL Server ad Amaz...Come utilizzare AWS Database Migration Service per migrare SQL Server ad Amaz...
Come utilizzare AWS Database Migration Service per migrare SQL Server ad Amaz...
 
Azure SQL Database Ledger
Azure SQL Database LedgerAzure SQL Database Ledger
Azure SQL Database Ledger
 
Mettere in sicurezza ambienti sql server
Mettere in sicurezza ambienti sql serverMettere in sicurezza ambienti sql server
Mettere in sicurezza ambienti sql server
 
Best Practices on SQL Server
Best Practices on SQL ServerBest Practices on SQL Server
Best Practices on SQL Server
 
Azure PaaS databases
Azure PaaS databasesAzure PaaS databases
Azure PaaS databases
 
SQL Server Modern Query Processing
SQL Server Modern Query ProcessingSQL Server Modern Query Processing
SQL Server Modern Query Processing
 
SQL Server Data Virtualization with polybase
SQL Server Data Virtualization with polybaseSQL Server Data Virtualization with polybase
SQL Server Data Virtualization with polybase
 
Azure Data Factory: l'evoluzione della specie della data integration
Azure Data Factory: l'evoluzione della specie della data integrationAzure Data Factory: l'evoluzione della specie della data integration
Azure Data Factory: l'evoluzione della specie della data integration
 
Azure PaaS databases
Azure PaaS databasesAzure PaaS databases
Azure PaaS databases
 
Una web farm bilanciata e scalabile con Microsoft Azure
Una web farm bilanciata e scalabile con Microsoft AzureUna web farm bilanciata e scalabile con Microsoft Azure
Una web farm bilanciata e scalabile con Microsoft Azure
 
Novità di SQL Server 2017
Novità di SQL Server 2017Novità di SQL Server 2017
Novità di SQL Server 2017
 
Sql start!2019 Migliorare la produttività per lo sviluppo su SQL Server
Sql start!2019 Migliorare la produttività per lo sviluppo su SQL ServerSql start!2019 Migliorare la produttività per lo sviluppo su SQL Server
Sql start!2019 Migliorare la produttività per lo sviluppo su SQL Server
 
Implementare e mantenere un progetto azure sql database v.2
Implementare e mantenere un progetto azure sql database v.2Implementare e mantenere un progetto azure sql database v.2
Implementare e mantenere un progetto azure sql database v.2
 
Microservices webinar EMEA Aug. 2017
Microservices webinar EMEA Aug. 2017Microservices webinar EMEA Aug. 2017
Microservices webinar EMEA Aug. 2017
 
#vBrownBag.IT - Session 1
#vBrownBag.IT - Session 1#vBrownBag.IT - Session 1
#vBrownBag.IT - Session 1
 
SQL Saturday 871 - Sardegna 2019 - SQL Server DR on Azure
SQL Saturday 871 - Sardegna 2019 - SQL Server DR on AzureSQL Saturday 871 - Sardegna 2019 - SQL Server DR on Azure
SQL Saturday 871 - Sardegna 2019 - SQL Server DR on Azure
 
2014.11.14 Implementare e mantenere un progetto Azure SQL Database
2014.11.14 Implementare e mantenere un progetto Azure SQL Database2014.11.14 Implementare e mantenere un progetto Azure SQL Database
2014.11.14 Implementare e mantenere un progetto Azure SQL Database
 
JBoss Data Grid Tech Lab
JBoss Data Grid Tech LabJBoss Data Grid Tech Lab
JBoss Data Grid Tech Lab
 
Codemotion fuse presentation
Codemotion fuse presentationCodemotion fuse presentation
Codemotion fuse presentation
 

Similar to SQL Server Failover Cluster Instances con Amazon FSx in AWS

Microsoft SQL Server PaaS (Platform as a Service)
Microsoft SQL Server PaaS (Platform as a Service)Microsoft SQL Server PaaS (Platform as a Service)
Microsoft SQL Server PaaS (Platform as a Service)Gianluca Hotz
 
IaaS and PaaS relational databases in the cloud
IaaS and PaaS relational databases in the cloudIaaS and PaaS relational databases in the cloud
IaaS and PaaS relational databases in the cloudGianluca Hotz
 
CCI2019 - SQL Server ed Azure: Disaster Recovery per tutti
CCI2019 - SQL Server ed Azure: Disaster Recovery per tuttiCCI2019 - SQL Server ed Azure: Disaster Recovery per tutti
CCI2019 - SQL Server ed Azure: Disaster Recovery per tuttiwalk2talk srl
 
Differenze tra Windows Server 2012 R2 su e Server 2016 Yashi Italia
Differenze tra Windows Server 2012 R2 su e Server 2016 Yashi ItaliaDifferenze tra Windows Server 2012 R2 su e Server 2016 Yashi Italia
Differenze tra Windows Server 2012 R2 su e Server 2016 Yashi ItaliaYashi Italia
 
SDS,la pietra d’angolo dell SDDC
SDS,la pietra d’angolo dell SDDC SDS,la pietra d’angolo dell SDDC
SDS,la pietra d’angolo dell SDDC VMUG IT
 
#vBrownBag.IT - Session 2
#vBrownBag.IT - Session 2#vBrownBag.IT - Session 2
#vBrownBag.IT - Session 2Andrea Mauro
 
Realizzare una rete aziendale con linux e samba
Realizzare una rete aziendale con linux e sambaRealizzare una rete aziendale con linux e samba
Realizzare una rete aziendale con linux e sambaAndrea Mauro
 
La nostra infrastruttura di produzione a container con Docker, Rancher e ZFS
La nostra infrastruttura di produzione a container con Docker, Rancher e ZFSLa nostra infrastruttura di produzione a container con Docker, Rancher e ZFS
La nostra infrastruttura di produzione a container con Docker, Rancher e ZFSMorlini Gabriele
 
ObserveIt -Record and replay SSH, RDP & Citrix sessions-product datasheet- It...
ObserveIt -Record and replay SSH, RDP & Citrix sessions-product datasheet- It...ObserveIt -Record and replay SSH, RDP & Citrix sessions-product datasheet- It...
ObserveIt -Record and replay SSH, RDP & Citrix sessions-product datasheet- It...ObserveIT
 
Cloud Google App Engine Paas
Cloud   Google App Engine PaasCloud   Google App Engine Paas
Cloud Google App Engine Paassteccami
 
Laboratorio Di Basi Di Dati 02 Il D B M S My S Q L
Laboratorio Di  Basi Di  Dati 02  Il  D B M S  My S Q LLaboratorio Di  Basi Di  Dati 02  Il  D B M S  My S Q L
Laboratorio Di Basi Di Dati 02 Il D B M S My S Q Lguestbe916c
 
VMUGIT UC 2013 - 09b VMUGIT SMB
VMUGIT UC 2013 - 09b VMUGIT SMB VMUGIT UC 2013 - 09b VMUGIT SMB
VMUGIT UC 2013 - 09b VMUGIT SMB VMUG IT
 
festival ICT 2013: Windows Server 2012 R2: Lo Storage Enterprise per Tutti
festival ICT 2013: Windows Server 2012 R2: Lo Storage Enterprise per Tutti festival ICT 2013: Windows Server 2012 R2: Lo Storage Enterprise per Tutti
festival ICT 2013: Windows Server 2012 R2: Lo Storage Enterprise per Tutti festival ICT 2016
 
La nostra infrastruttura di produzione a container con Docker, Rancher e ZFS
La nostra infrastruttura di produzione a container con Docker, Rancher e ZFS La nostra infrastruttura di produzione a container con Docker, Rancher e ZFS
La nostra infrastruttura di produzione a container con Docker, Rancher e ZFS Imola Informatica
 
Azure Day Rome Reloaded 2019 - Python, Azure Cosmos DB, Docker and Azure Cont...
Azure Day Rome Reloaded 2019 - Python, Azure Cosmos DB, Docker and Azure Cont...Azure Day Rome Reloaded 2019 - Python, Azure Cosmos DB, Docker and Azure Cont...
Azure Day Rome Reloaded 2019 - Python, Azure Cosmos DB, Docker and Azure Cont...azuredayit
 
SPBM VSAN VVOL @ VMUG.IT 20150529
SPBM VSAN VVOL @ VMUG.IT 20150529SPBM VSAN VVOL @ VMUG.IT 20150529
SPBM VSAN VVOL @ VMUG.IT 20150529VMUG IT
 

Similar to SQL Server Failover Cluster Instances con Amazon FSx in AWS (20)

Microsoft SQL Server PaaS (Platform as a Service)
Microsoft SQL Server PaaS (Platform as a Service)Microsoft SQL Server PaaS (Platform as a Service)
Microsoft SQL Server PaaS (Platform as a Service)
 
IaaS and PaaS relational databases in the cloud
IaaS and PaaS relational databases in the cloudIaaS and PaaS relational databases in the cloud
IaaS and PaaS relational databases in the cloud
 
CCI2019 - SQL Server ed Azure: Disaster Recovery per tutti
CCI2019 - SQL Server ed Azure: Disaster Recovery per tuttiCCI2019 - SQL Server ed Azure: Disaster Recovery per tutti
CCI2019 - SQL Server ed Azure: Disaster Recovery per tutti
 
Differenze tra Windows Server 2012 R2 su e Server 2016 Yashi Italia
Differenze tra Windows Server 2012 R2 su e Server 2016 Yashi ItaliaDifferenze tra Windows Server 2012 R2 su e Server 2016 Yashi Italia
Differenze tra Windows Server 2012 R2 su e Server 2016 Yashi Italia
 
Azure sql database
Azure sql databaseAzure sql database
Azure sql database
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
SDS,la pietra d’angolo dell SDDC
SDS,la pietra d’angolo dell SDDC SDS,la pietra d’angolo dell SDDC
SDS,la pietra d’angolo dell SDDC
 
#vBrownBag.IT - Session 2
#vBrownBag.IT - Session 2#vBrownBag.IT - Session 2
#vBrownBag.IT - Session 2
 
Realizzare una rete aziendale con linux e samba
Realizzare una rete aziendale con linux e sambaRealizzare una rete aziendale con linux e samba
Realizzare una rete aziendale con linux e samba
 
La nostra infrastruttura di produzione a container con Docker, Rancher e ZFS
La nostra infrastruttura di produzione a container con Docker, Rancher e ZFSLa nostra infrastruttura di produzione a container con Docker, Rancher e ZFS
La nostra infrastruttura di produzione a container con Docker, Rancher e ZFS
 
Sametime 8.x configurarlo ed installarlo
Sametime 8.x configurarlo ed installarloSametime 8.x configurarlo ed installarlo
Sametime 8.x configurarlo ed installarlo
 
ObserveIt -Record and replay SSH, RDP & Citrix sessions-product datasheet- It...
ObserveIt -Record and replay SSH, RDP & Citrix sessions-product datasheet- It...ObserveIt -Record and replay SSH, RDP & Citrix sessions-product datasheet- It...
ObserveIt -Record and replay SSH, RDP & Citrix sessions-product datasheet- It...
 
Akka.net & Actor Model
Akka.net & Actor ModelAkka.net & Actor Model
Akka.net & Actor Model
 
Cloud Google App Engine Paas
Cloud   Google App Engine PaasCloud   Google App Engine Paas
Cloud Google App Engine Paas
 
Laboratorio Di Basi Di Dati 02 Il D B M S My S Q L
Laboratorio Di  Basi Di  Dati 02  Il  D B M S  My S Q LLaboratorio Di  Basi Di  Dati 02  Il  D B M S  My S Q L
Laboratorio Di Basi Di Dati 02 Il D B M S My S Q L
 
VMUGIT UC 2013 - 09b VMUGIT SMB
VMUGIT UC 2013 - 09b VMUGIT SMB VMUGIT UC 2013 - 09b VMUGIT SMB
VMUGIT UC 2013 - 09b VMUGIT SMB
 
festival ICT 2013: Windows Server 2012 R2: Lo Storage Enterprise per Tutti
festival ICT 2013: Windows Server 2012 R2: Lo Storage Enterprise per Tutti festival ICT 2013: Windows Server 2012 R2: Lo Storage Enterprise per Tutti
festival ICT 2013: Windows Server 2012 R2: Lo Storage Enterprise per Tutti
 
La nostra infrastruttura di produzione a container con Docker, Rancher e ZFS
La nostra infrastruttura di produzione a container con Docker, Rancher e ZFS La nostra infrastruttura di produzione a container con Docker, Rancher e ZFS
La nostra infrastruttura di produzione a container con Docker, Rancher e ZFS
 
Azure Day Rome Reloaded 2019 - Python, Azure Cosmos DB, Docker and Azure Cont...
Azure Day Rome Reloaded 2019 - Python, Azure Cosmos DB, Docker and Azure Cont...Azure Day Rome Reloaded 2019 - Python, Azure Cosmos DB, Docker and Azure Cont...
Azure Day Rome Reloaded 2019 - Python, Azure Cosmos DB, Docker and Azure Cont...
 
SPBM VSAN VVOL @ VMUG.IT 20150529
SPBM VSAN VVOL @ VMUG.IT 20150529SPBM VSAN VVOL @ VMUG.IT 20150529
SPBM VSAN VVOL @ VMUG.IT 20150529
 

More from Gianluca Hotz

Multitenancy con SQL Server e Azure SQL Database
Multitenancy con SQL Server e Azure SQL DatabaseMultitenancy con SQL Server e Azure SQL Database
Multitenancy con SQL Server e Azure SQL DatabaseGianluca Hotz
 
SQL Server 2022 Programmability & Performance
SQL Server 2022 Programmability & PerformanceSQL Server 2022 Programmability & Performance
SQL Server 2022 Programmability & PerformanceGianluca Hotz
 
SQL Server 2022 Intelligent Query Processing
SQL Server 2022 Intelligent Query ProcessingSQL Server 2022 Intelligent Query Processing
SQL Server 2022 Intelligent Query ProcessingGianluca Hotz
 
Le novità di SQL Server 2022
Le novità di SQL Server 2022Le novità di SQL Server 2022
Le novità di SQL Server 2022Gianluca Hotz
 
Data Integrity with SQL Database Ledger
Data Integrity with SQL Database LedgerData Integrity with SQL Database Ledger
Data Integrity with SQL Database LedgerGianluca Hotz
 
Best Practices for Running Microsoft SQL Server on AWS
Best Practices for Running Microsoft SQL Server on AWSBest Practices for Running Microsoft SQL Server on AWS
Best Practices for Running Microsoft SQL Server on AWSGianluca Hotz
 
SQL Server Modernization
SQL Server ModernizationSQL Server Modernization
SQL Server ModernizationGianluca Hotz
 
Le novità di sql server 2019
Le novità di sql server 2019Le novità di sql server 2019
Le novità di sql server 2019Gianluca Hotz
 
SQL Server 2019 CTP 2.5
SQL Server 2019 CTP 2.5SQL Server 2019 CTP 2.5
SQL Server 2019 CTP 2.5Gianluca Hotz
 
Azure PaaS databases
Azure PaaS databasesAzure PaaS databases
Azure PaaS databasesGianluca Hotz
 
SQL Server 2019 CTP2.4
SQL Server 2019 CTP2.4SQL Server 2019 CTP2.4
SQL Server 2019 CTP2.4Gianluca Hotz
 
SQL Server 2019 ctp2.2
SQL Server 2019 ctp2.2SQL Server 2019 ctp2.2
SQL Server 2019 ctp2.2Gianluca Hotz
 

More from Gianluca Hotz (12)

Multitenancy con SQL Server e Azure SQL Database
Multitenancy con SQL Server e Azure SQL DatabaseMultitenancy con SQL Server e Azure SQL Database
Multitenancy con SQL Server e Azure SQL Database
 
SQL Server 2022 Programmability & Performance
SQL Server 2022 Programmability & PerformanceSQL Server 2022 Programmability & Performance
SQL Server 2022 Programmability & Performance
 
SQL Server 2022 Intelligent Query Processing
SQL Server 2022 Intelligent Query ProcessingSQL Server 2022 Intelligent Query Processing
SQL Server 2022 Intelligent Query Processing
 
Le novità di SQL Server 2022
Le novità di SQL Server 2022Le novità di SQL Server 2022
Le novità di SQL Server 2022
 
Data Integrity with SQL Database Ledger
Data Integrity with SQL Database LedgerData Integrity with SQL Database Ledger
Data Integrity with SQL Database Ledger
 
Best Practices for Running Microsoft SQL Server on AWS
Best Practices for Running Microsoft SQL Server on AWSBest Practices for Running Microsoft SQL Server on AWS
Best Practices for Running Microsoft SQL Server on AWS
 
SQL Server Modernization
SQL Server ModernizationSQL Server Modernization
SQL Server Modernization
 
Le novità di sql server 2019
Le novità di sql server 2019Le novità di sql server 2019
Le novità di sql server 2019
 
SQL Server 2019 CTP 2.5
SQL Server 2019 CTP 2.5SQL Server 2019 CTP 2.5
SQL Server 2019 CTP 2.5
 
Azure PaaS databases
Azure PaaS databasesAzure PaaS databases
Azure PaaS databases
 
SQL Server 2019 CTP2.4
SQL Server 2019 CTP2.4SQL Server 2019 CTP2.4
SQL Server 2019 CTP2.4
 
SQL Server 2019 ctp2.2
SQL Server 2019 ctp2.2SQL Server 2019 ctp2.2
SQL Server 2019 ctp2.2
 

SQL Server Failover Cluster Instances con Amazon FSx in AWS

  • 1. SQL Server Failover Cluster Instances con Amazon FSx in AWS Gianluca Hotz
  • 2. Chi sono? • Gianluca Hotz | @glhotz | ghotz@ugiss.org • Consulente indipendente • 20+ anni su SQL Server (dalla 4.21 nel 1996) • Modellazione e sviluppo database, dimensionamento e amministrazione database server, aggiornamenti e migrazioni, performance tuning • Community • 20+ anni Microsoft MVP SQL Server/Data Platform (dal 1998) • VMware Experts SQL Server • Fondatore e presidente UGISS (PASS Chapter) • Co-organizzatore DAMAG Meetup Community
  • 3. Always On FCI (Failover Cluster Instance) • Protegge intera istanza • Tutti i database • Storage condiviso • Windows Failover Clustering • DTC supportato Always On AG (Availability Group) • Protegge gruppi di database • No database di sistema • Replica tra storage indipendente • Scenari «clusterless» supportati • DTC cross-database 2016 SP2+ https://docs.microsoft.com/en-us/sql/sql-server/failover-clusters/install/sql-server-failover-cluster-installation https://docs.microsoft.com/en-us/sql/database-engine/availability-groups/windows/overview-of-always-on-availability-groups-sql-server
  • 4. Windows Server Failover Cluster Basics • Controllo stato risorse e coordinamento Failover • Meccanismo basato su Quorum e Witness • Da in carico le risorse e fa ripartire il servizio su un altro nodo • Può ospitare più istanze di SQL Server (anche diverse versioni) • Una sola istanza di DEFAULT altre NAMED
  • 5. SQL Server AlwaysOn FCI Basics • Servizio installato su più nodi • 2 con Edizione Standard • Limite S.O. con Edizione Enterprise (64 da Windows Server 2012) • Servizio attivo su un solo nodo • Risorse condivise (es. storage) ONLINE nodo servizio attivo • Nome di rete e indirizzi IP virtuali indirizzano traffico a servizio attivo • Terminologia Active-Passive/Active-Active fuorviante
  • 6. Funzionamento AlwaysOn FCI Primary Site Shared Storage SQLCLUSTER SQL FCI Primary SQL02 SAN01 SQLFCI01 ADMINWKS Router 10.1.0.20 SQL01 10.1.0.10 Quorum Witness Disk Share Node 10.1.1.100 10.1.1.50 Core Services DC01 DC02 10.1.0.1 10.1.0.2
  • 7. Indisponibilità nodo con AlwaysOn FCI Primary Site Shared Storage SQLCLUSTER SQL FCI Primary SQL02 SAN01 SQLFCI01 ADMINWKS Router 10.1.0.20 SQL01 10.1.0.10 Quorum Witness Disk Share Node 10.1.1.100 10.1.1.50 Core Services DC01 DC02 10.1.0.1 10.1.0.2 CRASH
  • 9. Implementazione Ambiente AWS (1) • Regione «Paris» perché «Milan» non dispone ancora di FSx • Creazione Virtual Private Cloud (VPC) • Subnet private Multi-AZ (eu-west-3a e eu-west-3b) • 2 subnet per servizi core (es. Active Directory) • 2 subnet per istanze EC2 nodi Cluster • 2 subnet servizi FSx • Subnet privata Single-AZ (eu-west-3c) • 1 istanza EC2 «ponte» con strumenti di amministrazione e demo SQL • 1 servizio FSx per Witness Cluster • Gateway • 1 internet gateway per accesso istanza EC2 ponte tramite IP pubblico • 1 NAT gateway per fare accedere a Internet altre istanze EC2
  • 10. Implementazione Ambiente AWS (2) • Creazione AWS Managed Microsoft Active Directory • Cambio DHCP predefinito VPC con indirizzi fissi DNS • Creazione istanze EC2 • Auto-join al dominio • Implementazione Security Groups (scenario «rilassato») • Installazione strumentazione su macchina ponte • RSAT Failover Cluster, AD Tools, DNS Tools • SQL Server Management Studio, Visual Studio Code, modulo PS dbatools.io
  • 11. Implementazione Ambiente Windows • Completamento configurazione istanze EC2 nodi cluster • Modifica Computer Name • Assegnazione indirizzi IP fissi • Apertura porte Firewall • Preparazione Windows Server Failover Cluster • Installazione Feature Failover Clustering sui nodi • Validazione nodi e creazione Cluster da macchina ponte • Preparazione oggetti Active Directory • Gruppi utenti (SQLAdmins, SQLComputers) • Utente da assegnare al servizio (SqlService)
  • 12. Preparazione servizi FSx • 1 File System per Cluster Witness • Single-AZ (eu-west-3c esterna alle 2 AZ con i nodi del cluster) • Basso throughput 8 MB/s per witness • Dimensione minima 32 GiB SSD (oppure 2TB magnetico…) • 1 File System per file SQL Server • Multi-AZ (eu-west-3a e eu-west-3b) • Basso throughput 16 MB/s per test minimale (max. 2048 MB/s) • Creazione share «Continuously Available» • File dati, t-log, backup, altro (es. errorlog, default trace, dump ecc.) • Assegnazione permessi a share e directory
  • 13. Installazione SQL Server • In modalità Failover Cluster • Installazione primo nodo, aggiunta secondo nodo • Puntamento a share SMB al posto di «Shared Volumes» • Interfaccia dischi condivisi vuota • Database tempdb posizionato su volume locale istanza EC2 • Best Practice in generale • Creare directory e assegnare permessi dopo aggiunta nodi
  • 14. Installazione SQL: niente dischi cluster
  • 15. Installazione SQL: «data directories»
  • 19. Criticità implementazione • Auto-join istanze al dominio • Indirizzi DNS fissi, creato DHCP apposito per VPC • NAT Gateway per System Manager • Ricordarsi di assegnare tutti gli IP fissi al NIC eth0 delle istanze EC2 • Altrimenti SQL Server non risponde • Errore creazione durante installazione • Cluster resource 'SQL Network Name (SQLFCI01)' of type 'Network Name' in clustered role 'SQL Server (MSSQLSERVER)' failed. The error code was '0x5' ('Access is denied.'). • https://techcommunity.microsoft.com/t5/sql-server-support/error-during- installation-of-an-sql-server-failover-cluster/ba-p/317873 • Container per «memory-optimized filegroup» non funzionano • Stesso errore durante creazione mancanza dipendenza volumi
  • 20. Problemi Multi-Subnet con librerie vecchie • Si applica a • Librerie vecchie senza supporto MultiSubnetFailover • Stringhe di connessione non modificabili • Origine del problema • Indirizzi IP multipli nel DNS • «Library timeout» < «TCP timeout» (15 vs 21 sec.) • Mitigazione • SQL Client Provider in .NET 4.6.1 automatico! • Alzare timeout > 30-40 sec. • se possibile, non sempre funziona… • Non registrare tutti gli indirizzi IP (colpisce tutti) • Ridurre latenza aggiornamenti DNS (HostRecordTTL) • Ridurre scadenza cache DNS sui client https://docs.microsoft.com/en-us/sql/sql-server/failover-clusters/windows/sql-server-multi-subnet-clustering-sql-server
  • 22. Problemi comuni con AlwaysOn AG • «Basic Availability Groups» con Edizione Standard • 1 database per Availability Group e Listener • No Failover coordinato • Replica del database • Doppio dello spazio utilizzato (pro per DR) • Maggiore latenza in scrittura con replica sincrona per failover automatico • Worker Thread/CPU impegnati per replicare il dato • Richiede «recovery model» FULL (gestione backup del log) • No replica database di sistema • Sincronizzazione manuale (es. login, certificati, job, operatori ecc.) • Agent Job deve prevedere di terminare se esecuzione replica secondaria
  • 23. Risorse • Best Practices and Recommendations for SQL Server Clustering in EC2 • https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/aws-sql-clustering.html • Simplify your Microsoft SQL Server high availability deployments using Amazon FSx for Windows File Server • https://aws.amazon.com/blogs/storage/simplify-your-microsoft-sql-server-high-availability- deployments-using-amazon-fsx-for-windows-file-server • Connection Timeouts in Multi-subnet Availability Group • https://techcommunity.microsoft.com/t5/sql-server-support/connection-timeouts-in-multi- subnet-availability-group/ba-p/318334 • Improved MultiSubnet Listener Behavior With Newly Released SQL Client Provider in .NET 4.6.1 • https://techcommunity.microsoft.com/t5/sql-server-support/improved-multisubnet-listener- behavior-with-newly-released-sql/ba-p/318664
  • 24. Q&A