Skip to content

Commit ae740db

Browse files
committed
Gemfire updated demo docs
1 parent a827bdd commit ae740db

File tree

13 files changed

+70
-181
lines changed

13 files changed

+70
-181
lines changed

connectors/gemfire/demo/README.md

Lines changed: 69 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ Start locator
4040
gfsh>start locator --name=locator1 --bind-address=127.0.0.1
4141

4242
Start server1
43-
gfsh>start server --name=server1 --bind-address=127.0.0.1 --cache-xml-file=~/redis-connect-gemfire/config/samples/cdc/gemfire2redis/cache.xml
43+
gfsh>start server --name=server1 --bind-address=127.0.0.1 --cache-xml-file=/home/viragtripathi/redis-connect-gemfire/demo/config/samples/cdc/gemfire2redis/cache.xml
4444

4545
Start server2
46-
gfsh>start server --name=server2 --bind-address=127.0.0.1 --cache-xml-file=~/redis-connect-gemfire/config/samples/cdc/gemfire2redis/cache1.xml
46+
gfsh>start server --name=server2 --bind-address=127.0.0.1 --cache-xml-file=/home/viragtripathi/redis-connect-gemfire/demo/config/samples/cdc/gemfire2redis/cache1.xml
4747

4848
Deploy jar for the initial loader process
49-
gfsh>deploy --jar=~/redis-connect-gemfire/lib/connector-gemfire-fn-0.8.0.jar
49+
gfsh>deploy --jar=/home/viragtripathi/redis-connect-gemfire/demo/extlib/connector-gemfire-fn-0.8.0.jar
5050
```
5151

5252
## Setup Redis Enterprise cluster, databases and RedisInsight in docker (Target)
@@ -80,7 +80,7 @@ redislabs/redis-connect-gemfire:latest
8080

8181
<details><summary>Expected output:</summary>
8282
<p>
83-
83+
8484
```bash
8585
-------------------------------
8686
Redis Connect startup script.
@@ -99,97 +99,7 @@ start: start Redis Connect instance with provided cdc or initial loader job conf
9999
</p>
100100
</details>
101101

102-
-------------------------------
103-
104-
### Initial Loader Steps
105-
<details><summary><b>INSERT few records into gemfire table (source)</b></summary>
106-
<p>
107-
108-
```bash
109-
110-
```
111-
112-
</p>
113-
</details>
114-
115-
<details><summary><b>Stage pre-configured loader job</b></summary>
116-
<p>
117-
118-
```bash
119-
docker run \
120-
-it --rm --privileged=true \
121-
--name redis-connect-gemfire \
122-
-e REDISCONNECT_LOGBACK_CONFIG=/opt/redislabs/redis-connect-gemfire/config/logback.xml \
123-
-e REDISCONNECT_CONFIG=/opt/redislabs/redis-connect-gemfire/config/samples/loader \
124-
-e REDISCONNECT_SOURCE_USERNAME= \
125-
-e REDISCONNECT_SOURCE_PASSWORD= \
126-
-e REDISCONNECT_JAVA_OPTIONS="-Xms256m -Xmx256m" \
127-
-v $(pwd)/config:/opt/redislabs/redis-connect-gemfire/config \
128-
--net host \
129-
redislabs/redis-connect-gemfire:latest stage
130-
```
131-
132-
</p>
133-
</details>
134-
135-
<details><summary>Expected output:</summary>
136-
<p>
137-
138-
```bash
139-
-------------------------------
140-
Staging Redis Connect redis-connect-gemfire v1.0.2.151 job using Java 11.0.12 on 16229e5715a1 started by root in /opt/redislabs/redis-connect-gemfire/bin
141-
Loading Redis Connect redis-connect-gemfire Configurations from /opt/redislabs/redis-connect-gemfire/config/samples/loader
142-
.....
143-
.....
144-
12:31:38.726 [main] INFO startup - Setup Completed.
145-
-------------------------------
146-
```
147-
148-
</p>
149-
</details>
150-
151-
<details><summary><b>Start pre configured loader job</b></summary>
152-
<p>
153-
154-
```bash
155-
docker run \
156-
-it --rm --privileged=true \
157-
--name redis-connect-gemfire \
158-
-e REDISCONNECT_LOGBACK_CONFIG=/opt/redislabs/redis-connect-gemfire/config/logback.xml \
159-
-e REDISCONNECT_CONFIG=/opt/redislabs/redis-connect-gemfire/config/samples/loader \
160-
-e REDISCONNECT_REST_API_ENABLED=false \
161-
-e REDISCONNECT_REST_API_PORT=8282 \
162-
-e REDISCONNECT_JAVA_OPTIONS="-Xms256m -Xmx1g" \
163-
-v $(pwd)/config:/opt/redislabs/redis-connect-gemfire/config \
164-
--net host \
165-
redislabs/redis-connect-gemfire:latest start
166-
```
167-
168-
</p>
169-
</details>
170-
171-
<details><summary>Expected output:</summary>
172-
<p>
173-
174-
```bash
175-
176-
```
177-
178-
</p>
179-
</details>
180-
181-
<details><summary><b>Query for the above inserted record in Redis (target)</b></summary>
182-
<p>
183-
184-
```bash
185-
demo$ sudo docker exec -it re-node1 bash -c 'redis-cli -p 12000'
186-
187-
```
188-
189-
</p>
190-
</details>
191-
192-
-------------------------------
102+
----
193103

