Skip to content

Commit 1560fb9

Browse files
committed
updated mysql demo docs
1 parent addcb72 commit 1560fb9

File tree

2 files changed

+78
-15
lines changed

2 files changed

+78
-15
lines changed

connectors/mysql/README.md

Lines changed: 72 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ Before using the MySQL connector (redis-connect-mysql) to capture the changes co
6161
* 1G Network
6262
* JRE 8+ (JRE 11 is preferred)
6363

64-
**NOTE**
65-
64+
| :memo: |
65+
|---------------|
6666
The current [release](https://github.com/RedisLabs-Field-Engineering/redis-connect-dist/releases) has been built with JDK 11 and tested with JRE 11 and above. Please have JRE 11+ installed prior to running this connector.
6767

6868
---
@@ -83,13 +83,76 @@ Copy the _sample_ directory and it's contents i.e. _yml_ files, _mappers_ and te
8383

8484
#### Configuration files
8585

86-
<details><summary>Configure logback.xml</summary>
86+
<details><summary>Configure redisconnect.conf/cmd</summary>
87+
<p>
88+
89+
| :memo: |
90+
|---------------|
91+
For [*nixOS](https://en.wikipedia.org/wiki/Unix-like)
92+
93+
### Configuration file for the startup script located under redis-connect-mysql/bin/redisconnect.conf
94+
95+
```bash
96+
set -o allexport
97+
98+
REDISCONNECT_MIN_JAVA_VERSION="8"
99+
REDISCONNECT_HOME="${pwd}.."
100+
REDISCONNECT_CONFIG="$REDISCONNECT_HOME/config/samples" #prepend the correct path to loader or cdc config folder e.g. "$REDISCONNECT_HOME/config/samples/mysql" or "$REDISCONNECT_HOME/config/samples/loader" or path of your choice
101+
REDISCONNECT_LOGBACK_CONFIG="$REDISCONNECT_HOME/config/logback.xml" #Location of the pre-packaged logback config
102+
REDISCONNECT_BANNER_MODE="off"
103+
REDISCONNECT_JAVA_OPTIONS="-XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx1g" #edit or pass any JVM options here. Default is ok in most cases.
104+
REDISCONNECT_EXTLIB_DIR="$REDISCONNECT_HOME/extlib" #All external libraries e.g. custom transformation jars, client jar etc can go here.
105+
REDISCONNECT_LIB_DIR="$REDISCONNECT_HOME/lib/*:$REDISCONNECT_EXTLIB_DIR/*"
106+
REDISCONNECT_REST_API_ENABLED="false" #This is to enable embedded REST_API support
107+
REDISCONNECT_REST_API_PORT="8282" #update REST_API port to an available port if 8282 is taken.
108+
REDISCONNECT_SOURCE_USERNAME="" #Source username can be set here or directly in the env.yml or it can also come from environment variable / system properties
109+
REDISCONNECT_SOURCE_PASSWORD="" #Source password can be set here or directly in the env.yml or it can also come from environment variable / system properties
110+
REDISCONNECT_TARGET_USERNAME="" #Target username can be set here or directly in the env.yml or it can also come from environment variable / system properties
111+
REDISCONNECT_TARGET_PASSWORD="" #Target password can be set here or directly in the env.yml or it can also come from environment variable / system properties
112+
REDISCONNECT_SECRET="secret" #This is used for encrypting any passwords using the CLI and can be left blank after the encryption
113+
114+
set +o allexport
115+
```
116+
117+
| :memo: |
118+
|---------------|
119+
For [WindowsOS](https://en.wikipedia.org/wiki/Microsoft_Windows)
120+
121+
### Configuration file for the startup script located under redis-connect-mysql/bin/redisconnect.cmd
122+
123+
```bat
124+
set REDISCONNECT_HOME=%cd%\..
125+
set REDISCONNECT_CONFIG=%REDISCONNECT_HOME%\config\samples
126+
set REDISCONNECT_LOGBACK_CONFIG=%REDISCONNECT_HOME%\config\logback.xml
127+
set REDISCONNECT_BANNER_MODE="off"
128+
set REDISCONNECT_JAVA_OPTIONS=-XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx1g
129+
set REDISCONNECT_EXTLIB_DIR=%REDISCONNECT_HOME%\extlib
130+
set REDISCONNECT_LIB_DIR=%REDISCONNECT_HOME%\lib\*;%REDISCONNECT_EXTLIB_DIR%\*
131+
set CLASSPATH=.
132+
set CLASSPATH="%CLASSPATH%;%REDISCONNECT_LIB_DIR%"
133+
set REDISCONNECT_REST_API_ENABLED=false
134+
set REDISCONNECT_REST_API_PORT=8282
135+
set REDISCONNECT_SOURCE_USERNAME=""
136+
set REDISCONNECT_SOURCE_PASSWORD=""
137+
set REDISCONNECT_TARGET_USERNAME=""
138+
set REDISCONNECT_TARGET_PASSWORD=""
139+
set REDISCONNECT_SECRET="secret"
140+
```
141+
142+
</p>
143+
</details>
144+
145+
<details><summary>Configure logback.xml [OPTIONAL]</summary>
87146
<p>
88147

89148
#### logging configuration file.
90149

91150
### Sample logback.xml under redis-connect-mysql/config folder
92151

152+
| :memo: |
153+
|---------------|
154+
No need to edit this file unless you want to change the log levels (for debugging purposes) or the log location.
155+
93156
```xml
94157
<configuration debug="true" scan="true" scanPeriod="15 seconds">
95158

@@ -211,20 +274,20 @@ Redis URI syntax is described [here](https://github.com/lettuce-io/lettuce-core/
211274
connections:
212275
- id: jobConfigConnection
213276
type: Redis
214-
url: redis://${REDISCONNECT_TARGET_USERNAME}:${REDISCONNECT_TARGET_PASSWORD}@127.0.0.1:14001
277+
url: redis://${REDISCONNECT_TARGET_USERNAME}:${REDISCONNECT_TARGET_PASSWORD}@127.0.0.1:14001 #if no value is passed to the username and/or password then "" is assumed. You can also parameterize the whole url e.g. ${REDISCONNECT_JOBCONFIG_REDIS_URL} and set the value in the redisconnect.conf file or through environment variable / system property
215278
- id: targetConnection
216279
type: Redis
217-
url: redis://${REDISCONNECT_TARGET_USERNAME}:${REDISCONNECT_TARGET_PASSWORD}@127.0.0.1:14000
280+
url: redis://${REDISCONNECT_TARGET_USERNAME}:${REDISCONNECT_TARGET_PASSWORD}@127.0.0.1:14000 #if no value is passed to the username and/or password then "" is assumed. You can also parameterize the whole url e.g. ${REDISCONNECT_TARGET_REDIS_URL} and set the value in the redisconnect.conf file or through environment variable / system property
218281
- id: metricsConnection
219282
type: Redis
220-
url: redis://${REDISCONNECT_TARGET_USERNAME}:${REDISCONNECT_TARGET_PASSWORD}@127.0.0.1:14001
283+
url: redis://${REDISCONNECT_TARGET_USERNAME}:${REDISCONNECT_TARGET_PASSWORD}@127.0.0.1:14001 #if no value is passed to the username and/or password then "" is assumed. You can also parameterize the whole url e.g. ${REDISCONNECT_METRICS_REDIS_URL} and set the value in the redisconnect.conf file or through environment variable / system property
221284
- id: RDBConnection
222285
type: RDB
223286
name: RedisConnect #database pool name
224287
database: RedisConnect #database
225-
url: "jdbc:mysql://127.0.0.1:3306/RedisConnect?useInformationSchema=true"
226-
host: 127.0.0.1
227-
port: 3306
288+
url: "jdbc:mysql://127.0.0.1:3306/RedisConnect?useInformationSchema=true" #You can also parameterize the whole url e.g. ${REDISCONNECT_SOURCE_URL} and set the value in the redisconnect.conf file or through environment variable / system property
289+
host: 127.0.0.1 #You can also parameterize the host e.g. ${REDISCONNECT_SOURCE_HOST} and set the value in the redisconnect.conf file or through environment variable / system property
290+
port: 3306 #You can also parameterize the port e.g. ${REDISCONNECT_SOURCE_PORT} and set the value in the redisconnect.conf file or through environment variable / system property
228291
username: ${REDISCONNECT_SOURCE_USERNAME}
229292
password: ${REDISCONNECT_SOURCE_PASSWORD}
230293
```

connectors/mysql/demo/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ demo$ docker exec -it re-node1 bash -c "redis-cli -p 12000 FT._LIST"
8787
</p>
8888
</details>
8989

90-
---
91-
**NOTE**
90+
| :memo: |
91+
|---------------|
9292

9393
The above script will create a 1-node Redis Enterprise cluster in a docker container, [Create a target database with RediSearch module](https://docs.redislabs.com/latest/modules/add-module-to-database/), [Create a job management and metrics database with RedisTimeSeries module](https://docs.redislabs.com/latest/modules/add-module-to-database/), [Create a RediSearch index for emp Hash](https://redislabs.com/blog/getting-started-with-redisearch-2-0/) and [Start an instance of RedisInsight](https://docs.redislabs.com/latest/ri/installing/install-docker/).
9494

@@ -487,8 +487,8 @@ docker run \
487487
--name redis-connect-mysql \
488488
-e REDISCONNECT_LOGBACK_CONFIG=/opt/redislabs/redis-connect-mysql/config/logback.xml \
489489
-e REDISCONNECT_CONFIG=/opt/redislabs/redis-connect-mysql/config/samples/loader \
490-
-e REDISCONNECT_SOURCE_USERNAME=root \
491-
-e REDISCONNECT_SOURCE_PASSWORD=Redis@123 \
490+
-e REDISCONNECT_SOURCE_USERNAME=redisconnectuser \
491+
-e REDISCONNECT_SOURCE_PASSWORD=redisconnectpassword \
492492
-e REDISCONNECT_JAVA_OPTIONS="-Xms256m -Xmx256m" \
493493
-v $(pwd)/config:/opt/redislabs/redis-connect-mysql/config \
494494
-v $(pwd)/extlib:/opt/redislabs/redis-connect-mysql/extlib \
@@ -510,8 +510,8 @@ docker run \
510510
-e REDISCONNECT_CONFIG=/opt/redislabs/redis-connect-mysql/config/samples/loader \
511511
-e REDISCONNECT_REST_API_ENABLED=false \
512512
-e REDISCONNECT_REST_API_PORT=8282 \
513-
-e REDISCONNECT_SOURCE_USERNAME=sa \
514-
-e REDISCONNECT_SOURCE_PASSWORD=Redis@123 \
513+
-e REDISCONNECT_SOURCE_USERNAME=redisconnectuser \
514+
-e REDISCONNECT_SOURCE_PASSWORD=redisconnectpassword \
515515
-e REDISCONNECT_JAVA_OPTIONS="-Xms256m -Xmx1g" \
516516
-v $(pwd)/config:/opt/redislabs/redis-connect-mysql/config \
517517
-v $(pwd)/extlib:/opt/redislabs/redis-connect-mysql/extlib \

0 commit comments

Comments
 (0)