AlwaysOn
Availability Groups, introduced in SQL Server 2012, is the latest feature from
Microsoft for providing high-availability and disaster recovery solutions.
The feature is
available only for Enterprise edition of SQL Server 2012 and SQL Server 2014
and combines Windows failover clustering with SQL Server database mirroring.
Regarding the number
of nodes in AlwaysOn Availability Groups, SQL Server 2012 supports a maximum of
four secondary replicas and SQL Server 2014 supports a maximum of eight
secondary replicas.
I won't enter into
details regarding the definition or the configuration of AlwaysOn Availability
Groups, instead I will point the steps to follow and to consider when
configuring it.
Step 1. Configure Windows Server Cluster (a feature of Windows Server operating
system).
Step 2. Install SQL Server Database Engine
(2012/2014 enterprise edition)
on each node:
- Installation as New SQL Server stand-alone installation (not in failover cluster mode);
- SQL Server service accounts configured to Windows domain users;
- All instances should have the same name;
- All instances should have the same collation;
- Make sure each instance has the same path for user databases (data files and log files). Not the same disks for storage, but the same configuration and path.
Step 3. Choose a shared location for backups
and give permissions on it to all SQL Server database engine service accounts.
All instances
configured in AlwaysOn need to have access to databases backups.
Step 4. Make sure each SQL Server service
account has permissions on all related datafiles and logfiles folders.
Step 5. Configure static port on each instance
and restart the services (if it's not the default instance).
Step 6. Open inbound rules for the static ports
in Windows Firewall.
Step 7. Enable AlwaysOn on each instance in
Configuration Manager and restart the services.
Step 8. Go to primary replica (the node you
choose as active/primary) and prepare the database:
- Set recovery model to FULL;
- Backup full the database to the shared backup location (on which all service accounts have permission).
Step 9. Run New Availability Group Wizard on
the primary replica:
- The wizard creates endpoints for each instance;
- Add inbound rules in Windows Firewall for the endpoints ports on each server;
- Choose the databases you want to add to Availability Groups.
Step 10. Add a Listener to the Availability Group and configure it:
- Assign an unique name within Active Directory;
- Assign a new, unused IP in the chosen subnet;
- Assign an available port (the default port is TCP 1433, but if it is used by MSSQL or another application, assign another);
- Add inbound rule in Windows Firewall for the Listener port on all servers.
And this is all.
Other settings like
Initial Role, Automatic Failover, Readable Secondary etc. can be done during the initial configuration
and after, but taking in consideration the steps above will make it work.
This is such a good post. One of the best posts that I\'ve read in my whole life. I am so happy that you chose this day to give me this. Please, continue to give me such valuable posts. Cheers!
ReplyDeleteangularjs Training in bangalore
angularjs Training in electronic-city
angularjs Training in online
angularjs Training in marathahalli
Great thoughts you got there, believe I may possibly try just some of it throughout my daily life.
ReplyDeleteDevops training in marathahalli
Devops training in rajajinagar
Nice post. By reading your blog, i get inspired and this provides some useful information. Thank you for posting this exclusive post for our vision.
ReplyDeleteJava training in Tambaram | Java training in Velachery
Java training in Omr | Oracle training in Chennai