Wednesday, June 26, 2013

nginx - clustering reverse proxy

A Cluster is a group of closely linked computers that appear as single entity.
Types of Clusters:
- HA
- LB
- HPC
- grids

HA is also called failover cluster. It improves service availability rather than performance, by using redundant nodes.
Models of HA cluster config:
+ active-passive
+ active-active
+ N+1
+ N+M
+ N to 1
+ N to N

LB clusters distribute the workload evenly among redundant nodes.

HPC clusters are used for highly CPU-intensive compute jobs.Nodes are tightly couped.

Grid is a special class of compute clusters with heterogeneous nodes that are not tightly coupled.

Heartbeat is a piece of software from "The HA Linux" project.

The architecture: active -passive HA cluster.
Active-Passive: Primary node is active and serves the requests. When it fails, the services are transferred to secondary node.
Active-Active: Both nodes remain active and server their requests. When one fails, the services are transferred to the other.

A service that is served by the HA cluster depends on the IP address. Each interface on the cluster should have an administrative address and can have service addresses. OS controls the administrative address. whereas Heartbeat software controls service address and assigns it to the cluster nodes. Active node has the service address. When failover happens, passive node takes over the service address.

Install and Configure Heartbeat.
#apt-get install heartbeat

ha.cf file
The main config file for Heartbeat is ha.cf, which list the nodes of the cluster, communication topology, and al the features that are enabled.

haresources file
We need to tell Heartbeat about the resources the cluster will be managing.

authkeys file
The authkeys file authenticates the cluster nodes and maintains the cluster security.
File owner root and permissions 600, otherwise heartbeat will not start.
Heartbeat supports three authentication methods: crc, md5, sha1.


No comments:

Post a Comment