To run this example the Oracle Coherence Incubator must be built and installed locally. Instructions on how to achieve this are located here: Building the Oracle Coherence Incubator.
The source code for this example is located in the coherence-pushreplicationpattern-examples
module of the Oracle Coherence Incubator.
This example demonstrates Push Replication Pattern configured in a "Hub & Spoke" topology, where by one cluster, the "hub"/"active" cluster, uses an application that performs read/write operations. These operations are then replicated to two or more other "spoke"/"passive" clusters, that of which are predominantly being used in a read-only mode. Entries that may be updated by applications in the "spoke" clusters are not replicated back to the "hub" cluster.
There are six applications to run as part of this example. The following details the intent, instructions and the order in which to run these applictions.
The following instructions assume that
$COHERENCE_INCUBATOR
is the directory in which the Oracle Coherence Incubator source code has been downloaded, unpacked and built according to the prerequisites outlined above.
Execute the following shell commands to start the "Active Server".
In a new Terminal / Shell Console for the "Active Server (Site 1)"
Change to the Push Replication Pattern Examples directory.
cd $COHERENCE_INCUBATOR/coherence-pushreplicationpattern-examples/target
Run the "Active Server (Site 1)"
java -jar coherence-pushreplicationpattern-examples-11.0.0.jar hubspoke-active-server.properties
Execute the following shell commands to start the "Passive Server (Site 2)".
In a new Terminal / Shell Console for the "Passive Server (Site 2)"
Change to the Push Replication Pattern Examples directory.
cd $COHERENCE_INCUBATOR/coherence-pushreplicationpattern-examples/target
Run the "Passive Server (Site 2)"
java -jar coherence-pushreplicationpattern-examples-11.0.0.jar hubspoke-passive1-server.properties
Execute the following shell commands to start the "Passive Listener (Site 2)". This application will output cache events detailing the updates occuring in the "Passive Server (Site 2)". These updates originate from the "Active Server (Site 1)".
In a new Terminal / Shell Console for the "Passive Listener (Site 2)"
Change to the Push Replication Pattern Examples directory.
cd $COHERENCE_INCUBATOR/coherence-pushreplicationpattern-examples/target
Run the "Passive Listener (Site 2)"
java -jar coherence-pushreplicationpattern-examples-11.0.0.jar hubspoke-listener1.properties
Execute the following shell commands to start the "Passive Server (Site 3)".
In a new Terminal / Shell Console for the "Passive Server (Site 3)"
Change to the Push Replication Pattern Examples directory.
cd $COHERENCE_INCUBATOR/coherence-pushreplicationpattern-examples/target
Run the "Passive Server (Site 3)"
java -jar coherence-pushreplicationpattern-examples-11.0.0.jar hubspoke-passive2-server.properties
Execute the following shell commands to start the "Passive Listener (Site 3)". This application will output cache events detailing the updates occuring in the "Passive Server (Site 3)". These updates originate from the "Active Server (Site 1)".
In a new Terminal / Shell Console for the "Passive Listener (Site 3)"
Change to the Push Replication Pattern Examples directory.
cd $COHERENCE_INCUBATOR/coherence-pushreplicationpattern-examples/target
Run the "Passive Listener (Site 3)"
java -jar coherence-pushreplicationpattern-examples-11.0.0.jar hubspoke-listener2.properties
Execute the following shell commands to start the "Active Publisher (Site 1)". This application will insert, update and remove entries in the "Active Server (Site 1)", that of which will then "push" said updates to the "Spoke" / "Passive Servers".
In a new Terminal / Shell Console for the "Active Publisher (Site 1)"
Change to the Push Replication Pattern Examples directory.
cd $COHERENCE_INCUBATOR/coherence-pushreplicationpattern-examples/target
Run the "Active Publisher (Site 1)"
java -jar coherence-pushreplicationpattern-examples-11.0.0.jar hubspoke-publisher.properties