DTS 如何连通 IDC 机房的自建数据库实例

问题描述

客户线下 IDC 机房(不能暴露公网地址)的数据需要通过 DTS 传输数据到火山引擎的 RDS,如何实现?

问题分析

需要是用 VPN 将线下 IDC 与云上的 RDS 所在的 VPC 网络打通,然后配置 DTS 的接入方式为 "火山引擎 ECS 自建 MySQL" 即可进行数据传输。

解决方案

1.创建和配置VPN服务,具体参考官网链接 2.在 VP C内创建一台 ECS,源码安装 Nginx 确保安装了stream 模块(4层转发)

  • 下载安装 Nginx

#下载Nginx源码包
wget https://nginx.org/download/nginx-1.20.1.tar.gz

#解压源码包
tar -zxvf nginx-1.20.1.tar.gz 

#进入解压后的目录并编译安装软件
cd nginx-1.20.1
./configure --with-stream 
make && make install
  • 检查运行Nginx是否有启动stream模块
[root@JMS conf.d]# nginx -V 2>&1| grep stream
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module
  • 修改配置文件,
stream{
    upstream mysql{
        server 172.18.1.23:3306;
    }
    server{
        listen 3306;
        proxy_pass mysql;
    }
}

-- 172.18.1.23  是实际的 IDC 的 MySQL 服务的访问地址。
  • 热加载配置文件,确认配置文件编写无误程序没有报错。
[root@JMS conf.d]# nginx -s reload

3.选择接入方式为 "火山引擎 ECS 自建 MySQL",填写对应的VPC中的 Nginx 服务的地址。 alt

如果您有其他问题,欢迎您联系火山引擎技术支持服务

72
0
0
0
相关产品
评论
未登录
看完啦,登录分享一下感受吧~
暂无评论