Silver and Gold have a way of really bringing the look and feel of the Christmas season.
Silver and Gold also seem to represent something of greater value.
We are now into the final three articles of the 12 Days of pre-Christmas. And with these three articles, I hope to bring something that is of more value than anything shared so far.
Of course, the value of these articles is subjective. I have my opinion as to why these are more valuable. I hope to convey that opinion as best as possible to help bring out as much value as can be garnered from these articles.
Let’s first recap what we have to date.
On the Tenth Day of pre-Christmas…
My DBA gave me an education. Sure, everyday so far in this series could possibly be an education. This is an education via a lab. Every DBA should have a lab to be able to test features and hone skills. A lab is a better place to do some of the testing that needs done than the DEV, QA, or even Production environments.
Think about it, do we really want to be testing the setup of clustering in the DEV environment and potentially impact the development cycle? I’d dare so no.
Unfortunately, reality does not always allow for a lab environment to be accessible to the DBA. So the DBA needs to make do with other means. It is due to these types of constraints, that I am devoting the next three days to the setup of a lab. This lab can even be created on a laptop. I created this lab on my laptop with only 8GB of ram. I was quite pleased to see that it performed well enough for my testing purposes.
We will begin with an introduction to the technology used – VirtualBox. I will also discuss the creation of enough virtual machines to create a SQL Cluster (domain controller, two sql boxes, and a NAS) along with the configuration steps to ensure it will work.
For this lab, we will be using Virtual Box. You can download Virtual Box here. And yes, the tool is one that is provided by Oracle. Two of the reasons I want to use Virtual Box is the ability to install multiple operating systems, and the tool is currently free. Another benefit is that I can easily import virtual machines created in VMWare as well as Microsoft Virtual Server/Virtual PC (I have not tested any created in Hyper-V).
While you are downloading the Virtual Box app, download the Extension Pack as well. Links are provided for the extension pack on the same page as the application download. Be sure to download the Extension Pack for the version of Virtual Box you download.
The version of VirtualBox I will be using for this article is 4.2.2. As of the writing of this article a new version has been released – 4.2.6. The differences in versions may cause the instructions in these articles to be inaccurate for 4.2.6. You can use whichever version you deem appropriate. I just won’t be covering version 4.2.6 and don’t know if the screens are different or it the settings are different.
You can check your version in the Help.About Menu.
For this lab, we have a few things that will be required prior to setting up the SQL Cluster. Two big components of this infrastructure are Storage and a Domain. We are going to simulate shared storage through the use of FreeNAS. We will be discussing FreeNAS today.
For starters, we can download FreeNAS from here. You might be able to find a few configuration guides online for FreeNAS. Most of them seemed to be for really old versions and were less than usable for the version that I had downloaded. All settings to be discussed today are pertinent to FreeNAS-8.3.0-RELEASE-x64 (r12701M).
To setup FreeNAS, we will need to have a Virtual Machine configured with the following settings.
- A BSD VM with FreeBSD as the version.
- Ensure the motherboard settings only has the “Enable IO APIC” setting checked.
- Three Virtual Disks (1 for NAS OS, 1 for SAN Storage, and another for a Quorum)
- 512 MB memory
- 2 Network Adapters (1 Internal and 1 connected to the Host-Only Adapter)
Despite the FreeNAS actual disk requirements being rather small, any fixed disk size less than 2GB causes mount errors. Any amount of memory less than 512MB also causes a mount problem. These settings are the minimum configurations to save the hair on your head.
The Network Adapters is more of a strong suggestion. I was able to get it to work with only one adapter, but it was more hassle than it was worth. I found it easier to configure for use by the cluster later if I had two adapters. The two adapter configuration also allows me easier administration from within the VM environment as well as from the host machine.
One other thing to do is to mount the FreeNAS ISO that has been downloaded to the CD drive that is created by default with the VM creation. I mount the ISO before booting by opening the settings for the VM within Virtual Box. On the storage screen, highlight the “Empty” CD Icon in the middle then click on the CD Menu Icon on the far right as shown below.
Navigate to the folder where the FreeNAS ISO is saved and then click ok until you are back at the Virtual Box manager screen. You are now ready to start the machine and finish the install and then configure.
Once powered on, you should eventually come to the following screen.
Select to Install/Upgrade. From here, you will see a few more prompts such as the next screen to select the installation location.
This should be pretty straight forward installation options for the IT professional. I will not cover all of the installation prompts. Once the install is finished, you will need to reboot the VM and un-mount the installation media. The system will then come to the following screen.
Now that we are at the console screen, the next step is to configure the Network Interfaces. You can see that I have already done this based on the IP addresses seen at the bottom of the screen. I will leave the configuration of the IP addresses to you. Both the internal network and the host-only network will need to be configured. The host network should be the second adapter. Keep track of the IP addresses that have been configured. We will need to use them later.
In a browser window we will now start configuring the storage to be used by our Lab. In the address bar, we will need to input the address we configured for the host network. In my case, 192.168.56.103. When that page loads, the first thing we need to do is change the Admin password.
The default password is empty. Pick a password you will remember and that is appropriate. With that done, we can configure the storage.
The Next setting, I want to configure is the iSCSI setting. In order to use the volumes that we create, we must enable the iSCSI service. In the top section, click the Services button. This will open a new tab in the web browser. On the Services tab, we need to toggle the slider for iSCSI to the “ON” position as shown in the image.
Once toggled, we can configure the iSCSI settings for the volumes we will now create. From here, we click on the storage tab. And then we will click on the Import Volume button. Give the Volume a name, specify the disk and then specify the volume type.
Now go back to the Services tab where we enabled iSCSI. There is a wrench icon next to the toggle to enable the service. Click on this wrench and a new tab will be opened (again within the FreeNAS webgui) and the focus will be switched to this new tab. On the “Target Global Configuration” ensure that Discovery Auth Method is set to “Auto.” If it is not, make the change and click save at the bottom.
Next is the Portals. The portals should be empty so we will need to add a portal. By default, only one IP address is displayed for configuration on a new Portal entry. We want to configure two IP addresses. First, select 0.0.0.0 from the IP Address drop down on the new window that opened when clicking on “Add Portal.” Then select “Add extra Portal IP”.
Next is to configure an Initiator. For this lab, I created on Initiator specifying ALL for the Initiators and Authorized Network as shown here.
With an initiator and a portal in place, we now proceed to the configuration of the Targets. I have configured three targets and the main difference is in the name. They should be configured as shown here.
Almost done with the setup for the storage. It will all be well worth it when we are done. We need to configure Device Extents and then Associate the targets, then we will be done.
Like with the Targets, I have three device extents configured. The configuration for each is the same process. I want to give each a name that is meaningful and then associate the extent to a disk that we imported earlier.
Last for this setup is the Target to Extent association. This a pretty straight forward configuration. I named my targets the same as extents so there was no confusion as to which should go with which.
That wraps up the configurations needed to get the storage working so we can configure a cluster later on. Just getting through this configuration is a pretty big step in getting the lab created for use in your studies and career enhancement.
Next up in this series is to show how to configure (in limited detail) a domain and DNS, and then to install and configure a cluster. Stay tuned and I will even through in a few tidbits here and there about Virtual Box.
I didn’t include every screenshot possible throughout the setup of FreeNAS and the configuration of iSCSI. Part of the fun and education of a lab is troubleshooting and learning as you go. If you run into issues, I encourage you to troubleshoot and research. It will definitely strengthen your skill-set.