This repo is intended to provide directions and artifacts required to setup & demonstrate GridGain Ultimates's Data Center Replication feature.
At the end of this tutorial you will have:
- Created and configured 4 LOCAL GridGain nodes:
- DC1 Data Node
- DC1 Sender Node
- DC2 Data Node
- DC2 Sender Node
- Used GridGain Control Center (or GridGain Nebula) to create data in DC1
- Used GridGain Control Center be able to see the data replicated to DC2
- GridGain Ultimate Edition v8.9.15 (any version of 8.9 should work, but this was tested with 8.9.15)
- a GridGain Ultimate License key is required
- GridGain Control Center
- a Control Center license is required if running Control Center locally
- GridGain Nebula may also be used
- a free trial con be obtained at GridGain Nebula
- Request a license keys for
- Ultimate Edition
- Control Control Center (if not using Nebula)
- GridGain employees can submit the license requests here GridGain IT Support Portal
- Select "License Requests" -> "License Request"
- External Users can use Contact Us and submit a request to the sales team
- Download GridGain Ultimate Edition
- Unzip the downloaded file and move to your desired location
- I typically keep these on my Desktop
- Download and Install Control Center
- In the terminal where you will be executing the DC1 Sender Node, please set an environment variable name MY_IP_ADDRESS to the value of your machines IP Address. The following command works on Mac OS v14.7.1 (Sonoma)
export MY_IP_ADDRESS=`ipconfig getifaddr en0`
NOTE: Note that the above command use back ticks (backquote, grave, or grave accent)
BEFORE PROCEEDING: Make sure that GridGain is configured properly and that the $GRIDGAIN_HOME environment variable is properly set.
If you are on a Mac, you can use these scripts to launch the instances
- Open a terminal prompt and cd to the config/dc1 directory in this project
- Start the Data Node for DC1
% $GRIDGAIN_HOME/bin/ignite.sh data-node.xml
- Copy the Control Center Token when it is displayed
- Add the Cluster to Control Center and rename it to DC1 se that it's easier to find
- Open a terminal prompt and cd to the config/dc2 directory in this project
- Start the Data Node for DC2
% $GRIDGAIN_HOME/bin/ignite.sh data-node.xml
-
Copy the Control Center Token when it is displayed
-
Add the Cluster to Control Center and rename it to DC2 se that it's easier to find
-
Start the receiver node for DC2
% $GRIDGAIN_HOME/bin/ignite.sh receiver-node.xml
- Open a terminal prompt and cd to the config/dc1 directory in this project
- Start the receiver node for DC2
% $GRIDGAIN_HOME/bin/ignite.sh sender-node.xml
Now that your environment is setup & running, it's time to test it out.
- Open Control Center and switch to DC1
- On the Queries tab, you will be able to see the PERSON_CACHE and the PERSON table schema
- Execute the following query
SELECT * FROM "PERSON"
You should see no rows returned because we don't have any data yet
4. Create some data in DC1. As each of these are inserted into DC1, they will also be replicated in DC2.
Feel free to switch to the DC2 cluster and execute the SELECT statement above to see the records are being
replicated properly.
I chose to use the names of cartoon characters but feel free to use any names you like as long as
the PERSONID is unique.
insert into PERSON_CACHE.PERSON (PERSONID,FIRSTNAME,LASTNAME) VALUES ('1','Fred','Flintstone');
insert into PERSON_CACHE.PERSON (PERSONID,FIRSTNAME,LASTNAME) VALUES ('2','Wilma','Flintstone');
insert into PERSON_CACHE.PERSON (PERSONID,FIRSTNAME,LASTNAME) VALUES ('3','Barney','Rubble');
insert into PERSON_CACHE.PERSON (PERSONID,FIRSTNAME,LASTNAME) VALUES ('4','Betty','Rubble');