HA-JDBC -
Cluster state management
The state manager component is responsible for storing the active status of each database in the cluster, as well as any durability state. During startup, HA-JDBC fetches its initial cluster state is fetched either from another server, if HA-JDBC is configured to be distributable, or if the configured state manager is persistent. If no state is found, all accessible databases are presumed to be active. To ignore (i.e. clear) the locally persisted cluster state at startup, start HA-JDBC using the ha-jdbc.state.clear=truesystem property.
HA-JDBC includes the following state manager implementations:
simpleA non-persistent state manager that stores cluster state in memory.
e.g.
<ha-jdbc xmlns="urn:ha-jdbc:cluster:3.0"> <state id="simple"/> <cluster><!-- ... --></cluster> </ha-jdbc>
A persistent state manager that uses an embedded database. This provider supports the following properties, in addition to properties to manipulate connection pooling behavior. The complete list of pooling properties and their default values are available in the Apache Commons Pool documentationdocumentation.
Property | Default | Description |
---|---|---|
urlPattern | jdbc:h2:{1}/{0} jdbc:hsqldb:{1}/{0} jdbc:derby:{1}/{0};create=true | A MessageFormat pattern indicating the JDBC url of the embedded database. The pattern can accept 2 parameters:
|
user | Authentication user name for the embedded database. | |
password | Authentication password for the above user. |
<ha-jdbc xmlns="urn:ha-jdbc:cluster:3.0"> <state id="sql"> <property name="urlPattern">jdbc:h2:/temp/ha-jdbc/{0}</property> </state> <cluster><!-- ... --></cluster> </ha-jdbc>
A persistent state manager that uses a BerkeleyDB database. This provider supports the following properties, in addition to properties to manipulate connection pooling behavior. The complete list of pooling properties and their default values are available in the Apache Commons Pool documentationdocumentation..
Property | Default | Description |
---|---|---|
locationPattern | {1}/{0} | A MessageFormat pattern indicating the base location of the embedded database. The pattern can accept 2 parameters:
|
<ha-jdbc xmlns="urn:ha-jdbc:cluster:3.0"> <state id="berkeleydb"> <property name="locationPattern">/tmp/{0}</property> </state> <cluster><!-- ... --></cluster> </ha-jdbc>
A persistent state manager that uses a SQLite database. This provider supports the following properties, in addition to properties to manipulate connection pooling behavior. The complete list of pooling properties and their default values are available in the Apache Commons Pool documentationdocumentation.
Property | Default | Description |
---|---|---|
locationPattern | {1}/{0} | A MessageFormat pattern indicating the base location of the embedded database. The pattern can accept 2 parameters:
|
<ha-jdbc xmlns="urn:ha-jdbc:cluster:3.0"> <state id="sqlite"> <property name="locationPattern">/tmp/{0}</property> </state> <cluster><!-- ... --></cluster> </ha-jdbc>