space
Previous Page | Next Page

SAS/IntrNet 9.2: Application Dispatcher

Services on Windows Platforms

Creating a Service

To create a service for an Application Server running in a Windows operating environment, perform the following steps:

  1. From the Start menu, select Programs  [arrow]  SAS  [arrow]  IntrNet  [arrow]  Create a New IntrNet Service.

  2. Read the information in the IntrNet Config Utility Welcome window. Select Next to continue.

  3. Select the type of service that you want to create. Select Next to continue.

  4. Type the name of the new service. (Remember that service names must begin with either a letter or an underscore and can contain letter, number, underscore, or dash characters.)

    The default value for this field is default. Create this as your first service because this is what is used when you run the samples. Select Next to continue.

  5. The configuration utility selects a default service root directory based on the location that you chose for user files when you installed SAS software. This default location is recommended for most users, although you can use the Browse button to select a different directory. Select Next to continue.

  6. If you are defining a socket service, you are prompted to specify the TCP/IP port numbers or names for each Application Server that you want to define as part of this service. If you supply multiple numbers or names, use a space to separate each entry. Select Next to continue.

  7. Review the contents of the Service Created window for information about your service. Note the Application Broker configuration sample text. You are required to enter similar text in the Application Broker configuration file in a later step. Select Next to continue.

  8. The Create Service window displays all of the information that you specified for this service. Verify the information in this window before continuing. If it is not correct, select the Back button to change the information. If it is correct, select Next to create the service.

  9. Select Next and then select Finish to exit the utility.

  10. If you are creating a pool service, you must install the Application Load Manager. You might also want to install the Load Manager if you have a socket service with more than one server. See Using the Load Manager for more information.

  11. If you are creating a pool service, you might need to install the SAS Spawner. The Spawner is not required if you configure the Application Load Manager to start the service directly. If you choose this method, the servers must all execute on the same system as the Load Manager and under the same user ID. Refer to the SAS/CONNECT documentation for installation instructions for the SAS Spawner.

  12. The Application Broker must know about the new service before you can access it. Open the Application Broker configuration file on your Web server in a text editor and add a service definition block. Example service definitions are provided in the template configuration file that is installed with the Application Broker. In addition, sample configuration text was generated by the configuration utility in a preceding step. The following examples also show service definitions.

    • The following code is an example of a socket service definition:

         # This service contains one server (port 5801) on yourserver.
         SocketService service-name
            ServiceDescription "text-desc"
            ServiceAdmin "administrator-name"
            ServiceAdminMail "administrator-email-address@host"
            Server yourserver
            Port 5801
      
    • The following code is an example of how to define a pool service that is started directly by the Load Manager:

         # Start up to 2 servers on the same node as the Load Manager. No 
         # username/password or spawner is needed for this case. Servers  
         # will time out after 30 minutes.
         PoolService service-name
            ServiceDescription "text-desc"
            ServiceAdmin "administrator-name"
            ServiceAdminMail "administrator-email-address@host"
            ServiceLoadManager load-manager-host:port
            SasCommand ""\"C:\\Program Files\\SAS\\SASFoundation\\9.2\\sas.exe\"+
               \"C:\\Program Files\\SAS\\IntrNet\\service-name\\appstart.sas\"+
               -rsasuser -noterminal -noprint -nolog -SYSPARM "
            IdleTimeout 30
            Server yourserver
            Port 2
      
    • The following code is an example of how to define a pool service that is started by the SAS Spawner:

         # Start up to 5 servers on node yourserver using the spawner started
         # at port 7777. All servers will be started with the specified 
         # username/password. At least 1 server will not timeout and 
         # will be kept running.
         PoolService service-name
            ServiceDescription "text-desc"
            ServiceAdmin "administrator-name"
            ServiceAdminMail "administrator-email-address@host"
            ServiceLoadManager load-manager-host:port
            SasCommand ""\"C:\\Program Files\\SAS\\SASFoundation\\9.2\\sas.exe\"+
               \"C:\\Program Files\\SAS\\IntrNet\\service-name\\appstart.sas\"+
               -rsasuser -noterminal -noprint -log /dev/null -SYSPARM"
            Server yourserver
            Port 6000-6004
            Username your-username
            Password your-password
            SpawnerPort 7777
            MinRun 1
      
    • The following code is an example of a launch service definition:

         LaunchService service-name
            ServiceDescription "text-desc"
            ServiceAdmin "administrator-name"
            ServiceAdminMail "administrator-email-address@host"
            SasCommand ""\"C:\\Program Files\\SAS\\SASFoundation\\9.2\\sas.exe\"+
               \"C:\\Program Files\\SAS\\IntrNet\\service-name\\appstart.sas\"+
               -rsasuser -noterminal -noprint -nolog  -SYSPARM "
      

Starting the Service

Socket services must be started manually. From the Start menu, select Programs  [arrow]  SAS (or your SAS 9.2 program group)  [arrow]  IntrNet. Select the entry for the service you just created, and then select Start Interactively.

