前提条件
步骤1:创建 ETL 作业
登录 流计算 Oceanus 控制台,进入某一工作空间后,单击左侧导航作业管理,进入作业管理页面,单击新建 > 新建作业,作业类型选中 ETL 作业,输入作业名称,并选择一个运行中的集群,新建的 ETL 作业将运行于此集群,单击确定后即成功创建作业。
![](https://qcloudimg.tencent-cloud.cn/image/document/c7c5cc94dd391e0d5328367572ac29a7.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/c7c5cc94dd391e0d5328367572ac29a7.png)
注意
步骤2:流计算服务委托授权
步骤3:配置数据源表
授权完成后,单击作业进入作业开发 > 草稿,从左侧列表拖入 MySQL 数据源。
![](https://qcloudimg.tencent-cloud.cn/image/document/d1ad7126e0caac2b6c69ddb59d2aa3d4.png)
单击 MySQL 数据源可以进行数据源的配置。
![](https://qcloudimg.tencent-cloud.cn/image/document/27975f627aae416354b6dace746d8829.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/d1ad7126e0caac2b6c69ddb59d2aa3d4.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/27975f627aae416354b6dace746d8829.png)
如果当前没有可用的数据库实例,可以单击管理连接信息,并单击新建连接信息增加新的数据源。
![](https://qcloudimg.tencent-cloud.cn/image/document/bdfe9cd3cddd3cca9b809f29798281bf.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/bdfe9cd3cddd3cca9b809f29798281bf.png)
腾讯云实例可以使用当前账号下的腾讯云产品实例,但注意账号需要拥有对应产品的查询列表权限。
IP连接则直接用填入的 IP 进行连接,需要确保 IP 与 Oceanus 集群处于同一个 VPC 或是有进行过相关的网络打通操作。
选择好数据源之后,可以通过下拉框选择需要进行同步的数据库与表。
![](https://qcloudimg.tencent-cloud.cn/image/document/c63cf375bba4784ba58432173655a49e.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/c63cf375bba4784ba58432173655a49e.png)
单击下一步,配置需要进行同步的字段,并单击确认完成配置。
![](https://qcloudimg.tencent-cloud.cn/image/document/8d653e786e4129335aecc67ee1198b17.png)
再次返回画布,可以看到数据源已经配置完成。
![](https://qcloudimg.tencent-cloud.cn/image/document/b39c3c9ed027dac6cc5f4628c55ecf6d.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/8d653e786e4129335aecc67ee1198b17.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/b39c3c9ed027dac6cc5f4628c55ecf6d.png)
步骤4:配置数据目的
从左侧拖入数据目的,并与数据源相连。
![](https://qcloudimg.tencent-cloud.cn/image/document/5046bde3ab10a1178beaa88a4bf13a46.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/5046bde3ab10a1178beaa88a4bf13a46.png)
单击数据目的对象,配置好数据库实例与库表选择:
![](https://qcloudimg.tencent-cloud.cn/image/document/69ee308eca4fe71b68161028bfde40f7.png)
单击下一步进行字段映射配置:
![](https://qcloudimg.tencent-cloud.cn/image/document/1dd39bb735b8f18865c83e4c32582113.png)
完成后,单击确认完成数据目的的配置:
![](https://qcloudimg.tencent-cloud.cn/image/document/e2aaae52cb34ab629739030ca3d3d61a.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/69ee308eca4fe71b68161028bfde40f7.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/1dd39bb735b8f18865c83e4c32582113.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/e2aaae52cb34ab629739030ca3d3d61a.png)
步骤5:设置作业参数
![](https://qcloudimg.tencent-cloud.cn/image/document/b0520c2d6edf55b80c828dbfbbbeee6f.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/b0520c2d6edf55b80c828dbfbbbeee6f.png)
步骤6:发布运行 ETL 作业
单击运行,会进行作业预检查,并启动作业。
![](https://qcloudimg.tencent-cloud.cn/image/document/9083aebe9d5d5ff41956a4a90523ab4e.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/9083aebe9d5d5ff41956a4a90523ab4e.png)
步骤7:查看作业日志
单击日志按钮可以查看作业日志。
![](https://qcloudimg.tencent-cloud.cn/image/document/a4b84387cd74f328d319dd25f27b55e4.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/a4b84387cd74f328d319dd25f27b55e4.png)