Monday Feb 02, 2009

Sun Ray load balancing with Windows 2008 and 2X Loadbalancer

Had a sucessful installation at a customer today where we installed a Sun Ray environment talking to a Windows 2008 Terminal Server farm. We used a third party bit of software called 2X Loadbalancer which costs very little but does a good job at loadbalancing. So I thought I would blog this in case anyone else was interested in doing this.


So I have to thank some of the guys in Desktop Engineering for the basic instructions. I have just added the other steps required to get it all working.


I had 2 Sun Ray servers and 2 Terminal servers setup. So the steps were:


1. a. Install Sun Ray server as usual on Solaris 10x8 server with latest patches installed. Say yes to Kiosk mode during setup. Setup failover group and made sure all that was working. I used Sun ray 4.1, the -01 patch for Sun Ray 4.1, Sun Ray Windows Connector 2.1, and Solaris 10 x86 Update 6.


b. Customer already installed 2 Windows 2008 servers with Terminal services enabled.


2. Download the following from www.2x.com. 2X LoadBalancer, 2X Terminal Server Agent and 2X Client Gateway.


3. Install 2X Loadbalancer, Terminal Server Agent and Client gateway on the primary Terminal server, and install the Agent on the other Terminal server.


4. Launch 2X config console and under Farm add both (W2003) terminal servers, the Farm--> Add both TS1 & TS2


5. Change TS1 & TS2 rdp port to something 9000 from standard 3389 --> In the farm edit the TS properties and replace RDP port 3389 with 9000.


6. From 2X console LoadBalancer option, select LoadBalncer alogorithm as either "Round Robin" or "Resource Based".


7. We changed so that the 2X Gateway listens at port 81, So use uttsc with -P 81 option. You can use default Port 80, but if you have IIS installed on the W2008 server then you need to change the port to something else.


8. I then used the usbdrived from http://blogs.sun.com/danielc/entry/a_usb_drive_daemon_for1 to make USB drive mounting alot easier.


9. Installed the ScreenLock package from http://wiki.sun-rays.org/index.php/SRSS_Addon:_SRWC_Lockscreen which automatically locks the screen once the smartcard is removed.


10. Then setup Kiosk mode on Sun Ray. I chose the Java Desktop System and inserted the following logic in the JDS Kiosk mode script in /etc/opt/SUNWut/sessions/jds3/jds3-kiosk-session (backuped up the original once first!!!!!). The code takes the username from the User Name field of a registered smartcard and logs into the terminal server with that user. If no card is used then blank login is done. Also turns on sound, client drive mapping for the USB drive, and required switches.


__________________________________________________________________


USERNAME=`/opt/SUNWut/sbin/utuser -p $SUN_SUNRAY_TOKEN | grep "User Name" | cut -f2 -d=`


WINTS=psydmts01


DOMAIN=addomain


if [ ! -z "$USERNAME" ];


then


exec /opt/SUNWuttsc/bin/uttsc -m -b -A 24 -E wallpaper -E theming -u $USERNAME -d $DOMAIN -r sound:high -r disk:USBDRVS=$HOME/USBDRVS -P 81 $WINTS


else


exec /opt/SUNWuttsc/bin/uttsc -m -b -A 24 -E wallpaper -E theming -r sound:high -r disk:USBDRVS=$HOME/USBDRVS -P 81 $WINTS


fi


____________________________________________________________________


11. Restart Sun Ray services and that was it.


The only gotcha we found was with the Windows Firewall which blocked port 81.


As far as testing went we tested different scenario's such as getting a session on one Sun Ray server and then going to the other Sun Ray server and starting a new session and regaining your Windows session. Also load balancing scenarios for the Windows side and Sun Ray side of things, and it all worked fine.


So it was a nice outcome and the customer is very happy with it. Hope this helps someone. This is may not be the best way to do this but it did achieve the outcome and met customers exact requirements.