SQL Server Availability Group Failover 測試
相容性測試:
測試指令碼:
環境:windows failover cluster
主庫執行指令碼:
USE [master]
GO
ALTER AVAILABILITY GROUP [test_AG]
MODIFY REPLICA ON N'host1' WITH (FAILOVER_MODE = AUTOMATIC)
GO
報錯:
Msg 35215, Level 16, State 17, Line 3
The Alter operation is not allowed on availability replica 'UELT1WASFSD01VS', because automatic failover mode is an invalid configuration on a SQL Server Failover Cluster Instance. Retry the operation by specifying manual failover mode.
結果證明AG 自動failover的屬性和windows failover cluster不相容,如果要啟用AG自動failover必須使用單例項模式的sql server.
2.AG自動failover功能測試
測試1:
在sscm中手動停止主庫sql service,觀察是否自動failover到備庫。
測試2:
直接關閉主庫所在的主機,觀察是否failover到備庫
測試1和測試2均實現自動failover。
在failover期間,會有應用程式連線拒絕出現:
11/01/19 06:04:10.368 [0x00003688] [spid 769] SQLState: 08S01, Native Error: 10054, Severity: 0, State: 10, Line: 0
[Microsoft][SQL Server Native Client 11.0]TCP Provider: An existing connection was forcibly closed by the remote host.
3.AG Failover效能測試
table: 5218283 rows clustered.
query: select count(*) from test
command:.\ostress -Suedv1wasfsdba01 -dtest -E -Q"select count(*) from dbo.test" -ooutput -mstress -n500 -r100 -T10 -T88 -T146
Primary Session number |
Secondary session number |
1 st Failover time(s) |
2 nd Failover time(s) |
3 rd Failover time(s) |
300 |
0 |
5 |
5 |
5 |
0 |
300 |
25 |
25 |
23 |
500 |
0 |
5 |
5 |
5 |
0 |
500 |
44 |
46 |
31 |
1000 |
0 |
5 |
5 |
5 |
0 |
1000 |
89 |
88 |
91 |
session 1000的時候,客戶端報連線超時錯誤:
解決方案:
exec sp_configure 'max worker threads',4096
go
reconfigure
總結:
1.Avalibility group 自動failover 和 FCI failover不相容,只能應用於 standalone instance.
2.Avalibility group automatic failover 執行sql service 當機 failover and 主機當機 failover.
3. failover 時間取決於備庫上只讀會話併發數目,可以降低主要備庫上的只讀負載,而在非主要備庫上執行只讀負載的方式來降低failover的時間。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69950462/viewspace-2662314/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Linux 上配置 SQL Server Always On Availability GroupLinuxSQLServerAI
- Sql Server Linux(Redhat) Distributed Availability Group Setup — step by stepSQLServerLinuxRedhatAI
- High Availability (HA) in SQL ServerAISQLServer
- [AlwaysOn] 建立SQL Server高可用性組T-SQL語法:AVAILABILITY GROUP ON子句SQLServerAI
- SQL Server中GROUP BY(連結)SQLServer
- Availability Group On Linux 搭建後記AILinux
- Configure multiple-subnet Always On Availability Groups and failover cluster instances by modifying CIBAI
- [AlwaysOn] 建立SQL Server高可用性組T-SQL語法:FAILOVER_MODE引數SQLServerAI
- [AlwaysOn] 建立SQL Server高可用性組T-SQL語法:AVAILABILITY_MODE引數SQLServerAI
- [AlwaysOn] 建立SQL Server高可用性組T-SQL語法:DB_FAILOVER引數SQLServerAI
- MySQL高可用之MHA切換測試(switchover & failover)MySqlAI
- [AlwaysOn2017] AlwaysOn的DMV和DMF - Sys.availability_group_listenersAI
- [AlwaysOn] 建立SQL Server高可用性組T-SQL語法:group_name引數SQLServer
- MGR(MySQL Group Replication)部署搭建測試MySql
- PostgreSQL DBA(186) - SQL Group BySQL
- [AlwaysOn2017] AlwaysOn的DMV和DMF - Sys.dm_hadr_availability_group_statesAI
- [AlwaysOn2017] AlwaysOn的DMV和DMF -Sys.availability_group_listener_ip_addressesAI
- sql serverSQLServer
- SQL MAP 注入測試SQL
- Prepared SQL 效能測試SQL
- SQL Access Advisor、SQL Tuning Advisor 測試SQL
- 在SQL Server上測試事務日誌的自動增長(三)QOSQLServer
- 在SQL Server上測試事務日誌的自動增長(二)TGSQLServer
- 在SQL Server上測試事務日誌的自動增長(一)JPSQLServer
- sql case when, Exist ,group by ,聚合SQL
- Moebius for SQL ServerSQLServer
- sql server 使用SQLServer
- SQL Server教程SQLServer
- Python的SQL效能測試PythonSQL
- SQL PLAN Management的測試SQL
- Python 的 SQL 效能測試PythonSQL
- 測試學習SQL篇SQL
- SQL函式Group_concat用法SQL函式
- SQL SERVER優化SQLServer優化
- Nodejs 操作 Sql ServerNodeJSSQLServer
- SQL Server 別名(as)SQLServer
- sql server遞迴SQLServer遞迴
- Sql server with as update用法SQLServer