How does the application agent work in VERITAS Cluster Server (VCS) 1.3 ?

Article:TECH9177  |  Created: 2000-01-08  |  Updated: 2004-01-21  |  Article URL http://www.symantec.com/docs/TECH9177
Article Type
Technical Solution


Environment

Issue



How does the application agent work in VERITAS Cluster Server (VCS) 1.3 ?

Solution



In order to examine how the application agent works, the basic definition of "application" needs to be understood. What is an application?

An application consists of one or more processes. An application has an executable to start it and an executable to stop it.

What does the application agent do? The following are the key tasks done by application agent:

            Starting of application.
            Stopping of the application.
            Monitoring if the application is running or not.

How does the application agent work?

To start the application, the agent runs the executable given by the "StartProgram" attribute of the resource.

To stop the application, the agent runs the executable given by the "StopProgram" attribute of the resource.

To monitor whether application is running or not, the agent does the following:

        1. If any pid files are specified in the "PidFiles" attribute, it reads pid from each pid file specified and checks whether the corresponding process is running or not.
        2. If any process names are specified in the "MonitorProcesses" attribute, it checks whether each process is running or not.
        3. If any executable is specified in the "MonitorProgram" attribute, monitor routine runs the "MonitorProgram" and waits for its return status. The return status values are expected to be the values returned by VCS agent monitor entry point.

ONLINE or OFFLINE reported from the monitor is a combination (AND operation) of all the above steps. If any one of the returns fail, then OFFLINE is reported; otherwise, ONLINE is reported.

Application Type:

Application type should be defined in the file types.cf as:

type application (static str ArgList[] = { User, StartProgram , StopProgram , CleanProgram , MonitorProgram , PidFiles , MonitorProcesses }
     str User
     str StartProgram
     str StopProgram
     str CleanProgram
     str MonitorProgram
     str PidFiles[]
     str MonitorProcesses[]
     )

Attributes of the type are:

User : User whose id is used to run the "StartProgram","StopProgram","MonitorProgram" and "CleanProgram".

StartProgram : Filename of the executable that will start the application. Complete path is to be specified. If any arguments are to be specified, then they can be given here, separated by spaces.

StopProgram: Filename of the executable that will stop the application. Complete path is to be specified. If any arguments are to be specified for stop program, then they can be given here, separated by spaces.

CleanProgram: Filename of the executable that will forcefully stop the application. Complete path is to be specified. If any arguments are to be specified for clean program, then they can be given here, separated by  paces.

MonitorProgram: Filename of the executable that will monitor the application. Complete path is to be specified. If any arguments are to be specified for monitor program, then they can be given here, separated by spaces.

PidFiles: Specifies the list of pid files. Each pid file in the list has its complete path. Each pid file contains one pid which will be monitored.

MonitorProcesses : Specifies a list of process names to be monitored. Each process name is the name of executable that has been run. The executable name should be qualified with its complete path if its path is used to start the executable.

Example of application resource

    1. Application myapp_app(
         User = "root"
         StartProgram = "/usr/sbin/myapp start"
         StopProgram = "/usr/sbin/myapp stop"
         PidFiles = { "/var/lock/myapp/myapp.pid" }
         MonitorProcesses = {  "myapp" }
     )

In this example,  "myapp" is used as both the start and the stop script. However, their parameters are different. Only one pid file "/var/lock/myapp/myapp.pid" is specified and one process specified is "myapp". Here, no "MonitorProgram" is specified, so only specified processes are monitored.

    2. Application myapp_app2(
     StartProgram="/usr/sbin/myapp start"
     StopProgram="/usr/sbin/myapp stop"
     CleanProgram="usr/sbin/myapp force stop"
     MonitorProgram="/usr/local/bin/myappMonitor all"
     MonitorProcesses={ "myapp1" , "myapp2" }
     )

In this example, no user is specified, so root will be used. Also, MonitorProgram and MonitorProcesses attributes are specified and PidFiles is not specified. In this case, processes specified in MonitorProcesses are monitored and MonitorProgram is run.


Legacy ID



233278


Article URL http://www.symantec.com/docs/TECH9177


Terms of use for this information are found in Legal Notices