简体   繁体   English

Cloudhub 中的 Mule 4 SFTP 超时

[英]Mule 4 SFTP Timeout in Cloudhub

I have a Mule 4 flow which connects to a SFTP location to read files, and perform a set of operations.我有一个 Mule 4 流,它连接到 SFTP 位置以读取文件并执行一组操作。 This works fine when I run the project from Anypoint Studio.当我从 Anypoint Studio 运行项目时,这可以正常工作。 However when I deploy this, I see the following error when the projects gets deployed to cloudhub:但是,当我部署它时,当项目部署到 cloudhub 时,我看到以下错误:

Connectivity test failed for config 'SFTP_Config'.配置“SFTP_Config”的连接测试失败。 Application deployment will continue.应用程序部署将继续。 Error was: Could not establish SFTP connection with host: ' .错误是:无法与主机建立 SFTP 连接:' . . . . ' at port: '22' - timeout: socket is not established org.mule.runtime.api.connection. ' 在端口:'22' - 超时:未建立套接字 org.mule.runtime.api.connection。 ConnectionException: Could not establish SFTP connection with host: ' . ConnectionException:无法与主机建立 SFTP 连接:' . . . . ' at port: '22' - timeout: socket is not established at org.mule.runtime.core.internal.connection.ErrorTypeHandlerConnectionProviderWrapper.lambda$connect$0(ErrorTypeHandlerConnectionProviderWrapper.java:70) at java.util.Optional.map(Optional.java:215) ' 在端口:'22' - 超时:套接字未在 org.mule.runtime.core.internal.connection.ErrorTypeHandlerConnectionProviderWrapper.lambda$connect$0(ErrorTypeHandlerConnectionProviderWrapper.java:70) 在 Z93F725A07423FE1C889F448B33D21F448B33D21F448B33D21F448B33D21F .java:215)

My SFTP connection config is as shown below:我的 SFTP 连接配置如下所示:

<sftp:config name="SFTP_Config" doc:name="SFTP Config" doc:id="3cac96f7-4985-48eb-a4fc-77a312a6dc22" >
    <sftp:connection workingDir="${sftp.basepath}" host="${sftp.host}" username="${sftp.user}" password="${sftp.password}" port="${sftp.port}">
        <reconnection >
            <reconnect frequency="20000" count="5" />
        </reconnection>
    </sftp:connection>
</sftp:config>

Am I missing something in the connection configuration.我是否在连接配置中遗漏了什么。 Or is the error due to something else?还是由于其他原因导致错误? Any help would be highly appreciated.任何帮助将不胜感激。

Usually communication will fail from CloudHub when it is a private server, not accessible from the public Internet, or access requires a whitelist from the server side.通常,当 CloudHub 是私有服务器、无法从公共 Internet 访问或访问需要服务器端的白名单时,与 CloudHub 的通信会失败。

You can test if there is network connectivity deploying a test application to perform tests as described here: https://help.mulesoft.com/s/article/Network-connectivity-testing您可以测试是否存在网络连接,部署测试应用程序来执行测试,如下所述: https://help.mulesoft.com/s/article/Network-connectivity-testing

In the first case, you need to setup a VPN from CloudHub to the network where the SFTP server resides.在第一种情况下,您需要设置一个从 CloudHub 到 SFTP 服务器所在网络的 VPN You may also need to setup the internal DNS if the host name is not public or not an IP.如果主机名不是公共的或不是 IP,您可能还需要设置内部DNS。

For the second you can setup a public static IP for the worker where the application is deployed.其次,您可以为部署应用程序的工作人员设置公共 static IP

Double check that your sftp.host is available from cloud.仔细检查您的 sftp.host 是否可以从云中获得。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM