V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Tornado Documentation
http://www.v2ex.com/tornado/
Tornado on GitHub
https://github.com/facebook/tornado/
Tornado Gists
http://tornadogists.org/
lemayi
V2EX  ›  Tornado

[伸手党] 寻tornado+nginx+supervisor详细配置

  •  
  •   lemayi · 2013-03-19 18:19:36 +08:00 · 6900 次点击
    这是一个创建于 4045 天前的主题,其中的信息可能已经有所发展或是发生改变。
    搞了两天,居然还是没搞定。。。
    焦头烂额。
    大家就救救新人吧。。。
    6 条回复    1970-01-01 08:00:00 +08:00
    tarsier
        1
    tarsier  
       2013-03-19 18:33:52 +08:00
    nginx应该是单独的前端web server, 将过来的请求发给后面的tornado处理

    supervisord的作用是在tornado进程挂掉的时候自动重启。

    你的tornado一般是跑在wsgi模式的,那么nginx里只需要配置将某个 virtual host的请求按照 wsgi标准往后发给tornado (很可能tornado会起多个进程,监听不同端口,做负载均衡)

    我觉得唯一难配置的就是 supervisord这一块,你可以看看这两篇博客

    http://blog.xiangjian.info/2011/08/deploy_tornado_with_supervisor_nginx.html
    http://feilong.me/2011/03/monitor-processes-with-supervisord

    有问题继续联系,多试几次没问题的
    JasonH
        2
    JasonH  
       2013-03-19 18:44:04 +08:00   ❤️ 1
    [program:tornado]
    directory=/path/to/your/tornado/app
    command=python your_app.py
    autostart = true
    autorestart = true
    startsecs = 5
    user = root
    tarsier
        3
    tarsier  
       2013-03-19 18:48:30 +08:00
    @JasonH 用root跑tornado。。。。
    lemayi
        4
    lemayi  
    OP
       2013-03-19 21:20:38 +08:00   ❤️ 1
    @tarsier
    @JasonH
    灰常感谢。我发现我还没有从php的一些思维中跳出来。有不懂的我再问哈。再次感谢!
    SErHo
        5
    SErHo  
       2013-03-19 22:04:36 +08:00   ❤️ 1
    厚着脸皮推荐一下我的博客配置文件:https://github.com/SerhoLiu/serholiu.com 希望对你有帮助。
    lemayi
        6
    lemayi  
    OP
       2013-03-20 09:43:36 +08:00
    @SErHo 感谢!
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3824 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 121ms · UTC 04:24 · PVG 12:24 · LAX 21:24 · JFK 00:24
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.