Jaa


Walkthrough: Clustered Single-Server Deployment

This scenario shows how to deploy an instance of Notification Services on a failover cluster using Microsoft Windows Authentication. This configuration is similar to the single-server deployment scenario discussed previously, but provides the higher availability offered by failover clustering. Typically, you would use this scenario for small to medium applications that require high availability. For more information about failover clustering and Notification Services, see Using Failover Clustering with Notification Services.

Note

This walkthrough provides an example of how to deploy Notification Services on a failover cluster, and assumes familiarity with failover clustering. The names and numbers of servers used are for example purposes only. Use the procedures in this topic as a guideline for developing and testing your own deployment instructions.

The following illustration shows the hardware configuration for this deployment scenario. This configuration has two servers, called NS1 and NS2, each with Notification Services and the SQL Server Database Engine installed. The NS$instanceName Windows service, which runs the Notification Services engine, is configured as a cluster Generic Service, allowing it to fail over to the other server when necessary.

This configuration uses shared drives for the cluster quorum resource, all database files, and all operational files. Sharing drives allows the cluster to access the drives independent of which server in the cluster is active.

Clustered single-server configuration

Prerequisites

Before you deploy an instance of Notification Services on a failover cluster, verify that all prerequisites are met:

  • You are familiar with Windows clustering and with using SQL Server on a failover cluster.

  • You have installed a Windows server operating system on NS1 and NS2 that supports failover clustering and have applied all applicable service packs and updates.

  • Windows Cluster Service is installed and running on NS1 and NS2.

  • You have a cluster group resource, called NSGroup for this walkthrough, containing the following resources:

    NSGroup resources Description

    Network name: NSCluster

    Network name of server cluster.

    IP address

    Cluster IP address.

    Physical disk K

    Disk that contains the Notification Services source files and the notification application's data files.

    Define additional disks (see G, H, I, and J in the illustration above) if the SQL Server resources are in the same cluster group.

    Note

    The drive mappings shown above are for the purpose of this walkthrough. You can choose your own names and drive mappings.

  • You have installed an instance of the SQL Server Database Engine on both nodes of the cluster, creating a SQL Server virtual server. The cluster resources for the SQL Server installation can be located in the same cluster group as the Notification Services resources or another cluster group.
    For more information about installing the Database Engine on a failover cluster, see Failover Clustering.
    The cluster quorum, database files, log files, and tempdb files should be on separate disks, as indicated in the diagram above.

  • You are running these procedures under an account that has administrative permissions on the server and is a member of the sysadmin fixed server role in SQL Server.

  • You or your domain administrator has created an account for the Notification Services engine. For this walkthrough, the account is called DOMAIN\NSService.

  • You have created the necessary file shares for files needed to deploy and run the instance of Notification Services.
    You have also granted the necessary permissions to these shares to your account and the DOMAIN\NSService account.

  • If you have any Notification Services engine components or client applications on remote servers, make sure TCP/IP or the named pipes network protocol is enabled on the Database Engine. In Microsoft SQL Server 2005, these network protocols are disabled by default. For more information, see SQL Server Surface Area Configuration.

Deployment Overview

In this deployment walkthrough, you perform the following on the primary server, NS1:

  1. Install Notification Services.

  2. Map network drives and create cluster File Share resources for deployment and run-time files.

  3. Grant Windows permissions to the NSService account.

  4. Create and enable the instance of Notification Services.

  5. Register the instance of Notification Services, which creates the Windows service that runs the Notification Services engine.

  6. Using Cluster Administrator, create a Generic Service that runs the Windows service on the failover cluster.

  7. Grant database permissions to the Windows account.

    Note

    Notification Services also supports SQL Server Authentication. When possible, use Windows Authentication.

You then perform the following steps on other servers in the cluster, which in this example is the single server NS2:

  1. Install Notification Services.
  2. Map network drives to deployment and run-time files.
  3. Add the Notification Services engine's account to the local Users group.
  4. Register the instance of Notification Services, which creates the Windows service that runs the Notification Services engine.

When you are ready to start the instance of Notification Services on the cluster, you start the Generic Service cluster resource.

First Server (NS1) Tasks

Perform the following tasks on NS1, a server in the cluster.

Step 1: Move the Cluster Group to NS1

  1. In Control Panel, open Administrative Tools, and then open Cluster Administrator.

  2. In the left pane, expand Groups.

  3. Select NSGroup, and then look at the Owner column in the right pane.

  4. If the Owner column indicates that another server owns the cluster group, right-click NSGroup, and then click Move.

    The NSGroup resource is now on NS1.

Step 2: Install Notification Services

  1. Install Notification Services. You can install additional components, but they are not required.

    For more information, see Installing SQL Server Notification Services.

Step 3: Create File Share Resources and Map Network Drives

  1. Using Cluster Administrator, create file share resources for source and data files. For more information, see the Cluster Administrator documentation.

  2. Map network drives to these files shares. For more information about mapping network drives, see your Windows documentation.

Step 4: Grant Windows Permissions to the DOMAIN\NSService Account

  1. On the Start menu, point to All Programs, point to Microsoft SQL Server 2005, point to Notification Services, and then click Notification Services Command Prompt to open a Notification Services Command Prompt window.

  2. Add the DOMAIN\NSService account to the local Users group. At the command prompt type the following net localgroup command:

    net localgroup users DOMAIN\NSService /add

    For more information on adding accounts to a local group, see your Windows documentation.

Step 5: Create and Enable the Instance of Notification Services

  1. At the command prompt, type the following command to create the instance and application databases:

    nscontrol create -in "Path\ICFName"

    Depending on the configuration file, you might need to provide additional command-line arguments and parameters.

  2. Type the following command to enable the instance:

    nscontrol enable -nameinstanceName-servervirtualDatabaseServer

