Walkthrough: Single-Server Deployment

This deployment walkthrough shows how to deploy an instance of Notification Services on the database server. Typically, you would use this type of deployment for small to medium applications for internal use, not for large application or applications for commercial use.

Note

All deployments of Notification Services are unique. Use the procedures in this topic as a guideline for developing and testing your own deployment instructions.

The following picture shows the hardware configuration for this deployment scenario. The server, named NS1, has multiple disk drives to improve the performance of the databases and notification applications.

Single-server configuration

Prerequisites

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

  • You have installed the operating system on server NS1 and have applied all applicable service packs and updates.
  • The computer meets the Microsoft SQL Server requirements. For more information, see Hardware and Software Requirements for Installing SQL Server 2005.
  • You are running these procedures under an account that has administrative permissions on the server.
  • You or your domain administrator has created or specified an account for Notification Services to use. For the purpose of these procedures, this account is DOMAIN\NSService.
  • You have created any necessary file shares for source files and data files, and have granted the necessary permissions to your account and the DOMAIN\NSService account.
  • If you have any Notification Services components on remote servers, 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 tasks:

  1. Install Notification Services and Database Engine.

  2. Grant Microsoft Windows permissions to the NSService account.

  3. Create and enable the instance of Notification Services.

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

  5. Grant database permissions to the Windows account.

    Note

    Notification Services also supports SQL Server Authentication.

  6. When you are ready to start generating notifications, start the instance of Notification Services.

The instructions below use the Notification Services command prompt to show how you can script deployment. You can also deploy an instance of Notification Services using SQL Server Management Studio. For general deployment instructions that use SQL Server Management Studio, see SQL Server Notification Services Samples.

NS1 Tasks

Perform the following steps on server NS1 to deploy an instance of Notification Services on the database server.

Step 1: Install Software

  1. Install the SQL Server Database Engine and Notification Services on NS1. You can also install workstation components, but they are not required for the steps in this walkthrough.

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

Step 2: Grant Windows Permissions

  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 your 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 3: 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 "ICFPath\ICFName"

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

  2. Type the following command to enable the instance:

    nscontrol enable -nameNSInstanceName-serverdatabaseServer

    The engine components are in the Enable Pending state because the Notification Services engine has not been installed and started.

Step 4: Register the Instance of Notification Services

  1. At the command prompt, type the following command:

    nscontrol register -name NSInstanceName -server databaseServer -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 this login. For more information, see nscontrol register Command.

Step 5: Grant Database Permissions

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

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

  2. Type the following command to create a DOMAIN\NSService user in the instance database and to add the user to the NSRunService database role:

    sqlcmd -E -SdatabaseServer-Q "USEinstanceDatabase**;**

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

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

  3. If you have separate application databases, type the following command to create a DOMAIN\NSService user in the application database and to add the user to the NSRunService database role:

    sqlcmd -E -SdatabaseServer-Q "USEapplicationDatabase**;**

    **    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.

You have now deployed the instance of Notification Services. You should be able to load subscriber and subscription data and submit events to your applications. Notification Services does not generate notifications until the Windows service is started. Starting the Windows service is discussed below.

Starting the Instance of Notification Services

When you are ready for the instance to start generating notifications, start the Windows service. On server NS1, open a Command Prompt window and type the following command:

**net start NS$**instanceName

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