Launch services are started automatically by the Application Broker. Pool services are started automatically by the Application Load Manager. See Using the Load Manager for more details.

After a service is started, you can test it from a Web browser. The URL depends on the platform and path where your Application Broker is installed. For typical installations, use one of the following URLs to test (or ping) a service:

Windows
http://yourserver/scripts/broker.exe?_service=service-name&_program=ping

UNIX and z/OS
http://yourserver/cgi-bin/broker?_service=service-name&_program=ping

Specify your Web server name in place of yourserver and your service name in place of service-name. You might need to use a different URL path if you chose a different path when you installed the Application Broker. If the service is running, an HTML page is returned stating that the Application Server is functioning.


Stopping the Service

Socket or pool services can be stopped from a Web browser. The URL depends on the platform and path where your Application Broker is installed. For typical installations, use one of the following URLs to stop a service:

Windows
http://yourserver/scripts/broker.exe?_service=service-name&_program=stop

UNIX and z/OS
http://yourserver/cgi-bin/broker?_service=service-name&_program=stop

Specify your Web server name in place of yourserver and your service name in place of service-name. You might need to use a different URL path if you chose a different path when you installed the Application Broker.


Modifying a Service or Accessing Service Log Files

Service configuration and log files are kept in a service directory tree. The service root directory can be accessed from the Windows Start menu. From the Start menu, select Programs  [arrow]  SAS (or your SAS 9.2 program group)  [arrow]  IntrNet. Select the entry for the service you just created, and then select Service Directory. This directory contains an appstart.sas file with the SAS code used to start the Application Servers for this service. Other scripts and configuration files for this service are also located in this directory.

Log files are placed in the logs directory under the service root directory and are named <day>_<port>.log. For example, Mon_5001.log or Tue_5001.log. By default, logs are kept for one week (six full days and one partial day) and then overwritten.

SAS 9 has implemented a set of % codes that can be used in the -log parameter. You must add a -logparm option in order to get the codes translated into the log. For example, adding the following options:

   -log 'C:\Program Files\Sas\IntrNet\service-name\logs\appsrv_%v.log'
   -logparm rollover=auto

creates log files with unique log filenames. The rollover=auto option causes an automatic "rollover" of the log when the directives in the value of the LOG option change. This is particularly useful for generating log files for pool or launch services. This example creates log filenames such as appsrv_1.log, appsrv_2.log, and appsrv_3.log.

Note: You must use a full path to specify the log file because there is limited control over what path the Load Manager or spawner will use as the current directory for each Application Server.

For more information, see the documentation on the LOGPARM= system option in SAS Language Elements.


Windows Services

Socket services can be installed as Windows services. Installing as a Windows service enables the service to run automatically whenever the Windows system is booted, even if a user is not logged into the system. As noted above, install the SAS Service Configuration Utility before you create any service that will be installed as a Windows service. Information about the SAS Service Configuration Utility is located in the SAS 9.2 System Requirements documentation at support.sas.com/documentation/installcenter.

From the Start menu, select Programs  [arrow]  SAS (or your SAS 9.2 program group)  [arrow]  IntrNet. Select the entry for the service you just created, and then select Install as Windows Service. This step does not start the service. Once the service has been installed as a Windows service, each time the system reboots the service is started automatically. You can manually start and stop the Windows service by using the Start Windows Service and Stop Windows Service menu selections. Note that you can still run this service interactively by using the Start Interactively menu selection, but only if the Windows service has been stopped.

A Windows service can also be uninstalled from the Uninstall Windows Service menu selection. This only uninstalls the Windows service. The SAS/IntrNet service remains and can still be run interactively.

The Services icon in the Windows Control Panel enables you to see the current status of all Windows services. Each SAS/IntrNet service display name begins with SAS App Server. Note that a separate Windows service is created for each server in a multiple server socket service. Individual servers can be started and stopped from the Services Control Panel. You can use the Start menu selections to start or stop all servers in the service.


Removing a Service

You can remove a service by deleting the service directory and removing the associated Start menu entry. Follow these steps:

  1. If the service is running, stop it.

  2. If the service is a socket service and has been installed as a Windows service, uninstall it as a Windows service. From the Start menu, select Programs  [arrow]  SAS (or your SAS 9.2 program group)  [arrow]  IntrNet. Select the entry for the service, and then select Uninstall as a Windows Service. Perform this step even if you are not sure if this service is installed as a Windows service.

  3. Find the service directory, select Start Menu, and select Programs  [arrow]  SAS (or whatever program group under which you installed SAS 9.2)  [arrow]  IntrNet. Select the entry for the service, and then select Service Directory.

  4. Go up one level to the parent directory and delete the directory for the service that you want to remove.

  5. Remove the Start menu entry for the service. To do this, right-click on the Start menu and select Explore All Users (or Explore on Windows 95/98).

  6. Use the Explorer window to find the Programs folder.

  7. Select SAS, then select IntrNet. Delete the service entry in this folder for the service that you want to remove.

Previous Page | Next Page | Top of Page