Step 6: Register the Instance of Notification Services

  1. In the open command prompt window, type the following command:

    nscontrol register -name instanceName -server virtualDatabaseServer

        -service -serviceusername DOMAIN\NSService-servicepassword****"password"**

    When this command completes, a Windows service named NS$instanceName exists on the local computer.

Note

If you use SQL Server Authentication, you provide a SQL Server login and password when you register the instance, and then you grant permissions to the SQL Server login. For more information, see nscontrol register Command.

Step 7: Create a Generic Service Resource

  1. In Control Panel, open Administrative Tools, and then open Cluster Administrator.

  2. Open Groups.

  3. Right-click NSGroup, point to New, and then click Resource.

  4. On the New Resource page, enter the following information:

    Name: instanceName

    Resource type: Generic Service

    Group: NSGroup

  5. On the Possible Owners page, select NS1 and NS2 in the Available nodes list, and then click Add to move them to the Possible owners list.

  6. On the Dependencies page, select the NSCluster Network Name resource in the Available resources list, and then click Add to move it to the Resource dependencies list.

  7. On the Generic Service Parameters page, type the following information:

    Service name: **NS$**instanceName

  8. Select the Use Network Name for computer name check box.

  9. On the Registry Replication page, click Finish.

Step 8: Grant Database Permissions

  1. Type the following command to create a SQL Server login for the DOMAIN\NSService account:

    sqlcmd -E -S databaseServer -Q "CREATE LOGIN [DOMAIN\NSService] FROM WINDOWS;"

  2. Type the following command to grant the DOMAIN\NSService account access to the instance database and to add the account to the NSRunService database role:

    sqlcmd -E -SdatabaseServer-Q "USEinstanceDatabase;

    **    CREATE USER [DOMAIN\NSService];**

    **    EXEC sp_addrolemember N'NSRunService', N'DOMAIN\NSService';"**

  3. Type the following command to grant the DOMAIN\NSService account access to the application database and to add the account to the NSRunService database role:

    sqlcmd -E -S databaseServer -Q "USE applicationDatabase**;**

    **    CREATE USER [DOMAIN\NSService];**

    **    EXEC sp_addrolemember N'NSRunService', N'DOMAIN\NSService';"**

    If the instance hosts multiple applications, repeat this step for each application database.

  4. Close the command prompt window.

Important

Do not bring the Generic Service online at this time; bring the Generic Service online after configuring NS2.

Additional Server (NS2) Tasks

Perform the following tasks on server NS2.

Step 1: Move the Cluster Group to NS2

  1. In Control Panel, open Administrative Tools, and then open Cluster Administrator.

  2. In the left pane, expand Groups.

  3. Select NSGroup, and then look at the Owner column in the right pane.

  4. If the Owner column indicates that NS1 owns the cluster group, right-click NSGroup, and then click Move.

The NSGroup resource is now on NS2.

Step 2: Install Notification Services

  1. Install Notification Services. You can install additional components, but other components are not required for deployment.

    For more information about installing components, see Installing SQL Server Notification Services.

Step 3: Map Network Drives

  1. Perform the same network drive mappings to NSSourceFiles and NSDataFiles as you made on NS1. For more information about mapping network drives, see your Windows documentation.

Step 4: Grant Windows Permissions to the DOMAIN\NSService Account

  1. On the Start menu, point to All Programs, point to Microsoft SQL Server 2005, point to Notification Services, and then click Notification Services Command Prompt to open a Notification Services Command Prompt window.

  2. Add the DOMAIN\NSService account to the local Users group. At the command prompt, type the following net localgroup command:

    net localgroup users DOMAIN\NSService /add

    For more information on adding accounts to a local group, see your Windows documentation.

Step 5: Register the Instance of Notification Services

  1. On the Start menu, point to All Programs, point to Microsoft SQL Server 2005, point to Notification Services, and then click Notification Services Command Prompt to open a Notification Services Command Prompt window

  2. In the Command Prompt window, type the following command:

    nscontrol register -name instanceName -server virtualDatabaseServer

        -service -serviceusername DOMAIN\NSService-servicepassword****"password"**

The instance of Notification Services is now deployed and enabled on a cluster. You can add subscribers and subscriptions and submit events, but the instance does not generate notifications until you bring the Generic Service online. Bringing the Generic Service online is discussed below.

Starting the Instance of Notification Services

When you are ready for the instance to start generating notifications, bring the Generic Service online.

Bring the Generic Service Online

  1. In Control Panel, open Administrative Tools, and then open Cluster Administrator.

  2. In the left pane, expand Groups.

  3. Select NSGroup.

  4. If you want to move the cluster group back to NS1, right-click NSGroup and select Move.

  5. In the right pane, right-click Generic Service, and click Bring Online.

For more information, see Starting and Stopping Instances of Notification Services.

Troubleshooting

If your application does not produce notifications, check the status of the instance by running the following command from the Notification Services command prompt:

nscontrol status-name instanceName

Verify that all components are running on the expected servers and are in the Enabled state. For more information, see Viewing the Status of Instances, Applications, and Components.

Also check the Windows Application log for errors. For more information, see Troubleshooting Notification Services.

See Also

Concepts

Deploying an Instance of Notification Services
Deploying a Non-Hosted Event Provider
Deploying a Subscription Management Interface

Other Resources

nscontrol create Command
nscontrol enable Command
nscontrol register Command
sqlcmd Utility

Help and Information

Getting SQL Server 2005 Assistance