shengbinxu commented on issue #27899:
URL: https://github.com/apache/doris/issues/27899#issuecomment-2235036128

   使用stream load方式导入数据,如果应用程序和doris集群不在一个局域网,这个问题无解。
   因为通过http导入数据时,fe会给应用程序返回be的地址,然后客户端和be进行通信。而be的地址目前必须得是内网地址,并且无法修改。
   在selectdb官方论坛看到一个帖子说,be不允许通过外网访问,因为会导致be不安全。
   
   我们的应用程序和doris不在一个局域网,这个问题困扰了很久。采用mysql load方式导入可以绕开网络的问题。
   https://doris.apache.org/zh-CN/docs/data-operate/import/mysql-load-manual
   ```
   MySQL Load 与 Stream Load 功能相似,都是导入本地文件到 Doris 集群中。因此 MySQL Load 的实现复用了 
Stream Load 的基本导入能力。
   
   下图展示了 MySQL Load 的主要流程:
   
   用户向 FE 提交 LOAD DATA 请求,FE 完成解析工作,并将请求封装成 Stream Load;
   
   FE 会选择一个 BE 节点发送 Stream Load 请求;
   
   发送请求的同时,FE 会异步且流式的从 MySQL 客户端读取本地文件数据,并实时的发送到 Stream Load 的 HTTP 请求中;
   
   MySQL 客户端数据传输完毕,FE 等待 Stream Load 完成,并展示导入成功或者失败的信息给客户端。
   ```
   这种方式,应用程序可以通过mysql协议(或者叫jdbc)和集群通信,不需要直接和BE通信 (实际上是FE在和BE直接通信)。
   
   亲测可行。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to