lunedì 4 marzo 2013

The long and winding road (AKA Installing a Windows 2008 R2 SQL Cluster) - Part1

In this article, we'll talk about what we need, we'll install all the Windows machines needed and the domain controller as well. We'll talk about IP addressing plan as well.

You will need the following ISOs:
  • Windows Server 2008 R2 with Service Pack 1 (x64) - DVD (filename en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso)
  • SQL Server 2008 R2 Enterprise (x86, x64, ia64) - DVD  (filename en_sql_server_2008_r2_enterprise_x86_x64_ia64_dvd_520517.iso)
  • FreeNAS-8.0.3-RELEASE-p1-x64.iso
You can get the first two from MSDN, the third one from the Freenas website.

You will need three Windows 2008 licenses, two for the datacenter edition, one for the enterprise edition.

You can get these too from the MSDN website. I guess you could use other versions of Windows 2008 R2 as well.

The virtual lab will be composed of 4 machines:
  • One domain controller installed on windows 2008 enterprise
  • Two cluster members on windows 2008 datacenter. 
  • A fourth machine will be used to install the NAS that the cluster members share.

You will need to setup two virtual networks, one for the management of the cluster and to make the cluster reachable from other machines, the second network will be used for replication/communication between cluster members and the NAS.

The hardware requirements for the virtual machines are as follows

Domain Controller and cluster members
  • RAM: 2GB
  • HD: 40GB
  • 2 NIC
  • RAM: 1GB
  • HD1: 2GB (this will be used to install the OS)
  • HD2: 4GB (this will be used as the quorum disk of the cluster)
  • HD3: 4GB at least (2.5GB are reserved by the OS, the rest will be used as storage)
  • 1 NIC
As virtualization software, I used VMWare workstation 7. The whole lab runs pretty smoothly on a Lenovo W510 laptop, as long as you have at least 12GB of RAM and  the new i7 CPUs.

Installing the domain controller and the cluster members

I won't spend much time on this topic, we should all be able to install windows on a virtual machine. The only thing to keep in mind is that we might want to update the VMs before installing the cluster and/or the domain controller software. To do so, the machines will need access to the internet, at least in this initial phase. After Installing the windows updates, we can move the NICs of the machines to some other virtual network. I'll just put here a couple of pictures of the menus during the installation of the VM, where the installation options we need diverge from the standard options.

we choose the ISO with the Windows 2008 R2 software

The machines will need 2GB of RAM

We will set initially the NIC to NAT, so that we can download Windows updates and activate the machines

Before creating the VM, remember to add another NIC, by clicking the "customize hardware" button

The second interface can be put on an internal network for now, since the primary one is the one that will be used to download updates.

NOTE: you will not need to install 3 windows machines from scratch, but just 2: one datacenter for the cluster members and one enterprise for the domain controller. The second cluster machine can be cloned from the first one. You will just need to clone it after you updated it and before activating it. By using two different license keys, the two machines will be different.
The high-level procedure to install the 3 machines is
  1. install from scratch the DC on windows 2008 enterprise version
  2. update it to the latest version and activate it
  3. install from scratch one cluster member on windows 2008 datacenter version
  4. update it to the latest version and clone it
  5. activate both cluster member machines with different license keys

Assigning IP addresses to the Windows machines

At this point, you should have three windows machines up and running, updated to the latest windows update and activated. You should assign ip addresses to your systems and put their interfaces into the correct virtual network.
For this lab, I used 2 internal networks for the NAS and the SQL cluster members. The DC had one leg on one of the internal networks and the other one was NATted by vmware, so that it could still have internet access. Here is a schema for the lab, you see that you will have to come up with an addressing schema for the two networks and choose ip addresses for all of the interfaces, the only exception being the external interface of the DC/App server, which will receive it from DHCP. On top of the physical interfaces, you should reserve another 2 IP addresses on "Virtual network1" for the VIP of the cluster and for the VIP of the SQL server.

So the breakdown of IPs needed is

Virtual network1 -----> 5 IPs needed
Virtual network2 --------> 3 IPs needed

In my case, I chose the following IP addresses, you can come up with your addressing plan, if you prefer

Create firewall rules so that the three windows machines can communicate with each other

Now your machines have an IP address, but they still cannot communicate with each other. Windows 2008 R2 comes out of the box with firewall blocking inbound connections, so if you want your boxes to communicate correctly, you will need to create firewall rules that allow communication on these networks. The simplest way to do it is to create some rules that allow inbound communication from any host on the two virtual networks we created.
Click on Start and in the search box type wf.msc, this will bring you to the firewall console. We will create a single inbound rule allowing any ip address on the two networks.
Click on Inbound Rules and select as an action "New Rule"., this will bring this window

As Rule type, we will create custom rule, so that we can specify whole networks and all ports. The next couple of screens can be left with default values.

In the scope window, as remote addresses we will specify the networks we agreed upon for virtual network1 and 2.

In the Action window, we will need to make sure that allow connection is selected. The rest of the options can be left as default, you need to specify a rule name.

Create this rule on all of the windows machines.

NOTE: On the domain controller, since it has no NIC on the VMnet6/Virtual Network 2, there is no need to specify in the scope the network
After creating the rules on all of the windows machines, you can test that everything is working fine by running pings between the hosts.

Installing the domain controller

At this point, networking should be set up and the three windows machines should be able to ping each other. Next step is installing the domain controller.

Click on Start and type dcpromo. Installation of the Active Directory software begins.

after a few minutes you should get to this window.

Clicking next will bring you to this warning, which can be ignored.

Here we have the first important choice which is about which kind of domain we want to to create. We will create a new domain in a new forest.

Next you will need to choose a domain name, I chose mysqlcluster.local
The software will do a couple of checks to verify that the domain name or netbios names you chose are not in use and then you will get here

here you need to choose the compatibility level of your domain with other domains. Since we do not plan to install other domains or join this domain to an existing forest, we can choose windows server 2008 R2 as the forest functional level. Next the software will examine your DNS configuration and bring you to this screen

Here you will be requested to install DNS software on the DC. After doing so, the DC can act as the DNS for the cluster members. It will resolve names in the domain and send unknown DNS requests further up along the chain of DNSes you configured on it.

You will receive a warning that your DC has an IP assigned by DHCP on one interface, you can safely ignore this error and choose Yes, the computer will use an IP address automatically assigned by a DHCP server

Another warning we don't care about, since we do not intend to integrate this DNS in an existing DNS structure. Just click Yes and move on

Next you will need to select where to save some files which are used by AD. Although, I understand, it is recommended to put these files on different volumes, we will leave the default values and click next

 Here you can choose your domain administrator password. For simplicity, I used the same password for all of the accounts of the cluster.

NOTE: Once you create the DC, you won't be able to use local users anymore to login on the DC, just domain credentials, so be sure to save this.

Almost there, summary screen

installation begins. After a few minutes you will be asked to reboot the DC and that's it, you've successfully installed a domain!

onto part 2!

Nessun commento:

Posta un commento