简体   繁体   English

使用计划的Python脚本托管Mongo DB

[英]Hosting a Mongo DB with a scheduled Python Script

I'm looking for a hosting service to run my python scripts. 我正在寻找一个托管服务来运行我的python脚本。 My python scripts take info from various API's and put them into a Mongo database. 我的python脚本从各种API中获取信息,并将其放入Mongo数据库中。 I'd like to schedule them so that they run once an hour. 我想安排它们,使它们每小时运行一次。 Right now I'm running python 2.6 and using a couple of extra packages like facebook sdk and python twitter tools. 现在,我正在运行python 2.6,并使用了一些额外的程序包,例如facebook sdk和python twitter工具。 I've been looking into heroku, but I'm new to the service and I'm having trouble finding documentation on heroku and python. 我一直在研究heroku,但是我是该服务的新手,因此无法找到有关heroku和python的文档。 The other service that I came across is MongoHQ, but I'm unsure as to how that works with Python. 我遇到的另一个服务是MongoHQ,但是我不确定该如何在Python中工作。 Do you know of a hosting service that would be compatible with all of these things? 您是否知道与所有这些东西都兼容的托管服务?

EDIT 编辑

I took the advice below and explored DotCloud a bit. 我接受了以下建议,并对DotCloud进行了一些探索。 For anybody who's a newb like I am, I wrote a post on it on my blog ( swootsblog.cloudfoundry.com ) which I hope is pretty easy to follow along with. 对于像我这样的新手来说,我在自己的博客( swootsblog.cloudfoundry.com )上写了一篇文章,希望跟着它很容易。 It's a continuously running python script writing to a MongoDB all set up on DotCloud. 这是一个连续运行的python脚本,写入到所有在DotCloud上设置的MongoDB。

Heroku Does runs python scripts, I have previously done this with python to postgres database, Heroku确实运行python脚本,我之前已经使用python将其完成到postgres数据库,

Pre-req 先决条件

pythonscripts.py
procfile
requirements.txt

and After add, commit and push the scripts to heroku app. 添加后,提交脚本并将其推送到heroku应用。 Just run the following command on terminal to run the scripts. 只需在终端上运行以下命令即可运行脚本。

heroku run python your_scripts.py

More if you want to run this scripts on a schedule timing. 如果您想按计划的时间运行此脚本,请参阅更多。 then heroku provides lots of adds-on. 然后heroku提供了很多附加组件。 just search it on heroku 只需在heroku上搜索

If you need more help, make a chat with me. 如果您需要更多帮助,请与我聊天。

Heroku doesn't run Python, they only run Ruby, Node.js, Clojure and Java. Heroku不运行Python,它们仅运行Ruby,Node.js,Clojure和Java。

There might be other services, but I've played around with DotCloud which has a python worker type for exactly this sort of work. 可能还有其他服务,但是我玩过DotCloud ,它具有用于这种工作的python worker类型。

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

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