|
In short, a service primitive is a action which SRRD request to be executed on behalf of a service.
Such service primitive actions include starting and stopping of the service, notifying of nodes with the same service joining or leaving as well as status requests and service check calls.
Every service primitive action returns a status telling SRRD the success or failure of that action.
In the following we will describe each of the service primitives in detail.
- ACTIVATE
A newly configured service will get activated when going into service. This primitive get called whenever a service is activated. Activating a service means that the service is ready to be started afterwards. A active servie participates in a service cluster and it's primary configuration (eg. Interface aliases number and addresses, service type, check intervall and many more) can't be changed as long as active.
|
- DEACTIVATE
This service primitive gets called when a service needs to get offline which means to be deactivated. Please note that only services which are activated can get deactivated. A deactivated service does not participate in a service cluster and it's primary configuration (eg. Interface aliases number and addresses, service type, check intervall and many more).
|
- START
This service primititive normally starts the service. SRRD guarantees to start one, and only one instance of the service on of all the available active services with the same name on different service nodes. Starting a service means stopping it on other active cluster nodes if it's running there!
|
- STOP
This service primitive normally stops the service. SRRD guarantees to keep the service running on one of the participating cluster nodes as long as he finds a node with a active service of the same name. It will start the service fast as possible on one of the remaining participating cluster nodes.
|
- JOIN
A started service gets it's join service primitive called, when a further node able to run the service gets activated and joins the service cluster. This allows services to integrate a joining server into the service cluster. Complicated master/slave service constructs can be built in this way. An example of this is the implemented Network RAID-1 Mirror. It does a raidhotadd on a node join and it does a raidhotremove when a cluster node leaves the service cluster.
|
- LEAVE
When a activated but stopped cluster node leaves the service cluster the started service's leave service primitive gets called. This allows services to expell a cluster node from the service cluster when he goes down or out of service.
|
- RESTART
SRRD restarts a started service by calling the associated restart primitive. The current object oriented service primitive framework has a default implementation which calls the service primitives start and stop.
|
- RELOAD
This signals the service primitive scripts to reload the configuration of a started service. Dependend on the service type it simple executes the restart primitive or sends a signal to the running service process to inform it to reload the current service configuration.
|
- CGI
This is a CGI (Common Gateway Interface) hook for service primitives. Service scripts can display arbitrary HTML data in SRRD. The current object oriented Service Primitive Framework allows for the display of service script variables and their configuration with forms and input fields.
|
- STATUS
SRRD calls this service primitive to access the current service status. It returns a service status summary in plain text which can be viewed inside SRRD. A service can return arbitrary status information in this way.
|
- CHECK
SRRD calls this service primitive when a service has to be checked. SRRD can check services in the started as well as in the stopped state. A service check can return multiple status answers. It can answer that the service is absolutly fine and working. It can also answer that the service is not so well and that it's currently failing. A failing service will be stopped and then failed by SRRD. Should the service already have failed when the check primitive gets called, it will detect this and notify SRRD. SRRD will then automatically fail that service without prior to try to stop it.
|
- FAILED
SRRD calls this service primitive when a service has failed. This can happen when activating, starting and stopping a service as well as when a service get checked in started or stopped state. Depending on the service type a service can try to automatically fix itself, and if it succeeds, it can signal to SRRD that the service can be reset to a stopped and active state.
|
- UPDATE
This service primitive gets called synchronously on all cluster nodes with the service in an active state. It allows for synchronous configuration updates on all joined nodes. The current object oriented service primitive framework allows service configurations to reside in a central Subversion repository. The service primitives will pull new service configurations automatically from the central repository and reinitialize themselfes with it.
|
|
Please note that some services already start processes in activate and stop them in deactivate. These services have a active slave state and a started master state. An example of such a service is a Network RAID-1 Mirror, where a active service is a client participating in the RAID-1 mirror, while the started service participates as the server using the resulting Network RAID-1 mirror.
If you have written new Service Primitive Scripts which you would like to contribute to the SRRD project, or if you fixed/extended one, please submit them to the SRRD developement mailing list <srrd-dev@srrd.org>.
Go to top
|
|
This page last changed on 29-Sep-2004 23:27:00 MEST by unknown.
|
|