Wednesday, April 10, 2013

Web Cluster , Terminal server load balancing , SQL Clustter- Win2008




In this Blog I used 6 win2008 servers , I'll work on 3 parts as follows;

1- Web server clustering. (2VM servers)

2- Terminal Services Load Balancing. (2VM servers)

3- Microsoft SQL Cluster with load balancer.(2VM servers)



 --------------------------------------


Web server clustering

In this lap I use the following virtual machines;

Machine 1:

            Machine name: Web1

                        External IP: 192.168.250.70

                        Internal: 10.10.10.120

Machine 2:

            Machine Name: web2

            External IP address: 192.168.250.71

            Internal IP: 10.10.10.121

Domain name: Client1

Web Balancer : 192.168.250.69

-----------------

I installed Active directory on both machines , Domain name is : Client1
 
First, you have to add Web server (IIS) role on both servers from server manager.

Second, Add Network load balancing feature on both servers.






 
1-     Open Network load balancing management console.


Right click on Network load balancer, then new cluster.

Choose Web2, IP 192.168.250.71, then next

 
2-     In new Cluster host parameters, leave the priority to be 1 then next.

3-     On New Cluster: Cluster IP Address screen, add 192.168.250.69 to be the first cluster IP address.(IP for load balancing)

 

4-     In cluster Parameters; add a full internet name , example: web and change operation mode to be Multicast then next



5-     On Port Rules , click finish

Create a new host to be web1 with IP 192.168.250.70 with the same steps as above.



To test the load balance:

Ping web server –t and disconnect any of the 2 server.

Web server must work and reply without lose any packets.

******************  Now we finished first part ***********************

--------------------------------------------------------------------------------------------------


Let's go to second part;







Terminal Services Load Balancing

 

In this lap I use the following virtual machines;

Machine 1:

            Machine name: TRM1

                        External IP: 192.168.250.72

                        Internal: 10.10.10.131

Machine 2:

            Machine Name: TRM2

            External IP address: 192.168.250.73

            Internal IP: 10.10.10.132

Domain name: Client1

----------------------------------------------

Information:

Terminal service load balancer provide (increased availability, scalability, and load-balancing performance, Session reconnection)

Terminal Services Session Broker service

This service maintains a database that keeps track of terminal server sessions in a load-balanced terminal server farm and provides information to the terminal server, which is used to connect users to existing sessions.


 

1-      Click Start, point to Administrative Tools, and then click Server Manager.

2-      Under Roles Summary, click Add Roles.

3-      In the Add Roles Wizard, review the Before You Begin page, and then click Next.

4-      On the Select Server Roles page, select the Remote Desktop Services check box, and then click Next.

5-      On the Select Role Services page, select the Remote Desktop connection Broker and Remote Desktop Session host check box, and then click Next.

6-      On the Confirm Installation Selections page, click Install.

7-      On the Installation Results page, click Close.




-          Repeat steps for TRM2 server.

 

-          Open Active directory users and Computers from Domain Controller.

 

o   Add New OU named ex: TS Session Brokers.

o   Move TRM1 and TRM2 to the new OU.

-          Open group Police Management from Administrative tools.

o   Create a new GPO from TS Session Brokers section








-          Edit Session Broker Policy as follows;

o   Open Computer configuration → Policies → Administrative Templates→ Windows Components → Remote Desktop Services →Remote desktop session host →RD connection Broker.

 







Select standard services

-          Change Join RD connection Broker to be enabled

-          Change Configure RD Connection.

o   Broker Farm name to be enabled and choose RD Connection Broker farm name , ex: “TSFARM”







-          Change Configure RD connection Broker server name to be enabled and choose a server name ex: “web1.client1.loc”








-          Change use RD Connection Broker load balancing to be enabled.

Open DNS Manager from Administrative tools in domain controller.

-          Create a new host on Forward zone as shown below














 

Login to TRM1

-          Open Server Manager → Configuration → Local users and groups → Groups

-          Add TRM1 , TRM2 to Session Broker computers group






 




- Login to TRM2 and Add TRM1, TRM2 to Session Broker computers group

-          Run : “ gpupdate /force “ on Domain , TRM1,TRM2

 
Open Remote Desktop Session Host Configuration  from Remote Desktop services in Administrative tools in TRM1 and TRM2 server.

 

-          Select Member of Farm in RD connection Broker

 


Select RD connection Broker








 

To Test Terminal services;

1-      Logon from any machine to TSFARM  , You’ll login to TRM1

2-      Login from another machine to TSFARM  , You’ll login to TRM2

3-      Login from another machine to TSFARM  , You’ll login to TRM1

 

To change the profile to be roaming profile in Terminal server,

Go to Administrative toolsComputer ConfigurationPolicies Administrative Templates System User Profiles

Then edit Set roaming profile path for all users logging onto this computer to be enabled and choose a path for the profile ex: \\WEB1\tsprofiles\%username%







 

 ----------------------------------

Let's go to third part;





Microsoft SQL Cluster with load balancer
In this lap I use the following virtual machines;
Machine 1:
            Machine name: SQL1
                        External IP: 192.168.250.74 (not impportant)
                        Internal: 10.10.10.140
Machine 2:
            Machine Name: SQL2
            External IP address: 192.168.250.75 (not impportant)
            Internal IP: 10.10.10.141
