✅ Setup and start DB2 database (Source)
✅ Setup and start Redis Enterprise database (Target)
✅ Setup and start Redis Connect
✅ Perform Initial load with Redis Connect
Docker compatible *nix OS and Docker installed.
Please have 8 vCPU*, 8GB RAM and 50GB storage for this demo to function properly. Adjust the resources based on your requirements. For HA, at least have 2 Redis Connect Connector instances deployed on separate hosts.
Execute the following commands (copy & paste) to download and setup Redis Connect and demo scripts.
i.e.
wget -c https://github.com/redis-field-engineering/redis-connect-dist/archive/main.zip && \
mkdir -p redis-connect/demo && \
unzip main.zip "redis-connect-dist-main/examples/db2/*" -d redis-connect && \
cp -R redis-connect/redis-connect-dist-main/examples/db2/demo/* redis-connect/demo && \
rm -rf main.zip redis-connect/redis-connect-dist-main && \
cd redis-connect && \
chmod a+x demo/*.sh && \
cd demo
Expected output:
demo$ ls
README.md config extlib setup_re.sh setup_db2.sh
Execute setup_db2.sh
demo$ ./setup_db2.sh latest 50000
Execute setup_re.sh
demo$ ./setup_re.sh
NOTE
The above script will create a 1-node Redis Enterprise cluster in a docker container, Create a target database with RediSearch module, Create a job management and metrics database with RedisTimeSeries module, Create a RediSearch index for emp Hash, Start a docker instance of grafana with Redis Data Source and Start an instance of RedisInsight.
Review options by running Redis Connect docker container
demo$ docker run \
-it --rm --privileged=true \
--name redis-connect-$(hostname) \
-v $(pwd)/config:/opt/redislabs/redis-connect/config \
-v $(pwd)/config/samples/credentials:/opt/redislabs/redis-connect/config/samples/credentials \
--net host \
redislabs/redis-connect
Expected output:
-------------------------------
Redis Connect startup script.
*******************************
Please ensure that these environment variables are correctly mapped before executing start and cli options. They can also be found in /opt/redislabs/redis-connect/bin/redisconnect.conf
Example environment variables and volume mapping for docker based deployments
-e REDISCONNECT_JOB_MANAGER_CONFIG_PATH=/opt/redislabs/redis-connect/config/jobmanager.properties [OPTIONAL]
-e REDISCONNECT_LOGBACK_CONFIG=/opt/redislabs/redis-connect/config/logback.xml [OPTIONAL]
-e REDISCONNECT_JAVA_OPTIONS=-Xms1g -Xmx2g [OPTIONAL]
-e REDISCONNECT_EXTLIB_DIR=/opt/redislabs/redis-connect/extlib [OPTIONAL]
-v <HOST_PATH_TO_JOB_MANAGER_PROPERTIES>:/opt/redislabs/redis-connect/config
-v <HOST_PATH_TO_CREDENTIALS>:/opt/redislabs/redis-connect/config/samples/credentials
-v <HOST_PATH_TO_EXTLIB>:/opt/redislabs/redis-connect/extlib [OPTIONAL]
-p 8282:8282
Usage: [-h|cli|start]
options:
-h: Print this help message and exit.
-v: Print version.
cli: init Redis Connect CLI
start: init Redis Connect Instance (Cluster Member)
-------------------------------
Start Redis Connect Instance
docker run \
-it --rm --privileged=true \
--name redis-connect-$(hostname) \
-v $(pwd)/config:/opt/redislabs/redis-connect/config \
-v $(pwd)/extlib:/opt/redislabs/redis-connect/extlib \
--net host \
redislabs/redis-connect start
Expected output:
-------------------------------
Starting redis-connect v0.9.0.4 instance using Java 11.0.15 on virag-cdc started by root in /opt/redislabs/redis-connect/bin
Loading redis-connect instance configurations from /opt/redislabs/redis-connect/config/jobmanager.properties
Instance classpath /opt/redislabs/redis-connect/lib/*:/opt/redislabs/redis-connect/extlib/*
06:42:22.996 [main] INFO redis-connect-manager - ----------------------------------------------------------------------------------------------------------------------------
/####### /## /## /###### /##
| ##__ ## | ## |__/ /##__ ## | ##
| ## \ ## /###### /####### /## /####### | ## \__/ /###### /####### /####### /###### /####### /######
| #######/ /##__ ## /##__ ##| ## /##_____/ | ## /##__ ##| ##__ ##| ##__ ## /##__ ## /##_____/|_ ##_/
| ##__ ##| ########| ## | ##| ##| ###### | ## | ## \ ##| ## \ ##| ## \ ##| ########| ## | ##
| ## \ ##| ##_____/| ## | ##| ## \____ ## | ## ##| ## | ##| ## | ##| ## | ##| ##_____/| ## | ## /##
| ## | ##| #######| #######| ## /#######/ | ######/| ######/| ## | ##| ## | ##| #######| ####### | ####/
|__/ |__/ \_______/ \_______/|__/|_______/ \______/ \______/ |__/ |__/|__/ |__/ \_______/ \_______/ \___/
Powered by Redis Enterprise
06:42:28.003 [main] INFO redis-connect-manager - ----------------------------------------------------------------------------------------------------------------------------
06:42:29.843 [main] INFO redis-connect-manager - Instance: 29@virag-cdc successfully established Redis connection for JobManager - JobManager
06:42:29.866 [main] INFO redis-connect-manager - Instance: 29@virag-cdc successfully established Redis connection for JobManager - JobReaper
06:42:29.890 [main] INFO redis-connect-manager - Instance: 29@virag-cdc successfully established Redis connection for JobManager - JobClaimer
06:42:29.912 [main] INFO redis-connect-manager - Instance: 29@virag-cdc successfully established Redis connection for JobManager - HeartbeatManager
06:42:29.934 [main] INFO redis-connect-manager - Instance: 29@virag-cdc successfully established Redis connection for JobManager - MetricsReporter
06:42:30.037 [main] INFO redis-connect-manager - Instance: 29@virag-cdc skipped creating Job Claim Assignment Consumer Group since it already exists
06:42:30.042 [main] INFO redis-connect-manager - Instance: 29@virag-cdc successfully started JobManager service
06:42:30.044 [main] INFO redis-connect-manager - Instance: 29@virag-cdc successfully started JobReaper service
06:42:30.045 [main] INFO redis-connect-manager - Instance: 29@virag-cdc Metrics are not enabled so MetricsReporter threadpool will not be instantiated
06:42:30.047 [main] INFO redis-connect-manager - Instance: 29@virag-cdc successfully started JobClaimer service
06:42:36.006 [main] INFO redis-connect-manager - Started Redis Connect REST API listening on ["http-nio-8282"]
06:42:36.006 [main] INFO redis-connect-manager - ----------------------------------------------------------------------------------------------------------------------------
06:42:36.006 [main] INFO redis-connect-manager -
06:42:36.006 [main] INFO redis-connect-manager - Started Redis Connect Instance
06:42:36.006 [main] INFO redis-connect-manager -
06:42:36.006 [main] INFO redis-connect-manager - ----------------------------------------------------------------------------------------------------------------------------
06:42:40.044 [JobManagerThreadpool-1] INFO redis-connect-manager - Instance: 29@virag-cdc was successfully elected Redis Connect cluster leader
Open browser to access Swagger UI - http://localhost:8282/swagger-ui/index.html
For quick start, use 'cdc_job' as jobName
Create Job Configuration - /connect/api/vi/job/config/{jobName}
For quick start, use the sample cdc-job.json
configuration: DB2
Or Use curl
to create the cdc-job
configuration
demo$ curl -v -X POST "http://localhost:8282/connect/api/v1/job/config/cdc-job" -H "accept: */*" -H "Content-Type: multipart/form-data" -F "file=@config/samples/payloads/cdc-job.json;type=application/json"
Start Job - /connect/api/vi/job/transition/start/{jobName}/{jobType}
Use 'load' as jobType
Or Use curl
to start the initial load for cdc-job
demo$ curl -X POST "http://localhost:8282/connect/api/v1/job/transition/start/cdc-job/load" -H "accept: */*"
Query for the above inserted record in Redis (target)
demo$ sudo docker exec -it re-node1 bash -c 'redis-cli -p 12000 ft.search idx:emp "@EMPNO:[1 10]"'