Skip to content

Commit 06fa195

Browse files
committed
Updated mssql README
1 parent b054880 commit 06fa195

File tree

1 file changed

+40
-70
lines changed

1 file changed

+40
-70
lines changed

connectors/mssql/README.md

Lines changed: 40 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# redis-connect-sqlserver
22

3-
redis-connect-sqlserver is a Redis Connect connector for capturing changes (INSERT, UPDATE and DELETE) from MS SQL Server (source) and writing them to a Redis Enterprise database (Target).
3+
redis-connect-sqlserver is a Redis Connect connector for capturing changes (INSERT, UPDATE and DELETE) from MS SQL Server (source) and writing them to a Redis Enterprise database (Target). redis-connect-sqlserver implementation is based on [Debezium](https://debezium.io/documentation/reference/stable/connectors/sqlserver.html), which is an open source distributed platform for change data capture.
44

55
<p>
66
The first time redis-connect-sqlserver connects to a SQL Server database/cluster, it reads a consistent snapshot of all of the schemas.
@@ -101,7 +101,7 @@ Copy the _sample_ directory and it's contents i.e. _yml_ files, _mappers_ and te
101101
### Sample logback.xml under redis-connect-sqlserver/config folder
102102

103103
```xml
104-
<configuration debug="true" scan="true" scanPeriod="30 seconds">
104+
<configuration debug="true" scan="true" scanPeriod="15 seconds">
105105

106106
<property name="START_UP_PATH" value="logs/redis-connect-startup.log"/>
107107
<property name="LOG_PATH" value="logs/redis-connect.log"/>
@@ -160,35 +160,36 @@ Copy the _sample_ directory and it's contents i.e. _yml_ files, _mappers_ and te
160160
<appender-ref ref="CONSOLE" />
161161
</logger>
162162
<logger name="io.netty" level="OFF" additivity="false">
163+
<appender-ref ref="REDISCONNECT"/>
163164
<appender-ref ref="CONSOLE" />
164165
</logger>
165166
<logger name="io.lettuce" level="OFF" additivity="false">
167+
<appender-ref ref="REDISCONNECT"/>
166168
<appender-ref ref="CONSOLE" />
167169
</logger>
168170
<logger name="com.zaxxer" level="OFF" additivity="false">
169171
<appender-ref ref="REDISCONNECT"/>
170-
<appender-ref ref="STARTUP"/>
172+
<appender-ref ref="CONSOLE"/>
171173
</logger>
172-
<logger name="io.debezium" level="OFF" additivity="false">
174+
<logger name="io.debezium" level="INFO" additivity="false">
173175
<appender-ref ref="REDISCONNECT"/>
174-
<appender-ref ref="STARTUP"/>
176+
<appender-ref ref="CONSOLE"/>
175177
</logger>
176178
<logger name="org.apache.kafka" level="OFF" additivity="false">
177179
<appender-ref ref="REDISCONNECT"/>
178-
<appender-ref ref="STARTUP"/>
180+
<appender-ref ref="CONSOLE"/>
179181
</logger>
180182
<logger name="org.springframework" level="OFF" additivity="false">
181183
<appender-ref ref="REDISCONNECT"/>
182-
<appender-ref ref="STARTUP"/>
183-
</logger>
184+
<appender-ref ref="CONSOLE"/>
185+
</logger>
184186

185187
<root>
186188
<appender-ref ref="STARTUP"/>
187189
<appender-ref ref="REDISCONNECT"/>
188190
</root>
189191

190192
</configuration>
191-
192193
```
193194

194195
</p>
@@ -205,30 +206,24 @@ Redis URI syntax is described [here](https://github.com/lettuce-io/lettuce-core/
205206

206207
```yml
207208
connections:
208-
jobConfigConnection:
209-
redisUrl: redis://127.0.0.1:14001 #Job configuration Redis database
210-
srcConnection:
211-
redisUrl: redis://127.0.0.1:14000 #Target Redis database
212-
metricsConnection:
213-
redisUrl: redis://127.0.0.1:14001 #Metrics Redis database, can be same as Job Configuration database.
214-
msSQLServerConnection:
215-
database:
216-
name: testdb #database name same as database value in Setup.yml
217-
db: RedisConnect #database
218-
hostname: 127.0.0.1
219-
port: 1433
220-
username: sa #This can be a non privileged user. Please see an example in the demo, https://github.com/RedisLabs-Field-Engineering/redis-connect-dist/blob/main/connectors/mssql/demo/mssql_cdc.sql#L36
221-
password: Redis@123
222-
type: mssqlserver #this value cannot be changed for mssqlserver
223-
jdbcUrl: "jdbc:sqlserver://127.0.0.1:1433;database=RedisConnect"
224-
maximumPoolSize: 10
225-
minimumIdle: 2
226-
include.query: "true"
227-
snapshot.mode: initial
228-
snapshot.isolation.mode: read_uncommitted
229-
schemas.enable: "false"
230-
include.schema.changes: "false"
231-
decimal.handling.mode: double
209+
- id: jobConfigConnection
210+
type: Redis
211+
url: redis://${REDISCONNECT_TARGET_USERNAME}:${REDISCONNECT_TARGET_PASSWORD}@127.0.0.1:14001
212+
- id: targetConnection
213+
type: Redis
214+
url: redis://${REDISCONNECT_TARGET_USERNAME}:${REDISCONNECT_TARGET_PASSWORD}@127.0.0.1:14000
215+
- id: metricsConnection
216+
type: Redis
217+
url: redis://${REDISCONNECT_TARGET_USERNAME}:${REDISCONNECT_TARGET_PASSWORD}@127.0.0.1:14001
218+
- id: RDBConnection
219+
type: RDB
220+
name: RedisConnect #database pool name
221+
database: RedisConnect #database
222+
url: "jdbc:sqlserver://127.0.0.1:1433;database=RedisConnect"
223+
host: 127.0.0.1
224+
port: 1433
225+
username: ${REDISCONNECT_SOURCE_USERNAME}
226+
password: ${REDISCONNECT_SOURCE_PASSWORD}
232227
```
233228
234229
</p>
@@ -244,9 +239,6 @@ connections:
244239
```yml
245240
connectionId: jobConfigConnection
246241
job:
247-
stream: jobStream
248-
configSet: jobConfigs
249-
consumerGroup: jobGroup
250242
metrics:
251243
connectionId: metricsConnection
252244
retentionInHours: 12
@@ -275,10 +267,10 @@ job:
275267
schema: dbo
276268
table: emp
277269
jobConfig:
278-
- name: testdb-emp
270+
- name: RedisConnect-emp
279271
config: JobConfig.yml
280272
variables:
281-
database: testdb
273+
database: RedisConnect
282274
sourceValueTranslator: SOURCE_RECORD_TO_OP_TRANSLATOR
283275
```
284276
@@ -293,28 +285,9 @@ job:
293285
### Sample JobManager.yml under redis-connect-sqlserver/config/samples/sqlserver folder
294286
295287
```yml
296-
connectionId: jobConfigConnection # This refers to connectionId from env.yml for Job Config Redis
297-
jobTypeId: jobType1 #Variable
298-
jobStream: jobStream
299-
jobConfigSet: jobConfigs
300-
initialDelay: 10000
301-
numManagementThreads: 2
288+
connectionId: jobConfigConnection
302289
metricsReporter:
303290
- REDIS_TS_METRICS_REPORTER
304-
heartBeatConfig:
305-
key: hb-jobManager
306-
expiry: 30000
307-
jobHeartBeatKeyPrefix: "hb-job:"
308-
jobHeartbeatCheckInterval: 45000
309-
jobClaimerConfig:
310-
initialDelay: 10000
311-
claimInterval: 30000
312-
heartBeatConfig:
313-
key: "hb-job:"
314-
expiry: 30000
315-
maxNumberOfJobs: 2 #This indicates the maximum number of Jobs a single RedisConnect instance can execute
316-
consumerGroup: jobGroup
317-
batchSize: 1
318291
```
319292
320293
</p>
@@ -330,34 +303,31 @@ jobClaimerConfig:
330303
You can have one or more JobConfig.yml (or with any name e.g. JobConfig-<table_name>.yml) and specify them in the Setup.yml under jobConfig: tag. If specifying more than one table (as below) then make sure maxNumberOfJobs: tag under JobManager.yml is set accordingly e.g. if maxNumberOfJobs: tag is set to 2 then Redis Connect will start 2 cdc jobs under the same JVM instance. If the workload is more and you want to spread out (scale) the cdc jobs then create multiple JobConfig's and specify them in the Setup.yml under jobConfig: tag.
331304
332305
```yml
333-
jobId: ${jobId} #Unique Job Identifier. This value is the job name from Setup.yml
306+
jobId: ${jobId}
334307
producerConfig:
335308
producerId: RDB_EVENT_PRODUCER
336-
connectionId: testdb-msSQLServerConnection #Name of the Redis connection id specified in env.yml
309+
connectionId: RDBConnection
337310
tables:
338-
- dbo.emp #Name of the table with SCHEMA.TABLE format
339-
# - dbo.dept #Name of the table with SCHEMA.TABLE format
340-
pollingInterval: 5
341-
metricsKey: testdb-emp
311+
- dbo.emp #schema.table
312+
metricsKey: RedisConnect-emp
342313
metricsEnabled: false
343314
pipelineConfig:
344-
bufferSize: 1024
345315
eventTranslator: "${sourceValueTranslator}"
346316
checkpointConfig:
347-
providerId: RDB_CHECKPOINT_READER
348-
connectionId: srcConnection
317+
providerId: RDB_SQL_CHECKPOINT_READER
318+
connectionId: targetConnection
349319
checkpoint: "${jobId}-${database}"
350320
stages:
351321
HashWriteStage:
352322
handlerId: REDIS_HASH_WRITER
353-
connectionId: srcConnection
323+
connectionId: targetConnection
354324
metricsEnabled: false
355325
prependTableNameToKeys: true
356326
deleteOnKeyUpdate: true
357327
async: true
358328
CheckpointStage:
359-
handlerId: REDIS_OP_CP_WRITER
360-
connectionId: srcConnection
329+
handlerId: REDIS_HASH_CHECKPOINT_WRITER
330+
connectionId: targetConnection
361331
metricEnabled: false
362332
async: true
363333
checkpoint: "${jobId}-${database}"

0 commit comments

Comments
 (0)