The ability to run multiple @task eservers against the same database is not supported by default. Unless each server is aware of other servers in the cluster and coordinates its activities with these other instances of @task, deploying multiple servers could result in data corruption and unpredictable behavior. Additional setup is required to make this work.
An @task cluster consists of 2 or more instances of @task running on different hosts that access the same database.
When installed properly, an @task cluster can dramatically increase scalability by distributing the workload across multiple servers to improve performance and availability by allowing seamless fail-over when a host goes down.
Basic Overview of Cluster Functionality
The first server to start becomes the master node. The master node is responsible for controlling the cluster. All cluster synchronization and communication is routed through the master node. If it goes down (or the connection is lost) a new node is elected as the master node. When the original master node is restarted it rejoins the cluster as a new node, but not as the master node. After a node is elected as master node, it remains the master node until it is shutdown.
Fail-over, in the case when a server goes down, happens automatically. @task API requests are automatically rerouted. There is no need to modify client code. HTTP requests will have to be retried manually by web server software or a network load balancer depending on the customer installation.
If the server that goes down is the master node, there may be a delay as JBoss elects a new master node and recreates the messaging hooks to support cluster communication. However, requests to the cluster are queued during this period, and requests will be serviced normally once the master node configuration is complete.
When setting up a clustered environment, all machines in the cluster must:
@task software is bundled with 6 separate cluster support folders. The naming convention for the folders is as follows: <operating system>-<database type>-cluster-support. It is important to match up the correct folder for the database.
Supported operating systems include:
N O T E : Theoperating system refers to the operating system of the servers running JBoss and @task.
N O T E : The database can run on a different operating system from that of the servers running JBoss and @task. It is not important which operating system the database is running on.
JBoss and @task Clustering Setup
Client Configuration Changes Using The @task API With Clustering
This instruction assumes you are already familiar with how to connect to the @task API in a single-instance mode.
The JNDI parameter "java.naming.provider.url" must be changed in order to connect to an @task cluster.
This value should be changed to a comma-delimited list containing the values <host address>:1100.
For example, suppose you have an @task cluster with 3 servers with hostnames host1, host2, and host3. The java.naming.provider.url property should have a value of:
java.naming.provider.url=host1:1100,host2:1100,host3:1100
This property will enable the API client to try each of these hosts, in order for an initial connection to the EJBHome interface. Once a connection is made, the API client will handle its own load balancing and fail-over. No additional code is needed on the client side to take advantage of these features.
Currently, there are no tools that allow for SOAP clients to automatically discover multiple hosts in an @task cluster or that handle automatic fail-over.
Connecting to an @task server in a cluster is exactly the same as connecting to a single server. Any rollover or load balancing policies must be implemented by the client.
Clustering is not working and I'm seeing the following error in my logs:
ERROR [HypersonicDatabase] Starting failed
jboss:database=localDB,service=Hypersonic
java.sql.SQLException: General error: java.lang.NullPointerException
at org.hsqldb.jdbc.jdbcUtil.sqlException(Unknown Source)
at org.hsqldb.jdbc.jdbcConnection.<init>(Unknown Source)
at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
at org.hsqldb.jdbcDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
This means that the Hypersonic database (the internal datastore that handles JMS messages) has become corrupt. To fix this problem, shutdown all @task servers in the cluster and delete the contents of the JBOSS_HOME/server/default/data/hypersonic directory. These files will be recreated once JBoss is restarted.
This will cause any outstanding messages to be deleted. If this problem persists, contact customer support.