华北1 ECS 数据如何免费且高速同步到华北2MaxCompute

用户业务早期开在了华北1青岛,想搭数据仓库,但华北1又没有MaxCompute,怎么办?如果华北1 ECS跨Region数据同步到华北2MaxCompute,是否产生额外的带宽费用和同步性能差?


今天小编亲自测试下华北1 ECS 数据如何免费且高速同步到华北2MaxCompute,打消大家对费用和性能的担心。


实验环境:

1、准备一台华北1青岛的经典网络ECS,规格不限制,比如2核4G;

2、开通华北2北京MaxCompute服务并创建Project,参考:https://help.aliyun.com/document_detail/58226.html

3、下载MaxCompute CLI(odpscmd)及JDK 1.7+,参考:https://help.aliyun.com/document_detail/27804.html,并配置project_name、access_id、access_key、end_point、tunnel_endpoint;

注意:其中tunnel_endpoint要配置为经典网络(也就是常说的内网模式),如果配置成公网模式,数据上下行就会产生费用。

 

end_point=http://service.cn.maxcompute.aliyun-inc.com/api
tunnel_endpoint=http://dt.cn-beijing.maxcompute.aliyun-inc.com
4458ddc1f345559d7935246bda1e84fc1cb801c5
4、造个简单的成绩单数据test.txt 。

yunhua,80

yinlin,100

quning,90

haiqing,80

yixiu,80

baijie,88

sixiang,83


开始测试:

1、登陆华北1 ECS CMD控制台,启动odpscmd,输入whoami,确认服务连接地址是否正确;


4451e69aa15c05b4246c9cf803af697e6dd0003b


2、创建临时表;


create table wc_in1 (key string, value string);


3、通过tunnel,将成绩单数据导入华北2MaxCompute表wc_in1;


tunnel upload  C:/test.txt wc_in1

502e49d1d725fc313b9c06dcbac32659e693ec5f

4、通过tunnel下载数据;


tunnel download  wc_in1 C:/test2.txt
912a5fa64ad266041d421b08c37ac543d523f02b


效果:


在阿里云费用中心,导出MaxCompute计量计费信息,可以看到MaxCompute计量UploadIn,DownloadIn。

UploadIn代表经典网络(内网)上行,不计费;

DownloadIn代表经典网络(内网)下行,不计费;

UploadEx代表外网(公网)上行;

DownloadEx代表外网(公网)下行;

81fd57b48eb32d497c3847827a7d765aaa93fd8c


总结:华北1 ECS用户 可以通过配置正确的MaxCompute 服务域名(EndPoint),来免费且高速同步数据到华北2MaxCompute;


猜你喜欢

转载自yq.aliyun.com/articles/646264
ECS