SAS/IntrNet 9.1: Application Dispatcher |
To create a service for an Application Server running in a Windows operating environment, perform the following steps:
From the Start menu, select Programs SAS IntrNet Create a New IntrNet Service.
Read the information in the IntrNet Config Utility Welcome window. Select Next to continue.
Select the type of service that you wish to create. Select Next to continue.
Type the name of the new service. (Remember that service names must begin with either a letter or an underscore and may 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.
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.
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.
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.
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.
Select Next and then select Finish to exit the utility.
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.
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.
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. Several examples are also shown below. Values that may need to be changed for your site are shown in green.
The definition block for a socket service might look like
# This service contains one server (port 5801) on yourserv.yyy.com. SocketService service-name ServiceDescription "text-desc" ServiceAdmin "administrator-name" ServiceAdminMail "administrator-email-address@host" Server yourserv.yyy.com Port 5801 |
A pool service that is started directly by the Load Manager is defined by
# 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 yourserv.xxx.com:5555 SasCommand ""\"C:\\Program Files\\SAS\\SAS 9.1\\sas.exe\"+ \"C:\\Program Files\\SAS\\IntrNet\\service-name\\appstart.sas\"+ -rsasuser -noterminal -noprint -nolog -SYSPARM " IdleTimeout 30 Server yourserv.xxx.com Port 2 |
A pool service that is started by the SAS Spawner is defined by
# Start up to 5 servers on node yourserv.yyy.com 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\\SAS 9.1\\sas.exe\"+ \"C:\\Program Files\\SAS\\IntrNet\\service-name\\appstart.sas\"+ -rsasuser -noterminal -noprint -log /dev/null -SYSPARM" Server yourserv.yyy.com Port 6000-6004 Username appdemo Password xyzzy SpawnerPort 7777 MinRun 1 |
Launch services are defined with
LaunchService service-name ServiceDescription "text-desc" ServiceAdmin "administrator-name" ServiceAdminMail "administrator-email-address@host" SasCommand ""\"C:\\Program Files\\SAS\\SAS 9.1\\sas.exe\"+ \"C:\\Program Files\\SAS\\IntrNet\\service-name\\appstart.sas\"+ -rsasuser -noterminal -noprint -nolog -SYSPARM " |
Socket services must be started manually. From the Start menu, select Programs SAS (or your SAS 9.1 program group) 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, the URL to test (or ping) a service is one of the following:
http://yourserver/scripts/broker.exe?_service=service-name&_program=ping
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.
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, the URL to stop a service is one of the following:
http://yourserver/scripts/broker.exe?_service=service-name&_program=stop
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.
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 SAS (or your SAS 9.1 program group) 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
-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.
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. Instructions for installing the SAS Service Configuration Utility are located in the SAS 9.1 user installation guide for Microsoft Windows.
From the Start menu, select Programs SAS (or your SAS 9.1 program group) 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.
You can remove a service by deleting the service directory and removing the associated Start menu entry. Follow these steps:
If the service is running, stop it.
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 SAS (or your SAS 9.1 program group) 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.
Find the service directory, select Start Menu, and select Programs SAS (or whatever program group under which you installed SAS 9.1) IntrNet. Select the entry for the service, and then select Service Directory.
Go up one level to the parent directory and delete the directory for the service that you wish to remove.
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).
Use the Explorer window to find the Programs folder.
Select SAS, then select IntrNet. Delete the service entry in this folder for the service that you want to remove.
SAS/IntrNet 9.1: Application Dispatcher |