Domain name: Client1
SQL Cluster:
            Windows Cluster IP: 192.168.250.76
            MSDTC IP:   192.168.250.77
SQL Virtual IP: 192.168.250.78
----------------------------
1-     Download and install starwind software to be shared storage in virtual machines instead of SAN disk on Domain Controller.



 
-         Open Starwind management console and add a new host (Local host) then connect to it.

-         Go to host RegistrationInstall License

-         Select Target Add Target.
-         Choose Alias in Target Alias, ex: data and select Allow multiple concurrent ISCSI(Clustering) then next.
-         In Target list select data→ Add new device to the target.
-         Select Virtual Hard Disk then next.

-         Select Image file device then next.

-         Select create a new virtual disk then next.

-         In Add Device wizard window, add a new virtual disk and assign its size then next.
o   I saved it in c:\Image\data , Size: 5GB

 -         Select the best cache mode then next.

-         Create another 3 Target for log file named: (logs, msdtc, quorum) as above.
Quorum: Based approach to monitoring overall cluster health and maximize node-level fault tolerance.
-         Go to Node1 and Node 2 and perform the following;
o   Open iSCSI Initiator from Administrative tools.
o   Click Discovery tabDiscovery portal , then add Domain controller IP

-         Go to Targets tab, youll see the 4 disks as below.

-         Clicks connect to the 4 disks.
-         Go to Disk Management in computer management, you will find the 4 disks unallocated.
-         Right click on every disk , select online→ Again right click and Initialize disks Select default options.
-         Right click on every disk to create volumes and format it.
Remind that you have to check that every disk letter is the same in 2 machines.
Add Windows server Clustering:
Add Failover Cluster feature from server manager on both SQL servers.
-         Open Failover Cluster Management.
-          Select Validate configuration then next.
-         Add both SQL servers then click next.
-         Select Run all tests and click next then finish.

-         Select Create a Cluster in Management section and click next.
-         Add both SQL servers then click next.
-         Choose a windows cluster name ex: wincluster , Assign windows cluster IP address ex: 192.168.250.76 and click next then finish , remind that it use quorum disk.

-         Review the Cluster created from Failover Cluster Management by selecting (Services and Applications, Nodes, Storage, Networks).
-         Go to storage tap and change the disk for Quorum.
o   To change the disk, right click in the cluster→More Actions→Configure Cluster Quorum settings.
o   Click Node and Disk→ change the disk to be the right one then next and finish.
-         To use Quorum file share on Quorum disks, perform the following;
o   Right click in the cluster→More Actions→Configure Cluster Quorum settings.
o   Select Node and file share.
o   Add domain controller machine.





o   Add a new share folder and change the permission to be read and write.





o   Let us look after file Quorum sharing, before sharing , you can use file sharable but now you can use all disk drives.





Now as you have finished the cluster, we have to add Application server role on both SQL servers from server manager.
-         Select Incoming and Outgoing Transactions Next Finish.
Now we will add MSDTC (Distributed Transaction Coordinator) cluster .
-         Open Failover cluster management from Administrative tools.
-         Right click on Services and Applications Configure a service or Application  Next.
-         Select Distributed Transaction Coordinator (DTC) Next.
-         Choose a name that the client will use when accessing the services or application, or leave the default winclusterDtc.
-         Assign an IP address, I used: 192.168.250.77.
-         Choose the drive that was assigned to MSDTC before , I used G disk.










 Now Congratulations that you finished Clustering the server.
 
Now we will begin to install SQL server failover cluster.
-         Insert DVD then next.
-         Select New SQL failover cluster installation.
-         We will install (Database Engine and Analysis services because it is a cluster.
Reporting Services and Integrated services is not a cluster (Stand alone installation) but we can add it to be on both servers.
Shared Features: It is only one instance which means that you will install one copy.
In this Lap I installed the following;

-         Type SQL network name in Instance configuration ex: SQLCLUS, you can change the Instance Id if you like or keep it defaultNext.
-         Type SQL resource name group in Cluster Resource group or you can leave it default Next.





-         Select Data disk and Logs disk in Cluster Disk Selection , I Used Disk1,2 Next.
-         Remove DHCP selection and us an IP address for SQL in Cluster Network Configuration. I used: 192.168.250.78 Next.





-         Leave the default (Use service SID) in Cluster Security Policy because its recommended from Microsoft.
-         Select Use the same account for all services remind that its recommended to use a specific created user for SQL services ano not Administrator.
    
-         Type password for mix mode authentication in database Engine Group , I used Password add current userchange database log directory in Data Directions to be on F diskNext Install.
Now we have finished installing on SQL node1.
To check SQL Cluster, Go to Services and Applications in Failover Cluster Management, You must see SQL network name, IP, Resources.
 
Let us go to SQL2 and install SQL.
Begin installation.
-         Select Add node to a SQL Server Failover Cluster because we have already a cluster.
After Installation SQL on SQL2, Go to SQL1 node and open Failover management.
-         Select SQL server under Services and Applications.
-         Open SQL server in Other Resources section by right click Properties.
-         Select Dependencies Tap, We will see that it depend on Cluster disk 1 and 2.
-         You can set the policies from Policy tab.
-         Check that both nodes are selected in Advances Policies.
Now we are going to manual failover
-         Select Failover Management SQL server Right clickMove the service Move to SQL2.
Finally , Install SQL SP1 on Passive mode on both SQL servers.

Thanks,
 
Alaa Ahmed