23.2 Multi-Instance Applications


23.2 Multi-Instance Applications

A multi-instance application is an application that is designed to run multiple copies at the same time.

What makes an application a multi-instance application?

  • If an application does not write to a common data file without synchronization, it could be a multi-instance application. For example, a web server[1].

  • If an application uses POSIX file locking for synchronization, it could be a multi-instance application.

  • If an application is multi-threaded and synchronizes access with mutexes and conditionals, it could be considered a multi-instance application.

  • If an application uses IPC, it could be a multi-instance application.

  • If an application uses named pipes, it could be a multi-instance application.

If an application is a multi-instance application, then we must determine if what makes it multi-instance also restricts it to a single system. To assist in this, we have put together a decision tree (Table 23-1). If your application is restricted to a single system, then in order to make the application highly available it must be monitored by CAA.

Table 23-1: Multi-Instance Decision Tree

Multi-Instance Application Deployment

If your application...

CAA

Cluster-Wide

Does Not Require synchronization

Is multithreaded

x

Message Queues

x

semaphores

x

Shared Memory

x

Uses Named pipes(fifo)

x

Uses pipes(pipe)

x

Uses posix File Locking

Uses the DLM

[*]

[*]- an instance of a cluster-aware application can be monitored by CAA so that the application can be automatically restarted.

Notice that there are a few instances where applications can be deployed cluster wide. If an application does not require synchronization or if the application uses file locking, then it can be deployed simultaneously on any number of cluster members. If an application uses the Distributed Lock Manager (DLM) API (or equivalent), then the application is said to be a cluster-aware application. Cluster-aware (also known as distributed) applications are designed to run throughout the cluster.

An example of a cluster-aware application that uses the DLM is the Advanced Server for UNIX (ASU). ASU can be installed as a distributed (or cluster-aware) application, or a single-instance application that uses CAA for failover. An example of a cluster-aware application that does not use the DLM is Oracle Corporation's Oracle Parallel Server (OPS). The OPS application uses a proprietary locking mechanism that enables multiple instances to run in parallel on any number of cluster members.

Note

CAA has the capability to check the status of an application at a predefined interval and restart it if it is not running. Many cluster architects have come to appreciate this "auto-restart" functionality and are using CAA to monitor instances of cluster-aware applications as well.

We will discuss this in more detail in section 23.6.4 and provide an example in section 24.7.

An example of a cluster-unaware application, that can run multi-instance across multiple cluster members, is a web server (such as the Compaq Secure Web Server). Web Servers do not write to

files except for log files, so by making the log files member-specific using a CDSL, web servers can be deployed cluster wide. It is important to keep in mind, however, that not all web servers are used only to serve pages. Many web servers act as application servers, so it is important to consider the synchronization capability, if any, of the applications (or CGI scripts) before choosing to make your web server multi-instance. If the CGI script writes to a common file without synchronizing access to the file then there is the potential for data corruption to occur if there were multiple-instances deployed throughout the cluster.

Applications that use the POSIX or X/Open API for file locking can be run multi-instance across the cluster. The file locking calls that can be used are fcntl (2), flock (2), and lockf (3); although fcntl is the only call technically listed in the POSIX standard.

All multi-instance applications that are limited to running on one system at a time should use CAA for high availability (unless of course they have some other mechanism to provide for high availability).

[1]Although a web server can be used to run CGI scripts (or programs) that perform write operations to files, the web server itself primarily serves pages and does not write data.




TruCluster Server Handbook
TruCluster Server Handbook (HP Technologies)
ISBN: 1555582591
EAN: 2147483647
Year: 2005
Pages: 273

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net