How does the application agent work in VERITAS Cluster Server (VCS) 1.3 ?
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 should be defined in the file
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.
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.
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.
Imported Document Id
This is machine translated content
Login to Subscribe
Please login to set up your subscription.
Didn't find the article you were looking for? Try these resources.