The primary and secondary location String values are in the form jdbc:hsqldb:hsql://<ip address>/<alias>.
The server comes up and I can see logged a cluster lock and a cluster state.
When an entry is attempted to be written into either database, there is nothing written to the opposite db. Am I missing any configuration steps that should make this work?
Also note the section where the drivers are being added to the ConfigurationFactories. I am using JDK1.6 in eclipse Juno and it would not allow me to use the for(Driver d : DriverManager.getDrivers()) as was shown in the example in the wiki. Additionally, it would not allow me to specify it as "New SimpleDatabaseClusterConfigurationFactory<Driver,DriverDatabase>(config) because it gave error that the constructor was not found. I am only using the jarfiles locally.
Please help as this is important to getting our DB to have high availability.
Dennis
Last edit: Fashimpaur 2013-07-15
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Each server running the application has a copy of the HSQLDB. The configuration file for both machines currently have the location of DB1 pointing to the first server and DB2 pointing to the second server.
Last edit: Fashimpaur 2013-07-15
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What do you mean by: "When an entry is attempted to be written into either database, there is nothing written to the opposite db." How are you writing an entry into the database? Can you attach the relevant JDBC client code that you are using to obtain connections?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
gClusterId is set to the same value on both machines.
gJdbcPrimaryConnect is "jdbc:hsqldb:hsql://<main_server_ip_address>/xdb" on both servers.
gJdbcSecondaryConnect is "jdbc:hsqldb:hsql://<second_server_ip_address>/xdb" on both servers.
What I mean is, I start the main db server on one machine followed by the secondary on a friend's machine on the same network. Then I start my webapp on the primary machine followed by the secondary on the friend's machine.
When the primary webapp receives a post to put information in the db, it gets written in the primary db but the secondary db does not reflect the same information. It does not seem to be sync'd with the primary such that they do not really seem clustered and communicating.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can you verify the cluster state on each machine? To do this, look for the appropriate mbeans in JConsole while the app is running on each machine. By setting a command dispatcher factory to JGroupsCommandDispatcherFactory, you've indicated that your servers should keep their cluster state in sync (so that each server has a consistent view of which databases are active). If everything is working correctly, JConsole should report the activeDatabases as [db1, db2] on each server.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am having issue connecting an HSQLDB cluster and am looking for your assistance.
I have implemented the following DB configuration in my Java Code.
The primary and secondary location String values are in the form jdbc:hsqldb:hsql://<ip address>/<alias>.
The server comes up and I can see logged a cluster lock and a cluster state.
When an entry is attempted to be written into either database, there is nothing written to the opposite db. Am I missing any configuration steps that should make this work?
Also note the section where the drivers are being added to the ConfigurationFactories. I am using JDK1.6 in eclipse Juno and it would not allow me to use the for(Driver d : DriverManager.getDrivers()) as was shown in the example in the wiki. Additionally, it would not allow me to specify it as "New SimpleDatabaseClusterConfigurationFactory<Driver,DriverDatabase>(config) because it gave error that the constructor was not found. I am only using the jarfiles locally.
Please help as this is important to getting our DB to have high availability.
Dennis
Last edit: Fashimpaur 2013-07-15
Each server running the application has a copy of the HSQLDB. The configuration file for both machines currently have the location of DB1 pointing to the first server and DB2 pointing to the second server.
Last edit: Fashimpaur 2013-07-15
What do you mean by: "When an entry is attempted to be written into either database, there is nothing written to the opposite db." How are you writing an entry into the database? Can you attach the relevant JDBC client code that you are using to obtain connections?
Getting the connection, I do the following:
gClusterId is set to the same value on both machines.
gJdbcPrimaryConnect is "jdbc:hsqldb:hsql://<main_server_ip_address>/xdb" on both servers.
gJdbcSecondaryConnect is "jdbc:hsqldb:hsql://<second_server_ip_address>/xdb" on both servers.
What I mean is, I start the main db server on one machine followed by the secondary on a friend's machine on the same network. Then I start my webapp on the primary machine followed by the secondary on the friend's machine.
When the primary webapp receives a post to put information in the db, it gets written in the primary db but the secondary db does not reflect the same information. It does not seem to be sync'd with the primary such that they do not really seem clustered and communicating.
Can you verify the cluster state on each machine? To do this, look for the appropriate mbeans in JConsole while the app is running on each machine. By setting a command dispatcher factory to JGroupsCommandDispatcherFactory, you've indicated that your servers should keep their cluster state in sync (so that each server has a consistent view of which databases are active). If everything is working correctly, JConsole should report the activeDatabases as [db1, db2] on each server.
Where do I find JConsole? For testing purposes, I am starting each db from a cmd prompt and the webapp is launched using Eclipse Juno.
It doesn't have to be jconsole - any JMX console will work. jconsole is available from the jdk of either openjdk or oracle's jdk.