Heroku的静态IP为SFTP [英] Heroku Static IP for SFTP

查看:295
本文介绍了Heroku的静态IP为SFTP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经部署到Heroku上的应用程序。我使用的要求我使用静态IP地址来访问他们的SFTP服务器的服务。我知道Heroku的dynos是不可靠的在这方面。这种使用PROXIMO插件,然而,它的交通,我会送(约500 MB /月)金额太贵我已经成功地实现了。是否有替代品吗?我倾向于使用EC2实例,但不能肯定什么需要创建一个代理或什么的。

I have an application deployed to Heroku. I'm using a service that requires me to access their SFTP server using a static ip address. I know Heroku dynos are unreliable in this regard. I have successfully achieved this using the Proximo addon, however, its too expensive for the amount of traffic that I'll be sending (around 500 MB/month). Is there an alternate to this? I'm inclined towards using an EC2 instance but not quite sure what's required to create a proxy or whatever.

推荐答案

我有一个EC2实例微去;推位周围并没有真正消耗大量的CPU,所以它不可能得到节流。然后,我会给出该实例的弹性IP地址,并传达地址的其他服务。 (无论我选择以后做什么,我总是可以旋转起来另一个实例,并将它关联到IP)。我会再部署一个SOCKS代理(的但丁)?; SOCKS有pretty的wides $ P $垫应用程序的支持,它可以处理SFTP就好了。

I'd go with an EC2 micro instance; pushing bits around doesn't really consume much CPU, so it's unlikely to get throttled. I would then give that instance an elastic IP address and communicate that address to the other service. (Whatever I choose to do later, I can always spin up another instance and associate it to that IP.) I would then deploy a SOCKS proxy (Dante?); SOCKS has pretty widespread application support, and it can handle SFTP just fine.

在这里,有几个细节具体到Heroku的 - 一,你要配置代理服务器的EC2安全组,这样的Heroku可以访问它(见的Dynos和迪诺歧管)。您还需要启用SOCKS服务器上进行验证,因为授予代理授予的Heroku获得的每个人的在Heroku上访问您的代理。然后, Heroku的配置:设置SOME_SERVICE_SOCKS_PROXY =袜子://用户:pass@ip-10-1-2-3.ec2.internal ,和你的应用程序的外观为环境变量,并做正确的事。

From here, there are a couple details specific to Heroku -- for one, you'll want to configure your proxy server's EC2 security group such that Heroku can access it (see Dynos and the Dyno Manifold). You'll also want to enable authentication on the SOCKS server, since granting Heroku access to your proxy grants everyone in Heroku access to your proxy. Then, heroku config:set SOME_SERVICE_SOCKS_PROXY=socks://user:pass@ip-10-1-2-3.ec2.internal, and have your application look for that environment variable and do the right thing.

您很可能会被支付$ 0.01度/ GB的代理和Heroku上的内部区域的数据传输,因为统计上,应用程序将在不同的可用区的大部分时间。 Heroku的dynos持续约24小时的生产,因此,尽管确切的位置会跳舞取消$ P $左右pdictably,它会在$ 0.008 / GB范围可能降落在集合体。您还需要支付微观实例本身(尽管预留实例让他们愚蠢便宜)作为以及通常的AWS因特网的数据传输率。

You'll likely be paying $0.01/GB for intra-region data transfer between your proxy and Heroku, since statistically, your application will be in a different availability zone most of the time. Heroku dynos last about 24 hours in production, so while the exact location will dance around unpredictably, it'll probably land in the $0.008/GB range in aggregate. You'll also be paying for the micro instance itself (though reserved instances make them stupid cheap) as well as the usual AWS Internet data transfer rates.

这篇关于Heroku的静态IP为SFTP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