1. 安装Redis Data Intergration
我采用的是安装在单独服务器中的形式,先决条件:
- RHEL 8 & 9或Ubuntu 18.04 & 20.04
- Redis版本6.0以上ACL(Access Control List)
- 不能在同时安装了Redis Enterprise集群的主机上安装RDI
- CPU4核、随机存取存储器2GB、磁盘25GB、网络接口10GB
- 确保RDI数据库没有群集。如果RDI数据库是集群的,则RDI将无法正常工作,但对目标数据库来说,集群是可以的。
通过Redis下载中心下载RDI安装程序,并将器解压缩到您首选的安装文件夹中。
![](https://ichiblog.cn/wp-content/uploads/2024/12/图片-42-1024x521.png)
解压后:
![](https://ichiblog.cn/wp-content/uploads/2024/12/图片-43.png)
接下来以Root身份运行安装程序(安装前建议关闭防火墙或添加规则)
Bash
sudo ufw disable
sudo ./install.sh
#这里建议使用带Log的安装方式
sudo ./install.sh -l DEBUG
![](https://ichiblog.cn/wp-content/uploads/2024/12/图片-44.png)
安装过程中需要提供 Redis数据库IP地址、Redis数据库端口、用户名(默认default)、密码、是否使用TLS等信息
安装过程中使用个人服务器的Redis可能会失败的案例:
Bash
RDI Redis database hostname or IP address: 47.115.36.96
RDI Redis database port:6379
default user:
RDI Redis database password to use:
Do you want to use TLS? [y/N]:y
Please enter the https port to expose RDI API and other K3s services [443]: 443
The Redis database is not empty. Do you want to proceed? [y/N]:y
Alternatively, you can enter the IP addresses of upstream DNS servers. Do you want to proceed? [y/N]: y
Please enter the IP addresses of upstream DNS servers, separated by comma: 8.8.8.8
![](https://ichiblog.cn/wp-content/uploads/2024/12/图片-45-1024x230.png)
安装失败后我尝试使用了成功过的由Redis官方提供的免费Stack,成功!
Bash
Please enter the RDI Redis database hostname or IP address: redis-14155.c16.us-east-1-2.ec2.redns.redis-cloud.com
Please enter the RDI Redis database port: 14155
Please enter the RDI Redis database username to use or press enter if you are using the default user:
Please enter the RDI Redis database password to use []:
Do you want to use TLS? [y/N]: n
Please enter the https port to expose RDI API and other K3s services [443]: 443
Attempting to connect to Redis from the installer. Connectivity from RDI will be verified later.
Connected successfully to RDI database.
Alternatively, you can enter the IP addresses of upstream DNS servers. Do you want to proceed? [y/N]: y
Please enter the IP addresses of upstream DNS servers, separated by comma: 8.8.8.8
Installing RDI components. This might take a few minutes.
..............................................
Press select the source database type you want to use:
1: Mysql
2: Oracle
3: Postgresql
4: Sqlserver
Select a database type by index [1]: Installation completed successfully! --这里忘记选了 选择数据库类型
In order to create an RDI pipeline, please edit the /opt/rdi/config/config.yaml configuration file.
You may also add specific transformation jobs in the jobs sub-folder.
RDI needs the source & target database username and password. To set use the following:
redis-di set-secret SOURCE_DB_USERNAME <username>
redis-di set-secret SOURCE_DB_PASSWORD <password>
redis-di set-secret TARGET_DB_USERNAME <username>
redis-di set-secret TARGET_DB_PASSWORD <password>
In addition you might want to secure the connections to the source and target database
using TLS or mTLS by adding the following:
redis-di set-secret SOURCE_DB_CACERT <path to source db CA cert>
redis-di set-secret SOURCE_DB_CERT <path to public key pem file for the client>
redis-di set-secret SOURCE_DB_KEY <path to private key pem file for the client>
redis-di set-secret SOURCE_DB_KEY_PASSWORD <private key password>
redis-di set-secret TARGET_DB_CACERT <path to target db CA cert>
redis-di set-secret TARGET_DB_CERT <path to public key pem file for the client>
redis-di set-secret TARGET_DB_KEY <path to private key pem file for the client>
redis-di set-secret TARGET_DB_KEY_PASSWORD <private key password>
When you are ready, deploy your pipeline using the command:
redis-di deploy --dir /opt/rdi/config --通过Config配置管道并部署或者使用RedisInsight
![](https://ichiblog.cn/wp-content/uploads/2024/12/图片-46-1024x656.png)