Friday, August 27, 2010

SQL Server 2008 R2 - 2 node cluster build

SQL 2008 R2 on Windows Server 2008 R2 Clustered install
On both nodes

- need .NET 3.5 SP1 use the Role Management Tool

- Add Role - Application Server

Run the setup.exe - SQL Server Installation Center

- Click Installation on left > New SQL Server Failover installation

- Setup suport Rules - click OK

- Prod Key - click next

- EULA - accept - next

- Click Install

- Setup support Rules - will tell you more about what else you might want to install for this to work.

-  - MSDTC - not always needed for cluster. install if you want.

-  - MSCS - cluster validation report failure - http://support.microsoft.com/kb/953748 - if you havent validated your cluster, you get an error when trying to install - go to Failover Cluster manager and click Validate this cluster.

- prod key - click next

- EULA - accept - next

- Feature Selection - Database Services, Analysis Services, Reporting Services - next

-

Instance Config

- SQLServer Network Name - obxSQL0801

- Named Instance - SQL1

- next

Disk Space Reqs - you will need at least 4 or 5 gbs of local disk space if you're going to install the services I listed above.  I had to go back and shut down my vms and cut a D drive (thin-vhd) of 20GB on each of my nodes. then you can install all your SQL bits on the new D drive instead of on the OS drive.

- instance root directory - d:\

- next

Cluster Resource Group

- SQL Server cluster resource group name - SQL Server (SQL1)

- next

Cluster Disk Selection

- select both of your cluster disks for data and logs

- next

Cluster Network Configuration

- uncheck DHCP and put in an available non-DHCP address

- next

Cluster Security Policy

- select Use service SIDs (recommended)

- next

Server Config

- create a service account in AD obxClusterService

- use obxbill\obxClusterService

- next

Database Eng Config

- select mixed mode

- specify your sa password

- click add current user

- click Data Directories tab, make sure you're using the correct drive for the type of db file - i.e. R:\Data and L:\Logs and R:\Backup, etc, etc

- next

Analysys Services Config

- click Add current user

- click Data Directories tab, i.e. R:\OLAP\Data, L:\OLAP\Log, R:\OLAP\Temp and R:\OLAP\Backup

- next

Reporting Services Config

- install but do not configure

- next

Error Reporting

- next

Cluster Installation Rules

- all passed - hit next

Ready to Install

- click install, go have a drink and a smoke now.

- maybe call your mom to let them know you passed the CISSP Exam...

- think about what to have for dinner

- go water some houseplants

- decide that a potbelly samich sounds easy enough

Complete

- close

now go to the obxNode04 and start the SQL install just like you did here

- setup.exe - Installation > Add node

Setup Support Rules

- all passed - ok

Prod Key - next

EULA - accept - next

Setup support files - install

Setup Support Rules

- all passed - next

Cluster node config

- select your SQL1 instance

- next

Service Accounts

- enter the password for the service acct you created earlier

- next

Error Reporting

- next

Add Node Rules

- passed

- next

Ready to Add node

- click install

Add Node Progress

- if you havent gone to go get dinner by now.  It's probably a good time. :)

- next

Complete

- success! - close

okie dokie - test your failover cluster by moving the SQL1 application, etc, etc and now go eat sandwich and watch Jeopardy or somethin.

Thursday, August 26, 2010

FreeNAS - This thing rocks.

