[Linux-cluster] Resource agents for Apache & MySQL

Marek 'marx' Grac mgrac at redhat.com
Tue Aug 22 15:47:13 UTC 2006


Hi,

I have written a resource agents (RA) for apache & mysql (in attachement).

Apache:

When starting Apache you have to give RA path to ServerRoot (default 
value /etc/httpd) and configuration file (default conf/httpd.conf). If 
the path to the conf file doesn't start with / then it is relative to 
the ServerRoot. Last value which is passed to the RA is the name of the 
service. Apache's configuration file can contain <IfDefine %name%> 
sections, so you can have multiple web services defined in the one 
configuration file. RA parse this main configuration file and generates 
new one for each resource (-D%name%). If in the config file are options 
like Listen/Port then they are removed and we will add Listen for every 
combination of Port & IP address of the service (Apache is then binded 
to multiple IP addresses). If you change this generated file (there is 
sha1-checksum) then it won't be regenerated again.

example of simple /etc/cluster/cluster.conf
....
<service autostart="1" domain="" name="test22">
    <ip address="192.168.79.8" monitor_link="0"/>
    <ip address="192.168.79.9" monitor_link="0"/>
    <apache name="web"/>
</service>
...

MySQL:

RA for MySQL needs path to configuration file (default value 
/etc/my.cnf) and IP address (default value is the first IP address in 
the service). Unfortunately MySQL can be binded to one IP address or to 
the all of the local IP address (not supported in RA because then you 
can't run multiple MySQL resources). You should not run more MySQL 
demons on same data (directory).

Metadata information are stored in separate files (*.metadata) where you 
can see all of the options in XML format which is quite readable.

If you would like to test these RA then you have to extract archive and 
copy to the /usr/share/cluster. You can't use system-config-cluster yet, 
so you have to modify /etc/cluster/cluster.conf manually (add resources, 
raise version number); run ccs_tool update /etc/cluster/cluster.conf;  
run cman_tool version -r <raised_version>. Feedback welcomed :)

Thanks,
Marek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cluster-resource-agents-0.5.tgz
Type: application/x-compressed-tar
Size: 5574 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/linux-cluster/attachments/20060822/c3985ff6/attachment.bin>


More information about the Linux-cluster mailing list