This is the 1st post of high availability. This post contains always on configuration and its failover.
- VMware Workstation
- Windows Server 2012
- SQL Server 2012
Three Virtual Machines for Configuring Active Directory and Windows Server Cluster
1: Installation of VMWare to Create Virtual Machine.
On VMWare tool create a new virtual machine.
Welcome to new virtual machine wizard select typical and click to next.
Here we have to select windows operating system iso file while we will select it later so I am selecting last option ‘I will install the operating system later’ and click on next.
Here we have to select type of operating system which we are going to install. Select Microsoft Windows and as version select Windows Server 2012 then click on next.
Here we are going to put the windows server machine name and give the path for setup files. After click on next.
Here we allot the C:\ Drive space for virtual server which we are going to install then click on next.
On the customize Hardware we can initialize the RAM 1024MB for the virtual machine and review which we are selected for virtual machine and then click on finish.
Now go to AD on left pane and open the properties of the virtual machine.
Here we are giving the path of Windows Server 2012 ISO image file. Then click on next tab option.
Here we are sharing the local machine path for future need. Click on ok.
Right click on the virtual machine and click on power.
Select language and click on next.
Click on install now.
Select operating system, Windows Server 2012 Standard (Server with a GUI), Click on next.
Accept the licence and then next.
Select custom type.
Check the drive space and Click on next.
Operating system installing. It takes few time to install.
Operating System has been installed, Now reset the password then click on finish.
After reseting the password login to server.
Windows Server 2012 has been installed. Now change some settings as per our requirements.
Change the Windows Server Machine name, go to properties of the computer, Click on change settings, System Properties popup will open.
Click on change and change the computer name.
After changing the machine name click on OK.
It will ask to restart the system. So click on OK.
After Restarting System, Open the network sharing Center, On the Network and Sharing Center Go to Change adapter setting on left pane.
Right Click on Ethernet0 and go to properties.
Select Internet Protocol Version 4 (TCP/IPv4) and click on properties.
Here give the IP address for server and click on ok.
After that go to firewall settings.
And turnoff the windows firewall.
Go to VM and Install VM-Ware tools, Click on Run setup64.exe.
Click on next.
Select typical and click on next.
Click to install.
After completion for installation it ask to restart the system, Click on yes and Restart the system.
Now install two more windows servers as just like above. And give the IP address as below mentioned.
IP Address: 192.168.10.11
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1
Preferred DNS: 192.168.10.10
For Node 2:
IP Address: 192.168.10.12
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1
Preferred DNS: 192.168.10.10
After configuring all three Windows Machines. Ping to each machine, make sure all are pinging to each other.
Now we are going to Windows Machine 1 (AD) and install the Active Directory Domain Service.
Login to AD and go to Server Manager and add roles and features.
Click on Next.
On the Installation Type Select Role-based or feature-based installation and click on next.
On server selection select server from server pool and click on Next.
On server roles Add role as selected on below snapshot and click on next.
Right now we are only adding the active directory roles so leave it as usual and click on next.
Click on next.
And on the confirmation click to install.
Installation in progress. After completion click on close.
Now we are going to configure post deployment, it shows a notification as below snapshot.
On the deployment configuration we are going to create a new forest so click on add a new forest and give the root domain name and then click on next.
On the domain control option give password for domain controller and click on next.
Currently we are configuring active directory domain services so no need to specify DNS hence leave specification DNS and click on Next.
Verify the NetBIOS domain name as shown above snapshot and click on next.
Check for paths of configuration of AD Domain Services and click on next.
Review the Complete Configuration and click on next.
Check prerequisites and go to install.
Installation is progress, after completion the installation and Active Directory Domain Services Windows Server takes reboot the server.
After restart AD will become as domain controller.
After login to server we can check the system properties as configured sql.ind.in domain.
After configuration active directory domain services on AD. Now go to Node1 and Node2 server and add these servers on domain.
Go to system change properties and click on member of as domain and give the domain name and click on ok.
Give the active directory domain credentials.
After clicking Ok it will open the pop-up for welcome to the domain. Click on ok.
Asking for restart the machine for reflecting the domain services.
Restart the machine and login to server.
Apply the same process with Node2 machine.
2: Installation of Windows Cluster Services on Node1 and Node2 Server.
Now we are going to configure the Windows Cluster between Node1 and Node2.
On the Node1 Server, install failover cluster feature. Go to server manager and add role and features.
Click on add roles and features.
Select Role-based or feature-based installation and click on next.
Select a server from the server pool and click on next.
Select feature failover clustering and click on next.
Confirm installation selections and click to install.
After completion the installation close the wizard and cofigure the failover cluster manager on node2 server as well.
On Node1, Go to server manager and click on tools and select failover cluster manager.
Go to Validate Configuration for checking the compatibility of cluster nodes.
Click on next.
Enter the Server Name which we want to configure the cluster, click on next.
On the testing option select Run all tests and click on next.
Confirmation for validate tests, click on next.
Validation tests are running, wait a while.
Check the validation summary and click on finish.
On Create Cluster Wizard, Click on Next.
Here we are providing the Windows Server Cluster Name and Cluster IP Address. Click on Next.
Verify once Cluster Name, Nodes and IP Address, Click on Next.
Wait a while for configuration of cluster.
After configuration of Cluster, Click on Finish.
Now WinCluster is available on Failover Cluster Manager on both nodes.
3: Installation of SQL Server on Node1 and Node2 Server.
On Node 1 and going to install the SQL Server 2012.
Make sure you run the setup ‘Run as Administrator’.
The SQL Server Installation Center window will display. Along the left side of the window are the categories showing how the SQL Server Installation Center is organized. On the right side of the window are different actions the installer can take.
Clicking on Installation on the left pane will display the different installation options. For this, we are clicking on “New SQL Server stand-alone installation or add features to an existing installation”. This will launch the SQL Server 2012 Setup application.
On the Setup Support Rules.
Check the Setup Support Rules and Click on OK, On the below snapshot select the edition of sql server and click on next.
Accept the licence terms and click on next.
Check the products updates and click on next.
On setup support rules check the rules and click on next.
Select SQL Server Feature Installation and click on next.
Select features which we have to install for our sql server on the instance feature we have selected required features and click on next.
Installation rules checking for visual studio 2010 updates, click on next.
Instance configuration, select default instance and click on next.
SQL Server checks the available free disk space for installation files. Click on next.
SQL Server select service accounts for which account our sql service will run. Click on next.
On the database engine configuration select mixed mode authentication and give the password for SA account and specify the sql server installation user. Then click on next.
On the reporting service configuration sql server installs reporting service share point integrated mode. Click on next.
Specify the user for distributed replay controller and click on next.
On the distributed replay client click on next.
On error reporting there are no errors so click on next.
Installation configuration rules check the rules status and click on next.
Check the configuration summary and click to install.
On the below snap shot SQL Server has been installed successfully.
Now we have to install SQL Server on Windows Server Node2 as well.
After installing SQL Server on both nodes, go to SQL Server Configuration Manager.
Right click on SQL Server Service and go to properties, Go to tab of AlwaysOn High Availability and Enable AlwaysOn Availability Group and Click apply and OK.
It will ask for restart the service, hit ok and Restart SQL Service.
Apply this on both Nodes.
4: Configuring AlwaysOn Availability Group on Node1 and Node2 Server.
Now Connect to SQL Server Management Studio on node1 server and restore AdventureWorks2012 Database where we have to configure AlwaysOn Availability.
Go to Object Explorer, Right Click on Databases and select restore database.
As below snapshot click on device and select the backup file which we have to restore.
Click on OK.
After restoration database it will show on object explorer under database tab.
Now we are going to share the read write permission to backup location for node2 server where we are going to configure AlwaysOn replica.
Go to property of folder which we are going to share with node2 server replica.
Click on edit, add the node2 server and give the full control as shown in below snapshot. Then click apply and OK.
Now on share tab and click to share.
Share with Node2.
After sharing keep this folder a side and take the backup of database AdventureWorks2012 with this location.
Right Click on database go to task and then hit on backup.
Take full database backup for database AdventureWorks2012, make sure database recovery model is full.
After completion database backup, go to object explorer in SSMS and right click on AlwaysOn High Availability and select New Availability Group Wizard.
Click to next.
On specify Availability Group Name we are going to mention the Availability Group Name and click on next.
Select the database for configure alwayson availability group and click on next.
Note: For AlwaysOn Configuration database should be in full recovery mode and at-least took a full database backup.
Configure replica for always group availability.
Configure the Endpoints for AlwaysOn Availability Group.
Configure preferred replica for backup.
Configure the listener for connecting the database and click to next.
Here we are selecting the database synchronization preference.
Note: For full preference we required a file share path which is accessed by all replica’s.
Verify validation checks and click to next.
Verify the selections which going to configure and click to finish.
On the completion wizard check the summary status and close.
After refresh the instance, database is in synchronous state, visible Availability Group under AlwaysOn High Availability.
5: Failover AlwaysOn Availability Group from Node1 to Node2 replica.
For the AlwaysOn Group failover, Right click on Availability Group under Primary Replica and select Failover.
Select node where we have to failover and click to next.
Connect the Instance Replica and click on next.
Verify the replica and click to finish.
Check the roles and close.
After refresh the instance we can able to see the failover replica.
Congratulations. You have successfully configured and failover AlwaysOn Group Availability on SQL Server 2012 on your personal computer.