
In VersionOne[1] the definition, placement and relationship between resources was intertwined. It was also centered around independent groups with fixed start/stop orders.
To illustrate the differences, an example VersionOne[1] configuration is listed below. Here each line defines a group. The first group prefers to run on paul and contains an IP address and an Apache WebServer[2], where the IP address is always started before Apache. The second prefers to run on silas and is an IP address and a DNS NameServer[3], where the IP address is started before named and named before dhcpd.
paul 1.2.3.4 apache::/apache1dir/httpd.cf silas 1.2.3.5 named dhcpd
There are primarily 3 problems with this:
there is no way to specify that you'd like named to start before apache without requiring them to always run on the same node.
By breaking up the definition, placement and inter-resource dependancies administrators can more accurately model their environment. Thus the above configuration would be:
define resource: 1.2.3.4
define resource: 1.2.3.5
define resource: apache::/apache1dir/httpd.cf
define resource: named
define resource: dhcpd
named can run anywhere but prefers silas
apache::/apache1dir/httpd.cf} can run anywhere but prefers paul
{1.2.3.4} can run anywhere
{1.2.3.5} can run anywhere
{dhcpd} can run anywhere
Run 1.2.3.4 with apache::/apache1dir/httpd.cf
Run 1.2.3.5 with named
Run dhcpd with named
Start 1.2.3.4 before apache::/apache1dir/httpd.cf
Start 1.2.3.5 before named
Start dhcpd after named
Thus separated, we can start modifying things. For instance we can recognize that dhcpd doesn't need named to be running and therefore rule 4c is not required.
We could also add a third node called bob that cant run named. In such a case, we would amend 2a to read: named can run anywhere except bob and prefers silas.
A secondary named service may be required which can't run on the same node as the primary. For this we would add:
1.f. define resource: named::secondary,
1.g. define resource: 1.2.3.6,
2.f. named::secondary can run anywhere
2.g. named::secondary can run anywhere
3.d. Run 1.2.3.6 with named::secondary
3.d. DONT Run named with named::secondary
4.d. Start named::secondary after 1.2.3.6
We may also have a program collecting web stats that can run on anywhere in the cluster (independent of where apache is). We would add:
1.h. define resource: webstats,
2.h. webstats can run anywhere
4.e. Start webstats after apache::/apache1dir/httpd.cf
As you can see, more flexibility comes at the cost of greater configuration complexity.
To alleviate some of this complexity, VersionTwo[4] supports a number of types of resources. Until now we have been dealing with the simplest type called primitives but the complete list is:
master : a specialization of a clone resource involving state. Some clones are designated masters and the rest slaves.
Re-expressing the configuration using groups yields a configuration with the best of both worlds.
define group: group1
define resource: 1.2.3.4
define resource: apache::/apache1dir/httpd.cf
define group: group2
define resource: 1.2.3.5
define resource: named
define resource: dhcpd
group1 can run anywhere but prefers silas
group2 can run anywhere but prefers paul
dhcpd can run anywhere
Run dhcpd with group2
Start dhcpd after 1.2.3.4
| [1] | http://www.linux-ha.org/VersionOne |
| [2] | http://www.linux-ha.org/WebServer |
| [3] | http://www.linux-ha.org/NameServer |
| [4] | http://www.linux-ha.org/VersionTwo |
This information provided courtesy of the Linux-HA project at http://linux-ha.org/