194104
### CDC Steps
195105
<details><summary><b>Stage pre-configured cdc job</b></summary>
@@ -200,7 +110,7 @@ docker run \
200110
-it --rm --privileged=true \
201111
--name redis-connect-gemfire \
202112
-e REDISCONNECT_LOGBACK_CONFIG=/opt/redislabs/redis-connect-gemfire/config/logback.xml \
203-
-e REDISCONNECT_CONFIG=/opt/redislabs/redis-connect-gemfire/config/samples/gemfire2redis \
113+
-e REDISCONNECT_CONFIG=/opt/redislabs/redis-connect-gemfire/config/samples/cdc/gemfire2redis \
204114
-e REDISCONNECT_JAVA_OPTIONS="-Xms256m -Xmx256m" \
205115
-v $(pwd)/config:/opt/redislabs/redis-connect-gemfire/config \
206116
--net host \
@@ -215,11 +125,24 @@ redislabs/redis-connect-gemfire:latest stage
215125

216126
```bash
217127
-------------------------------
218-
Staging Redis Connect redis-connect-gemfire v1.0.2.151 job using Java 11.0.12 on virag-cdc started by root in /opt/redislabs/redis-connect-gemfire/bin.
219-
Loading Redis Connect redis-connect-gemfire Configurations from /opt/redislabs/redis-connect-gemfire/config/samples/gemfire.
220-
.....
221-
.....
222-
20:15:06.819 [main] INFO startup - Setup Completed.
128+
Staging Redis Connect redis-connect-gemfire v0.5.0.135 job using Java 11.0.13 on virag-cdc started by root in /opt/redislabs/redis-connect-gemfire/bin
129+
Loading Redis Connect redis-connect-gemfire Configurations from /opt/redislabs/redis-connect-gemfire/config/samples/cdc/gemfire2redis
130+
....
131+
17:39:43.212 [main] INFO startup - ##################################################################
132+
17:39:43.214 [main] INFO startup -
133+
17:39:43.214 [main] INFO startup - REDIS CONNECT SETUP CLEAN - Deletes metadata related to Redis Connect from Job Management Database
134+
135+
17:39:43.214 [main] INFO startup -
136+
17:39:43.214 [main] INFO startup - ##################################################################
137+
....
138+
17:39:45.566 [main] INFO startup - ##################################################################
139+
17:39:45.569 [main] INFO startup -
140+
17:39:45.569 [main] INFO startup - REDIS CONNECT SETUP CREATE - Seed metadata related to Redis Connect to Job Management Database
141+
17:39:45.569 [main] INFO startup -
142+
17:39:45.569 [main] INFO startup - ##################################################################
143+
....
144+
17:39:47.250 [main] INFO startup - Instance: 100@virag-cdc successfully seeded Metrics related metadata
145+
17:39:47.250 [main] INFO startup - Instance: 100@virag-cdc successfully staged Job Management Database (Redis) with all the configurations and scripts, if applicable, needed to execute jobs
223146
-------------------------------
224147
```
225148
@@ -234,7 +157,7 @@ docker run \
234157
-it --rm --privileged=true \
235158
--name redis-connect-gemfire \
236159
-e REDISCONNECT_LOGBACK_CONFIG=/opt/redislabs/redis-connect-gemfire/config/logback.xml \
237-
-e REDISCONNECT_CONFIG=/opt/redislabs/redis-connect-gemfire/config/samples/gemfire2redis \
160+
-e REDISCONNECT_CONFIG=/opt/redislabs/redis-connect-gemfire/config/samples/cdc/gemfire2redis \
238161
-e REDISCONNECT_REST_API_ENABLED=true \
239162
-e REDISCONNECT_REST_API_PORT=8282 \
240163
-e REDISCONNECT_JAVA_OPTIONS="-Xms256m -Xmx1g" \
@@ -250,16 +173,52 @@ redislabs/redis-connect-gemfire:latest start
250173
<p>
251174
252175
```bash
176+
-------------------------------
177+
Starting Redis Connect redis-connect-gemfire v0.5.0.135 instance using Java 11.0.13 on virag-cdc started by root in /opt/redislabs/redis-connect-gemfire/bin
178+
Loading Redis Connect redis-connect-gemfire Configurations from /opt/redislabs/redis-connect-gemfire/config/samples/gemfire2redis
179+
17:40:09,940 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [/opt/redislabs/redis-connect-gemfire/config/logback.xml] at [file:/opt/redislabs/redis-connect-gemfire/config/logback.xml]
180+
....
181+
17:40:10.222 [main] INFO startup -
182+
17:40:10.225 [main] INFO startup - /$$$$$$$ /$$ /$$ /$$$$$$ /$$
183+
17:40:10.225 [main] INFO startup - | $$__ $$ | $$|__/ /$$__ $$ | $$
184+
17:40:10.226 [main] INFO startup - | $$ \ $$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$$ | $$ \__/ /$$$$$$ /$$$$$$$ /$$$$$$$ /$$$$$$ /$$$$$$$ /$$$$$$
185+
17:40:10.226 [main] INFO startup - | $$$$$$$/ /$$__ $$ /$$__ $$| $$ /$$_____/ | $$ /$$__ $$| $$__ $$| $$__ $$ /$$__ $$ /$$_____/|_ $$_/
186+
17:40:10.226 [main] INFO startup - | $$__ $$| $$$$$$$$| $$ | $$| $$| $$$$$$ | $$ | $$ \ $$| $$ \ $$| $$ \ $$| $$$$$$$$| $$ | $$
187+
17:40:10.226 [main] INFO startup - | $$ \ $$| $$_____/| $$ | $$| $$ \____ $$ | $$ $$| $$ | $$| $$ | $$| $$ | $$| $$_____/| $$ | $$ /$$
188+
17:40:10.227 [main] INFO startup - | $$ | $$| $$$$$$$| $$$$$$$| $$ /$$$$$$$/ | $$$$$$/| $$$$$$/| $$ | $$| $$ | $$| $$$$$$$| $$$$$$$ | $$$$/
189+
17:40:10.227 [main] INFO startup - |__/ |__/ \_______/ \_______/|__/|_______/ \______/ \______/ |__/ |__/|__/ |__/ \_______/ \_______/ \___/
190+
17:40:10.227 [main] INFO startup -
191+
17:40:10.227 [main] INFO startup - ##################################################################
192+
17:40:10.227 [main] INFO startup -
193+
17:40:10.227 [main] INFO startup - Initializing Redis Connect Instance
194+
17:40:10.227 [main] INFO startup -
195+
17:40:10.227 [main] INFO startup - ##################################################################
196+
....
197+
17:40:26.854 [JobManager-1] INFO startup - Instance: 30@virag-cdc successfully established Redis connection for HeartbeatManager service
198+
17:40:26.855 [JobManager-1] INFO startup - Instance: 30@virag-cdc was successfully elected Redis Connect cluster leader
199+
17:40:36.901 [JobManager-1] INFO startup - Getting instance of EventHandler for : REDIS_KV_TO_STRING_WRITER
200+
17:40:36.919 [JobManager-1] WARN startup - metricsKey not set - Metrics collection will be disabled
201+
17:40:36.929 [JobManager-1] INFO startup - Instance: 30@virag-cdc successfully established Redis connection for RedisConnectorEventHandler service
202+
17:40:36.933 [JobManager-1] INFO startup - Getting instance of EventHandler for : REDIS_STRING_CHECKPOINT_WRITER
203+
17:40:36.933 [JobManager-1] WARN startup - metricsKey not set - Metrics collection will be disabled
204+
17:40:36.943 [JobManager-1] INFO startup - Instance: 30@virag-cdc successfully established Redis connection for RedisCheckpointReader service
205+
17:40:38.237 [JobManager-1] INFO startup - Client with clientId : {connect}:job:job1 connecting for the first time
206+
17:40:38.240 [JobManager-1] INFO startup - Instance: 30@virag-cdc successfully started job execution for JobId: {connect}:job:job1
207+
17:40:38.241 [JobManager-1] INFO startup - Instance: 30@virag-cdc has successfully claimed ownership of JobId: {connect}:job:job1
208+
17:40:38.241 [JobManager-1] INFO startup - Instance: 30@virag-cdc has claimed 1 job(s) from its 2 max allowable capacity
209+
17:40:38.254 [JobManager-1] INFO startup - JobId: {connect}:job:job1 claim request with ID: 1641490787024-0 has been fully processed and all metadata has been updated
210+
17:40:38.258 [JobManager-1] INFO startup - Instance: 30@virag-cdc published Job Claim Transition Event to Channel: REDIS.CONNECT.JOB.CLAIM.TRANSITION.EVENTS Message: {"jobId":"{connect}:job:job1","instanceName":"30@virag-cdc","transitionEvent":"CLAIMED","serviceName":"JobClaimer"}
211+
17:40:38.258 [lettuce-nioEventLoop-4-3] INFO startup - Instance: 30@virag-cdc consumed Job Claim Transition Event on Channel: REDIS.CONNECT.JOB.CLAIM.TRANSITION.EVENTS Message: {"jobId":"{connect}:job:job1","instanceName":"30@virag-cdc","transitionEvent":"CLAIMED","serviceName":"JobClaimer"}
253212
```
254213
255214
</p>
256215
</details>
257216
258-
<details><summary><b>INSERT a record into gemfire table (source)</b></summary>
217+
<details><summary><b>INSERT a record into gemfire region (source)</b></summary>
259218
<p>
260219
261220
```bash
262-
221+
gfsh> put --key='redis123' --value='Hello Redis!!' --region=/session
263222
```
264223
265224
</p>
@@ -269,69 +228,31 @@ redislabs/redis-connect-gemfire:latest start
269228
<p>
270229
271230
```bash
272-
demo$ sudo docker exec -it re-node1 bash -c 'redis-cli -p 12000'
273-
231+
demo$ sudo docker exec -it re-node1 bash -c 'redis-cli -p 12000 get redis123'
232+
"Hello Redis!!"
274233
```
275234
276235
</p>
277236
</details>
278237
279238
Similarly `UPDATE` and `DELETE` records on Gemfire source and see Redis target getting updated in near real-time.
280239
281-
-------------------------------
282-
283-
### [_Custom Stage_](https://github.com/redis-field-engineering/redis-connect-custom-stage-demo)
284-
285-
Review the Custom Stage Demo then use the pre-built CustomStage function by passing it as an external library then follow the same [Initial Loader Steps](#initial-loader-steps) and [CDC Steps](#cdc-steps).
286-
287-
Add the `CustomStage` `handlerId` in JobConfig.yml as explained in the Custom Stage Demo i.e.
288-
```yml
289-
stages:
290-
CustomStage:
291-
handlerId: TO_UPPER_CASE
292-
```
293-
<details><summary><b>Stage pre-configured loader job with Custom Stage</b></summary>
240+
<details><summary><b>UPDATE a record into gemfire region (source)</b></summary>
294241
<p>
295242
296243
```bash
297-
docker run \
298-
-it --rm --privileged=true \
299-
--name redis-connect-gemfire \
300-
-e REDISCONNECT_LOGBACK_CONFIG=/opt/redislabs/redis-connect-gemfire/config/logback.xml \
301-
-e REDISCONNECT_CONFIG=/opt/redislabs/redis-connect-gemfire/config/samples/loader \
302-
-e REDISCONNECT_SOURCE_USERNAME=redisconnect \
303-
-e REDISCONNECT_SOURCE_PASSWORD=Redis@123 \
304-
-e REDISCONNECT_JAVA_OPTIONS="-Xms256m -Xmx256m" \
305-
-v $(pwd)/config:/opt/redislabs/redis-connect-gemfire/config \
306-
-v $(pwd)/extlib:/opt/redislabs/redis-connect-gemfire/extlib \
307-
--net host \
308-
redislabs/redis-connect-gemfire:latest stage
244+
gfsh> put --key='redis123' --value='Hello World!!' --region=/session
309245
```
310246
311247
</p>
312248
</details>
313249
314-
<details><summary><b>Start pre-configured loader job with Custom Stage</b></summary>
250+
<details><summary><b>DELETE a record from gemfire region (source)</b></summary>
315251
<p>
316252
317253
```bash
318-
docker run \
319-
-it --rm --privileged=true \
320-
--name redis-connect-gemfire \
321-
-e REDISCONNECT_LOGBACK_CONFIG=/opt/redislabs/redis-connect-gemfire/config/logback.xml \
322-
-e REDISCONNECT_CONFIG=/opt/redislabs/redis-connect-gemfire/config/samples/loader \
323-
-e REDISCONNECT_REST_API_ENABLED=false \
324-
-e REDISCONNECT_REST_API_PORT=8282 \
325-
-e REDISCONNECT_SOURCE_USERNAME= \
326-
-e REDISCONNECT_SOURCE_PASSWORD= \
327-
-e REDISCONNECT_JAVA_OPTIONS="-Xms256m -Xmx1g" \
328-
-v $(pwd)/config:/opt/redislabs/redis-connect-gemfire/config \
329-
-v $(pwd)/extlib:/opt/redislabs/redis-connect-gemfire/extlib \
330-
--net host \
331-
redislabs/redis-connect-gemfire:latest start
254+
gfsh> remove --region=/session --key='redis123'
332255
```
333256
334257
</p>
335258
</details>
336-
337-
Validate the output after CustomStage run and make sure that `fname` and `lname` values in Redis has been updated to UPPER CASE.
Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,3 @@
11
connectionId: jobConfigConnection
2-
jobTypeId: jobType1
3-
jobStream: loaderJobStream
4-
jobConfigSet: loaderJobConfigs
5-
completedJobsSet: loaderCompletedJobs
6-
initialDelay: 10000
7-
numManagementThreads: 2
82
metricsReporter:
93
- REDIS_TS_METRICS_REPORTER
10-
heartBeatConfig:
11-
key: hb-jobManager
12-
expiry: 30000
13-
jobHeartBeatKeyPrefix: "hb-job:"
14-
jobHeartbeatCheckInterval: 45000
15-
jobClaimerConfig:
16-
initialDelay: 10000
17-
claimInterval: 60000
18-
heartBeatConfig:
19-
key: "hb-job:"
20-
expiry: 30000
21-
maxNumberOfJobs: 2
22-
consumerGroup: loaderJobGroup
23-
batchSize: 1
Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,8 @@
11
connectionId: jobConfigConnection
22
job:
3-
stream: loaderJobStream
4-
configSet: loaderJobConfigs
5-
completedJobsSet: loadercompletedJobs
6-
consumerGroup: loaderJobGroup
73
jobConfig:
8-
- name: batchtaskcreator
4+
- name: initial_load
95
config: TaskCreator.yml
106
variables:
117
connectionProvider: GemfireConnectionProvider
128
connectionId: gemfireConnection
13-
14-
15-
16-
17-
18-
19-
20-
Binary file not shown.

0 commit comments

Comments
 (0)