FreeNAS is a free network-attached storage server OS. Personally, I like to use it as a VM with 256 MB RAM (higher if your going to do RAID5, then you want 512, and if you're thinking ZFS then, better give a gig) and an 8GB thin provisioned VHD on one of my ESXi servers. You could probably get away with an even smaller VHD drive for the OS. Supposedly only 128MB. I figure, I'll give it a thin-provisioned disk and if it ever needs it, it'll grab it then. Minimum Hardware Requirements

  1. Download the ISO file of the version you want from here

  2. Create and start a new VM with 8gb thin vhd, 256 mb ram and give it a name like obxFreeNAS01 with your iso file attached.

  3. Once it's started, choose to install FreeNAS on the local 8gb thin vhd.

  4. Then configure your IP address as DHCP first... then let it initialize.  Now, I know you don't want a stupid DHCP address on that thing. because you don't want your iSCSI initiators out there losing a potentially very important connection to it's drive. But trust me on this...

  5. Test a regular ol web browser and point it to the DCHP address that it was assigned.  Just to make sure you get a login at all.

  6. Shutdown your FreeNAS vm. Now configure a few new thin-provisioned VHDs for this VM.  Make a 5gb, 10gb and a 20GB one.  Later we'll use them for things like a quorum, data drive and a log drive for a SQL 2008 R2 Failover Cluster :)

  7. Start up your FreeNAS vm.

  8. Configure a static IP address for the FreeNAS... let it initialize.

  9. Now, go open a browser and make sure that the login screen for FreeNAS comes up ok.

  10. login with username admin and password freenas Once you're in, you should go update the default password to something else and also create yourself a new user account with admin privs.

  11. Next to come... the steps to create iSCSI Targets for your Windows 2008 R2 nodes to use for a Failover Cluster.

  12. Disks > Management > click the + link, select a disk you want to carve for your cluster (it'll be something like da1)

  13. Give it a description, like Logs. Leave it Unformatted and click Add

  14. Do the same for all of the vhds that you created for your cluster. I've got 3. Quorum of 5gb, Data of 20GB and Logs of 10GB.

  15. Disks > Format > Format UFS for each of your disks, give them a Volume label that matches your descriptions from the previous steps.  There's many ways to skin this cat.  This is simply my little method.

  16. Disks > Mount Points > click the + link. Give it a mount point name and description. I'm boring, I just used the same names I used for the respective volume names and disk descriptions. click Add.

    1. Oh yeah... you might notice that things get stuck in Modifying status... uh... don't forget to click APPLY CHANGES.... it's a sneaky little button at the top of the page in a few places.



  17. Services > iSCSI Target > Settings > Set your Base Name...

    1. I'm using iqn.2007-09.jp.ne.peach.obxFreeNAS01



  18. Services > iSCSI Target > Initiators> create an initiator for your own subnet.

    1. (i.e. 192.168.1.0/24)



  19. Services > iSCSI Target > Portals > use  the static IP address of your FreeNAS VM.

    1. something like this 192.168.1.58:3260



  20. Services > iSCSI Target > Targets > create an extent file for each of your disks

    1. mine looks like this: Extent name - Data0, Type - File, Path - /mnt/Data/data.file, File Size - 20Gib, Comment - Data

    2. now! Create a Target for that extent file we called Data0 and give it a Target Name of Data0

    3. Click Add at the bottom, now click Apply Changes at the top.



  21. ok - now you're ready to build a Windows 2008 R2 cluster.  Just fire your nodes up and use the local iSCSI initiator to connect to your disks. Bring em online, initialize them, format them, give them drive letters and give them a volume name.

Thursday, August 19, 2010

Windows 2008 R2


  1. Create vm with 1gb ram, 12gb hd, with Win2008R2 64bit iso and run

  2. Activate Windows with PID

  3. Update Time Zone

  4. Update computer name and join domain (don't reboot just yet!)

  5. Enable Remote Desktop

  6. Turn off Windows Firewall for Domain, Home and Public

    1. Think about it. This server is in the green zone. And it you wanna have Symantec CSP installed, you eventually want this off anyway.



  7. Install VMWare Tools

  8. Shut down the VM

  9. Reconfig the VM to have only 512mb RAM... yes, thats right folks! Squeeze-em'!

  10. Start the VM, and now RDP straight to the box via either the name or IP

  11. Start > Admin Tools > iSCSI initiator - click yes to turn the service on

  12. Put the IP address of the OpenFiler Server in the Target box on the first tab > click Quick Connect

  13. Connect to each of the disk resources that are going to be clustered (quorum, data, logs)

  14. Click OK

  15. Open Disk Manager and bring each disk online

  16. Then give them the same drive letter as they are on the other node(s)

  17. Open the Initial Configuration Tasks > Add Features > Select Failover Clustering

  18. Click Next > click Install > click Close

  19. Start the Failover Manager

  20. Click Validate Configuration > Add the current server name > click Add

  21. Enter the name of another Windows 2008 R2 Ent x64 VM that is configured the same way up to this step.

  22. Click Next, Run all test > click Next > Confirmation click Next > Click View Report

  23. Create a new cluster > give it a name > give it an IP address > click Next

  24. Confirmation click Next > Summary Success! click Finish

  25. Shut down each node - bring one node online and then bring the other one online.  Reboot each node to test failover of the disk resources.

  26. now you can install SQL 2008 R2 as a cluster

Stop whining list




  1. FreeNas...

  2. Windows 2008 R2 2 node Cluster build

  3. IIS 7.5

    1. php.iis.net

    2. WordPress 3.0 Post Setup

    3. mySQL - with phpmyadmin



  4. SQL 2008 R2 Enterprise cluster build

    1. Majority node set with cluster, witness server

    2. Shared disk with quorum from iSCSI Target from FreeNAS



  5. Self-Signed certs (SSL)

  6. ISA - 443 to 80

  7. RDP default port add/change - entry on http://d.patrickoneill.com/?p=83

  8. MOSS 2007 to MOSS 2010 upgrade/migrate

  9. get patches for Mom's computer :)

Monday, August 9, 2010

Users in SharePoint with email addresses not associated with the domain

This is a pretty easy one actually. 

  1. Start > Run > dsa.msc (this opens Active Directory Users and Computers)

  2. Select the user. On the General Tab, change the email address to an email address that your domain isn't managing (i.e. @yahoo.com, @gmail.com, etc, etc). Click OK

  3. Open SharePoint Central Admin console. Click the SSP link off of the Home page of Central Admin

  4. Login (duh).

  5. Under User Profiles and My Sites > Click User Profiles and Properties

  6. Click Start Full Import

  7. After the import is completed, you should view the target user's profile and remove any Proxy addresses.


Next, if the user has already been granted access to your MOSS Web Application, you will need to remove the user and then re-add the user back into their original permissions. Then, when you go to view the user's profile details, they will show up with the user's new email address.

Friday, August 6, 2010

To put the entire SQL server into single user mode

This is for SQL2005, for SQL 2008, you will need to change the directory where the sqlservr.exe file is located.




Open Cluster Admin - stop SQL services

open cmd prompt and type (or copy/paste) the following:

cd "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn"

sqlservr.exe /s SQL1 /c /m /T3608

- you will see a bunch of stuff fly by on the cmd window, this is normal

start SQL Management Studio

Click CANCEL! on the connection prompt

Click New Query - then select your database from the drop list (it's right under the New Query button)

Paste in your DB reindex t-SQL script in the query window and execute

Set a database into Single User Mode











ALTER DATABASE [URSTUPIDDATABASE] SET MULTI_USER WITH NO_WAIT


ALTER DATABASE [URSTUPIDDATABASE] SET SINGLE_USER WITH NO_WAIT







or





EXEC sp_dboption 'URSTUPIDDATABASE', 'single user', 'false'

EXEC sp_dboption 'URSTUPIDDATABASE', 'single user', 'true'