Highly Available Database Server


If write access is required to data stored in an SQL database by the business tier objects running on the cluster nodes, an SQL server is placed outside the cluster to arbitrate access to this data (see Figure 20-6). The SQL client program should allow you to specify the IP address of the SQL server when it first starts up. You should also be able to specify the host (along with port, user, password, and database) through any of the SQL APIs when connecting to a database. (You always connect to a database before doing anything else with the data.)

The SQL commands and data sent from the SQL client (on each cluster node) are then sent to the central SQL server where the SQL commands are executed.

image from book
Figure 20-6: A highly available database server

The SQL server (Postgres, MySQL, Oracle, and so on) accesses the data from locally attached, high-speed RAID disk drives or (not shown) a SAN.

High-Availability SQL Server

As shown in Figure 20-6, a Stonith device is used to control the power to the primary SQL server. If it malfunctions, the Heartbeat program running on the backup SQL server resets or turns off the power to the primary server and takes ownership of the database resource. The database resource is the SQL server daemon(s), the filesystem where the SQL data resides, and the IP address where the cluster nodes send their SQL commands.

Another technique to avoid a single point of failure for SQL data is usually also provided through a replication mechanism built into the SQL server. (See the documentation for your SQL package for instructions on how to replicate your SQL data to a backup server.)

Note 

SQL databases use special methods to protect the integrity of each transaction. These techniques are called ACID (Atomicity, Consistency, Isolation, Durability). See "SQL Databases for Linux" on freshmeat.net (at the following URL as of spring 2005: http://freshmeat.net/articles/view/305) for details.

image from book
CLUSTERING ZOPE

Another method of deploying a database in a cluster environment that is a relatively new technology is provided by the Zope Object Database (ZODB) and the Zope Enterprise Objects (ZEO) packages.

The Zope project (http://www.zope.org) uses Python to allow web developers to use an HTML-like language called TAL (or DTML) to write web pages that the Zope Python programs then interpret and execute to produce valid HTML code dynamically (when the web page is requested by a client computer). This dynamic HTML code (which is not the same thing as DHTML) at the business tier can access objects stored in the ZODB at the data tier, which is normally just a file on the local disk drive where the Zope server runs. With the addition of the ZEO program,[4] the dynamic HTML code interpreted by the Zope server can access ZODB objects at an IP address rather than a file. Each cluster node then becomes a ZEO client, and a highly available ZODB database server can be built outside the cluster as described in the previous SQL server example. The highly available ZODB server owns the IP address the ZEO clients use to access the ZODB objects and is therefore called a ZEO server.

Dynamic HTML pages written in TAL (or DTML) are called products by the Zope developers. The best known Zope product is perhaps the Plone project (http://www.plone.org). The Zope (business tier) products that access ZODB objects can be installed on all of the cluster nodes and share access to the same data stored on the ZEO server (or on your own server). The ZEO server arbitrates access to the data without using a locking mechanism by informing all of the ZEO clients when an object stored in the central ZODB has changed.[5] The ZEO client-server model is therefore designed for data objects that are read more than they are written or changed. (The http://www.zope.org website, by the way, runs on an LVS cluster.)[6]

Zope TAL (and DTML) programs can also connect to SQL databases using Zope database connection products. You can quickly develop applications to run on your cluster using Zope that access the highly available SQL or ZODB database server outside the cluster.

image from book

[4]ZEO ships as part of the ZODB package.

[5]See http://www.zope.org/Wikis/ZODB/MultiVersionConcurrencyControl.

[6]According to the documentation available on the zope.org website at the time of this writing.



The Linux Enterprise Cluster. Build a Highly Available Cluster with Commodity Hardware and Free Software
Linux Enterprise Cluster: Build a Highly Available Cluster with Commodity Hardware and Free Software
ISBN: 1593270364
EAN: 2147483647
Year: 2003
Pages: 219
Authors: Karl Kopper

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