The intent of the cluster daemon is to enable the remote control of the JOnAS clustered instances through a JMX interface.
In a cluster configuration, the cluster daemon is the bootstrap of the JOnAS instances.
There is at least one cluster daemon instance per machine.
The JOnAS instances controlled by a cluster daemon are configured in the clusterd.xml
file.
<?xml version="1.0"?> <cluster-daemon xmlns="http://www.objectweb.org/jonas/ns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.objectweb.org/jonas/ns http://www.objectweb.org/jonas/ns/jonas-clusterd_4_8.xsd"> <domain-name>domainSample</domain-name> <jonas-interaction-mode>loosely-coupled</jonas-interaction-mode> <server> <name>node1</name> <description>Web instance</description> <java-home>/usr/java/jdk-ia32/sun/j2sdk1.4.2_10</java-home> <jonas-root>/home/pelletib/pkg/jonas_root_sb48</jonas-root> <jonas-base>/home/pelletib/tmp/newjc48/jb1</jonas-base> <xprm></xprm> <auto-boot>false</auto-boot> </server> ... </cluster-daemon>
element | description |
---|---|
domain-name | Domain name to use for launching the JOnAS instance when it is not specified in the start command |
jonas-interaction-mode | Starting mode of the JOnAS instances: loosely-coupled corresponds to background and tighly-coupled
corresponds to foreground |
server/name | Name of the JOnAS instance |
server/description | Description of the JOnAS instance |
server/java-home | JDK home directory to use for launching the JOnAS instance |
server/jonas-root | JOnAS binaries directory to use for launching the JOnAS instance |
server/jonas-base | JOnAS configuration directory to use for launching the JOnAS instance |
server/xprms | JVM parameters to set when launching the JOnAS instance |
server/auto-boot | If true, start the JOnAS instance when launching the cluster daemon |
The cluster daemons must be specified and associated to the JOnAS instances in the domain.xml
file
for permitting the remote control of the cluster.
... <cluster-daemon> <name>cd1</name> <description>cluster daemon 1</description> <location> <url>service:jmx:rmi://host/jndi/rmi://host:port/jrmpconnector_cs</url> </location> </cluster-daemon> ... <server> <name>node1</name> <cluster-daemon>cd1</cluster-daemon> ... </server> ...
The JMX remote url of the cluster daemon adheres to the following syntax:
service:jmx:rmi://host
/jndi/rmi://host
:port
/protocol
connector_cs
with the following meanings:
host
: ip alias or ip address of the machine that hosts the cluster daemonport
: tcp listen port of the registry embedded in the cluster daemonprotocol
: protocol used for accessing the JMX interface (by default irmi, can be overridden
through the carol.properties file)The cluster daemon is started using the command jclusterd
. The possible options are:
option | description |
---|---|
start | Start the cluster daemon. |
stop | Stop the cluster daemon. |
-DdomainName | Domain name to use for starting the JOnAS instance. This value is used when it is defined both here and in the clusterd.xml file. |
-carolFile |
Path to the carol.properties file to use. If not specified, the file is loaded from $JONAS_BASE/conf. If the file is not found, the default values (localhost, 1806, irmi) are used. |
-confFile |
Path to the clusterd.xml file to load. If not specified, the file is loaded from $JONAS_BASE/conf. |
The cluster daemon provides a JMX interface that enables control of the JOnAS instances. The following operations are available:
Operation | Description |
---|---|
String getServersList() | Return the list of JOnAS instances |
int pingJOnAS(String name) | Ping a JOnAS instance identified by its name |
void startJOnAS(String name) | Start a JOnAS instance identified by its name |
String startAllJOnAS(String domainName, String prm) | Start all the JOnAS instances known in the cluster daemon configuration.
The parameter domainName (optional) enables the ability to specifiy the domain name.
The parameter prm (optional) enables the ability to set some JVM parameters.
|
void stopJOnAS(String name) | Stop a JOnAS instance identified by its name |
String stopAllJOnAS() | Stop all the JOnAS instances known in the cluster daemon configuration |
String getJavaHome4Server(String name) | Get the JAVA_HOME defined for a JOnAS server |
String getJonasRoot4Server(String name) | Get the JONAS_ROOT defined for a JOnAS server |
String getJonasBase4Server(String name) | Get the JONAS_BASE defined for a JOnAS server |
void reloadConfiguration() | Reload the configuration file of the cluster daemon |
void addServer(String name, String description, String javaHome, String jonasRoot, String jonasBase) | Add a definition of a JOnAS instance to the cluster daemon configuration. The change is saved in the configuration file. |
void removeServer(String name) | Remove a definition of a JOnAS instance in the cluster daemon configuration. The change is saved in the configuration file. |
void modifyServer(String name, String description, String javaHome, String jonasRoot, String jonasBase) | Modify the definition of a JOnAS instance in the cluster daemon configuration. The change is saved in the configuration file. |