Mar
8
ARR 2.0 and Logging in
March 8, 2012 | Leave a Comment
While I am still very happy with Application Request Routing 2.0, I am still having some issues with one of my sites that requires a login, which is my wiki.
As I described in my last post, basically you end up logged into one machine in the cluster and not the other so you suddenly switch from seeing content and being logged on to then seeing a login page again!!
It is pretty frustrating and just refreshing the page to then see if you get the logged in machine does not always work.
Interestingly enough, I have not yet noticed any problem on WordPress so I am starting to wonder if this issue is linked to the specific software in question.
Questions questions!
I am working in Switzerland at the moment so I do not have physical access at the moment so I am having to use Remote Desktop on occasion.
I have to deploy a new version of Orders of Battle soon to fix a minor bug in the Locations page, but other than that I have been focusing on research when I have the time. Unfortunately as I have to work for a living I do not have as much time as I would like.
Needless to say, I am sorry once again for the lack of postings, but I hope to start posting again soon.
Perhaps I should talk about the places I have been visiting? Switzerland is a very beautiful country and there is lots of things to see!
Dec
30
Application Request Routing 2.0
December 30, 2011 | Leave a Comment
In the last month, I have finally completed my rewrite of http://www.ordersofbattle.com in ASP.NET MVC 3.0. Prior to that, the site was still using ASP.NET Webforms, which was the original technology I used when I first built the application in 2003-2004.
I intend to write another article about MVC in more depth soon.
However, as part of the deployment of my first MVC version (1.1.0.2), I also decided to setup and deploy ARR 2.0. ARR stands for Application Request Routing.
ARR is a fairly new technology from Microsoft which is part of IIS which allows admins to create a “server farm”. In this scenario, website users send requests to a “controller” website which then forwards them to a specific web server depending on certain criteria defined in the controller.
This criteria is used to determine which content web server to actually send the HTTP request to.
I now have two content web servers running, each one runs on a specific Hyper-V server, so I get some sort of load balancing across both physical servers. Each webserver accesses the same database at the backend.
I have now migrated all my websites, including my PHP blogs and my internal sites, to the new ARR structure.
So far, it is working well and I intend to add a third content web server soon to see if that helps performamce and response time.
I have also used URL Rewrite to point the old URIs from the old Webforms site to the new MVC URIs, but more on that another time.
One problem I did notice was that if you have a situation where users are actually logging in to a website, the user can “lose” their session because subsequent requests are sent to the “other” webserver, into which the user is not logged in!! Needless to say, this is pretty confusing!!
One minute you are logged in to the website and with the next page, you are suddenly no longer logged in!
The solution to this problem is to disable caching and to set the “memory cache duration” setting in the controller to 0.
I still have to figure out “outbound URL Rewrites”, but so far things are looking good and I am pretty happy!   Â
All webservers are running as Virtual Machines in Hyper-V so it is very easy to add new webservers to the mix if the need should arise.Â
Â
Dec
25
Happy Christmas to One and All
December 25, 2011 | Leave a Comment
Wishing everyone who reads this a very happy Christmas and a prosperous New Year!
Sep
26
New Hyper-V Server specifications
September 26, 2011 | Leave a Comment
One or two people have been kind enough to ask me what the specifications are for my second Hyper-V server which I built in August and which is now running both this website and the database behind it and my other websites and their associated datastores.
At the risk of sounding geeky and all, here are the hardware components that I used:
- Thermaltake LAN Box Lite VF6000BNS (Case)
- Thermaltake TR2 W0379RU 500W ATX 12V (Power Supply)
- Supermicro MBD-X9SCM-F-O LGA1155 Intel with Dual LAN (Motherboard)
- Intel Xeon E3 Sandy Bridge 3.2GHZ LGA 1155 QuadCore (CPU)
- 16 GB Kingston RAM - ECC (Memory)
- Crucial RealSSD C300 CTFDDAC064MAG-1G1 2.5″ 64GB (Boot Disk for Hyper-V OS)
- Intel EXPI9400PTBLK Gigabit (Additional NIC for connection to SAN)
- Thermaltake AC0014 3.5″ HDD Converter for 2 2.5″ HDs (Needed to mount 2.5″ SSD in 3.5″ slot)
- Addonics 2.5″ Disk Array 4SA (Holds 4 2.5″ HDs)
- 2 250GB Western Digital Blue 5400RPM Hard Drives (in Windows RAID-1 for additional local storage)
The main differences from the original machine are as follows:
- Server Motherboard instead of desktop Motherboard
- Server RAM instead of desktop RAM
- SSD instead of array of 4GB CF Cards to hold operating system
- Different additional NIC Card
I have upgraded my original Hyper-V server to now use 4 CF cards instead of 2. These cards are raided together as RAID-6 and provide 8GB space for the Windows Server 2008 R2 OS. Originally I installed the Server Core version but I have now reinstalled the standard interface as it is easier to use when you are in a hurry.
As a result of having two Hyper-V machines, I now have the ability to have almost-duplicate VMs on either machine which are identical in composition and software. (NOTE - all one does is copy the VHD to the destination location, boot it and then run “sysprep” to create a brand-new machine with a different identity to the original but the same OS, programs etc).
In addition, using the extremely useful SQL Examiner 2008 software from SQL Accessories, I have been able to setup hourly batch jobs which synchronise the different databases, both SQL and MySQL) between the VMs on the one Hyper-V server to their equivalents on the other!
As a result, my data is stored on two identical separate VMs on two separate hardware platforms and therefore, if one Hyper-V server should for some reason become unavailable, all I have to do is point the router to the “spare” webserver on the other Hyper-V server and we will be back in business!!
Finally all VMs themselves are stored in a RAID-5 SAN so I have some redundancy there too.
Aug
27
Now operational on new Hyper-V Server
August 27, 2011 | Leave a Comment
All my websites are now operational on Virtual Machines (VMs) running on the Hyper-V Server which I have recently built and configured. As a result of the flexibility afforder by virtualisation, the MySQL database now has its own dedicated machine rather than having to share a server box with SQL Server!!
Now that evrything has been migrated to the new server, I can now reconfigure the old server to use the new SAN box instead of having everything running on local hard drives. Both Hyper-V boxes will share the same SAN which is RAIDed so both VMs and their applications and data will all be stored on the same physical disks, but will be logically separate owing to iSCSI and will run on separate physical machines.
Cool!!Â
Aug
25
Thunderstorms and other Problems
August 25, 2011 | Leave a Comment
As any remaining readers of this somewhat intermittent blog are probably aware, things have been a bit quiet on here recently.
There are several reasons for this….
1. I have not been updating as often as I should. This is my fault and I will endeavour to do better!!
2. A rather nasty thunderstorm in early June this year fried my UPS!
Point no. 2 provides a real reason why this site was down for most of June and all of July. I was working abroad for the 6 months after early February and as such was not physically able to sort things out after the storm in early June. My wife’s cousin managed to get everything up and running again for a few days, but then my Hyper-V server which holds both website and database servers failed to reboot properly.
As I was several thousand miles away from home, there was precisely nothing I could do about it until I returned home at the end of July.
The actual cause was some error or file corruption in the Hyper-V Server operating system files that prevented the machine from successfully booting. As a result, the virtual machines in the Hyper-V box had no chance of starting!
I was able to reinstall the Hyper-V Server Core OS a few days after I returned home and all my websites were restored to full health in early August. Hurrah!!
As a result of this debacle, I have considerably revamped my server setup by purchasing three new Cyberpower UPS boxes to ensure that almost every piece of electronic equipment in my network cupboard has both surge protection and UPS.
To help prevent future downtime of my websites, including this one, as a result of the failure of the Hyper-V box, I have built an additional Hyper-V server so that all virtual machines have been duplicated across both boxes. I will describe the specs of this new machine in my next article.
This website and ordersofbattle.com plus a few other internal sites are now all running on a VM in the new Hyper-V box and not the original Hyper-V server. Additional I have migrated my SQL Server databases to a new VM in the new Hyper-V server and I am in the process of setting up new MySQL databases for this blog and other functions on a different dedicated new VM in the new Hyper-V server.
Finally, I have now got a SAN which holds all the Virtual Hard Drive files used by the various VMs on the two Hyper-V boxes so that these very important files are now held on a dedicated RAID cluster for disk speed and redundancy. These RAID volumes are dedicated to the VMs and are provided via iSCSI to the host Hyper-V servers via a dedicated Hub.
So, all in all, there has been a lot of change and a lot of new technologies have now made their appearance at chez Tech-CRM!
PS - Please accept my sincere apologies for both the downtime and the lack of posting. I hope to provide some excuses for the lack of posting in a future post. Â
Mar
23
HyperV Server Architecture
March 23, 2011 | Leave a Comment
Designing and researching the components for my new HyperV Server took some considerable time.
I had originally intended to use VM Ware, but it is very picky about Network Drivers, Storage Drivers, Motherboards etc and I found it difficult to find components that were actually on the Compatibility List. Therefore, after some research I decided that HyperV would probably fit my requirements just as well.
For the system, I wanted to build, I had the following criteria:
- Lots of RAM (as much as possible)
- Two or more Network sockets
- Built-in Video card if possible
- Fast CPU
- Smallest case possible (because I want to use a SAN for storage)
- Install Server OS on Flash Disk for speed and reliability
- External Storage (SAN or NAS)
- As cheap as possible as I ultimately want to build TWO Servers for redundancy
I did not want to build a large boxy system with lots of disks in it because I have got used to building Mini-ITX boxes that are really small and fit on a shelf. As I also wanted to build a SAN for my storage, a large box would end up empty wasting a lot of space and power.
My requirements were slightly contradictory as lots of RAM and CPU speed do not match up with a small case!!
I did look at Mini-ITX motherboards, but any with space for more than 4GB RAM were few and far between and very expensive.
That left me with a choice of ATX and Micro-ATX boards. ATX would give the option to install frightening amounts of RAM if I really wanted (one or two Motherboards were avaiable on Newegg with space for up to 48GB RAM!!), but this size of motherboard would necessitate a larger case that would have a bigger power supply and that was something I did not need as I wanted to build a separate SAN (Storage Area Network) for the disks that would be used by the Virtual Servers.
That left Micro-ATX Motherboards which were a bit smaller but still had a good range of case options and would still give me up to 16GB RAM which should be more than enough to run several servers on.
In the end, I ended up with the following Hardware for the new server:
- Case - Thermaltake LAN Box Lite VF6000BNS
- Power Supply - Thermaltake TR2 W0379RU 500W ATX 12V
- Motherboard - ECS H57H MicroATX LA1156 w Dual LAN & 16GB RAM
- RAM - G Skill 240pin DDR3 1333 8 GB RAM
- CPU - Intel Core i5-661 Clarkdale 3.33GHz with VGA
- CF Disk - Emphase 4000 CF 4GB
- CF Disk Expansion Card - Addonics Quad CF PCI Controller
- Disk Bracket - Addonics 2.5″ Disk Array 4SA (Holds 4 2.5″ HDs)
- Hard Disk - WD Scorpio Blue 120GB 5400rpm
After some testing, I discovered that 4GB was not enough space to install HyperV Server Core on and I had to buy another 4GB CF card and raid 0 them together to form a 8GB Disk. In due course, I will add additional 4 GB CF cards and reset the RAID level to 10 or something to give the HyperV Disk configuration some speed and redundancy.
The Addonics Quad CF Disk Controller is a PCI Card that lets you mount up to CF Cards on the card and it has a RAID Controller so you can raid the CF cards together. It’s a bit over the top, but I like the idea of the HyperV OS not being installed on the same disks as the guest OSs and Flash disks are very resilient and boot much faster than regular Hard Disks.
Although I wanted to build a SAN, initially I would have to have internal hard disks for the Virtual Servers, so I bought a cheap Hard Drive to install the intial VMs on. The Addonics disk array is a clever way of mounting up to 4 2.5 inch disks in a 5.25 inch slot so that way I would have lots of flexibility for the hard disks in the case.
The Motherboard had hardware RAID built in, but did not have a built in VGA card. However, most modern Intel CPUs now had a VGA Adapter built in so I did not have to buy a separate Graphics adapter. The Motherboard had two Gigabit slots, but HyperV really needs three (one for the SAN) so I ended buying another Expansion Card with a third Gigabit adapter on it. I started out with 8 GB RAM, but soon upgraded to 16GB RAM.
Initially, I did not do anything for the SAN as I was hoping to reuse my existing (now redundant) Mini-ITX boxes as SAN machines, but after installing the SAN software on them, the CPU crashed on one machine so I was left with only one SAN box until I rebuild the failed Mini-ITX machine so right now I do not have a SAN as I am away from home at the moment and am not there to fix any hardware issues.
In time, I will buy or build a dedicated SAN box to hold a RAID-10 array of cheap disks.
Of my existing Mini-ITXs, one is now the Hyper-V Console while the other will be put to work as a Storage Server in due course, possibly as an iSCSI Target. More on the SAN later.
Right now, I only have one physical machine, but in time I want to build another to have true redundancy.
Currently the box is only running the Web Server and the Database Server, but I hope to build additional servers soon.
Jan
8
Virtual Machine Thoughts
January 8, 2011 | Leave a Comment
One of the things that has been occupying my time over the last few months has been the concept of Virtual Machines.
The advantages seem obvious!! You need to build a new server for a specific purpose and rather than build a physical server, you just create a new virtual machine on your VM Host box, assign it some memory and hard disk space, install your operating system and off you go!!
I had not really considered the advantages of virtual machines until I worked for a client in the USA that used VMWare extensively. That gave me the opportunity to see them in action and discuss them with the system manager there who was only too happy to talk about their advantages at length.
It is one thing to talk about something; it is another to actually do something about it.
I am happy to say that I have now built my first VM Host machine and almost all my various databases are now running on the VM Server that is running on the VM Host instead of running on a dedicated physical server.
I hope to migrate all my websites to the VM Host machine too in the near future and then IÂ intend to convert both former physical machines into SAN Disk boxes providing disk server space for the VM Host machine.
This is a subject that I intend to write at length about soon.
I originally intended to use the free version of VM Ware; but after some research discovered that VM Ware is very picky about hardware and rather than spend a lot of time and money building or buying a system that was acceptible to VM Ware, I decided to use MS Hyper-V Server instead because it is not near so fastidious about network drivers, CPUs, motherboards etc.Â
Jan
3
Happy Christmas and Happy New Year 2011
January 3, 2011 | Leave a Comment
A belated Happy Christmas and Happy New Year to all my readers!!
Have just return from two weeks in Spain (which was great).
Oct
21
Logging Thoughts
October 21, 2010 | Leave a Comment
I have been keeping busy on the Order of Battle Development front recently where I have been implementing log4net on my middle-tier classes and on some windows services front ends.
It may sound straightforward, but changing over 50 classes to log the same methods and events to the log is a non-trivial task and has taken me quite some time to do. I am almost finished now though.
I should have implemented logging when I wrote the code years ago, but as usual, logging got left by the wayside.
So far, it is working well logging to a dedicated database table; but I hope to change this to logging to a file soon.
I finally decided to implement log4net after it was recommended by a colleague (thanks Mark!) because I have a couple of recurring bugs that are hard to track down because they are on a windows service running on a remote server and they are hard to reproduce.
I hope to deploy all my changes soon.
On the Exception side of things, people have recommended Elmah to me but I have not yet got round to taking a good look at it.

