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:

simple

A non-persistent state manager that stores cluster state in memory.

e.g.


    
    
sql

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:
  1. The cluster identifier
  2. $HOME/.ha-jdbc
user Authentication user name for the embedded database.
password Authentication password for the above user.
e.g.

    
       jdbc:h2:/temp/ha-jdbc/{0}
    
    
berkeleydb

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:
  1. The cluster identifier
  2. $HOME/.ha-jdbc
e.g.

    
       /tmp/{0}
    
    
sqlite

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:
  1. The cluster identifier
  2. $HOME/.ha-jdbc
e.g.

    
       /tmp/{0}
    
    

你可能感兴趣的:(HA-JDBC -)