FAQ
Hi,

Currently I am using noir for developing web apps. I am deploying them on
an EC2 server, by running lein trampoline run in the project directory. I
also have a nginx in front of it which is handling serving of static files.

I have never had the apps crash, however recently on app was down on one
fine morning, which was easily restarted ueing lein. How do others monitor
and deploy clojure web apps in production? Is there a lein plugin which can
monitor and restart the app if it is down ( such as nodejs's forever) ?

Thanks,
Murtaza


--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Search Discussions

  • Alex Robbins at May 16, 2012 at 12:10 pm
    You could probably use upstart or supervisord.

    Upstart is available if you are on a newish ubuntu system (and maybe others?).
    Supervisord could run on most linuxes I think, although I've only ever
    used it on ubuntu.

    Hope that helps,
    Alex

    On Wed, May 16, 2012 at 2:13 AM, Murtaza Husain
    wrote:
    Hi,

    Currently I am using noir for developing web apps. I am deploying them on an
    EC2 server, by running lein trampoline run in the project directory. I also
    have a nginx in front of it which is handling serving of static files.

    I have never had the apps crash, however recently on app was down on one
    fine morning, which was easily restarted ueing lein. How do others monitor
    and deploy clojure web apps in production? Is there a lein plugin which can
    monitor and restart the app if it is down ( such as nodejs's forever) ?

    Thanks,
    Murtaza


    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your
    first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
  • Tim Visher at May 16, 2012 at 1:49 pm

    On Wed, May 16, 2012 at 3:13 AM, Murtaza Husain wrote:
    Currently I am using noir for developing web apps. I am deploying them on an
    EC2 server, by running lein trampoline run in the project directory. I also
    have a nginx in front of it which is handling serving of static files.

    I have never had the apps crash, however recently on app was down on one
    fine morning, which was easily restarted ueing lein. How do others monitor
    and deploy clojure web apps in production? Is there a lein plugin which can
    monitor and restart the app if it is down ( such as nodejs's forever) ?
    I'm not personally using this but people I trust recommend it highly.
    It has a free option plus fairly reasonable monthly options.

    http://www.pingdom.com/

    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
  • Kyle R. Burton at May 16, 2012 at 2:03 pm

    I'm not personally using this but people I trust recommend it highly.
    It has a free option plus fairly reasonable monthly options.

    http://www.pingdom.com/
    We use a similar service: cloudkick

    We have some custom plugins that we've written for it (to monitor
    RabbitMQ consumers and queue sizes -- we have had consumers die and
    need to be restarted).

    As you are, we are using Nginx. We have it set up to serve static
    content and act as a load balancer and to do SSL termination. We have
    a cluster of app servers set up behind this Nginx load balancer.
    Having multiple app servers helps significantly with issues like a
    single box going out. We have 3 configurations for the load balancer:
    an A, a B and A+B. Where each has 50% of the app servers configured.
    Nginx handles any one of the app servers being down, and we perform
    releases, we split the cluster in to A, deploy to the boxes in B, wait
    for the JVMs to warm up, the flip A and B and release to the A
    partition. When those JVMs have warmed up we put them all back into
    rotation (A+B). We use a symlink to point to the 3 configurations and
    do a HUP on Nginx to have it reload its configuration without dropping
    any connections.

    We're not on AWS yet, if we were I think the same would be
    accomplished with ELB instead of Nginx.

    I think this is a pretty common set up -- we are following the books:
    Scalable Internet Architectures, and Release IT (I highly recommend
    both of those books).


    Regards,

    Kyle

    --
    Twitter: @kyleburton
    Blog: http://asymmetrical-view.com/
    Fun: http://snapclean.me/

    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
  • Murtaza Husain at May 16, 2012 at 2:44 pm
    Tim thanks for the link, I will give it a go.

    Kyle appreciate the detailed explanation, yes will try to put in practice
    through ELB, but I am not sure if I can switch the configs like you do with
    nginx.
    On Wednesday, May 16, 2012 7:32:59 PM UTC+5:30, Kyle Burton wrote:

    I'm not personally using this but people I trust recommend it highly.
    It has a free option plus fairly reasonable monthly options.

    http://www.pingdom.com/
    We use a similar service: cloudkick

    We have some custom plugins that we've written for it (to monitor
    RabbitMQ consumers and queue sizes -- we have had consumers die and
    need to be restarted).

    As you are, we are using Nginx. We have it set up to serve static
    content and act as a load balancer and to do SSL termination. We have
    a cluster of app servers set up behind this Nginx load balancer.
    Having multiple app servers helps significantly with issues like a
    single box going out. We have 3 configurations for the load balancer:
    an A, a B and A+B. Where each has 50% of the app servers configured.
    Nginx handles any one of the app servers being down, and we perform
    releases, we split the cluster in to A, deploy to the boxes in B, wait
    for the JVMs to warm up, the flip A and B and release to the A
    partition. When those JVMs have warmed up we put them all back into
    rotation (A+B). We use a symlink to point to the 3 configurations and
    do a HUP on Nginx to have it reload its configuration without dropping
    any connections.

    We're not on AWS yet, if we were I think the same would be
    accomplished with ELB instead of Nginx.

    I think this is a pretty common set up -- we are following the books:
    Scalable Internet Architectures, and Release IT (I highly recommend
    both of those books).


    Regards,

    Kyle

    --
    Twitter: @kyleburton
    Blog: http://asymmetrical-view.com/
    Fun: http://snapclean.me/
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
  • Tim Visher at May 17, 2012 at 3:09 pm

    On Wed, May 16, 2012 at 3:13 AM, Murtaza Husain wrote:
    Is there a lein plugin which can
    monitor and restart the app if it is down ( such as nodejs's forever) ?
    I just noticed this part of your question.

    In your context (EC2) it should be exceedingly simple do write a bash
    script that would do this. Use curl or wget or something to retrieve
    the landing page, and if it responds with an error code cd into the
    directory and run your start up command. Throw that in cron and you
    should be good to go.

    Of course pingdom or the other services mentioned here could still be
    useful to actually notify you when it has gone down.

    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
  • Stuart Sierra at May 17, 2012 at 8:37 pm
    This is probably outside the scope of what Lein and Clojure do, but it's a
    well-studied problem for JVM apps.

    AWS itself has a variety of solutions, such as Elastic Beanstalk and Cloud
    Formation.

    At the OS-level, there's monit and its kin.

    -S

    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupclojure @
categoriesclojure
postedMay 16, '12 at 7:13a
activeMay 17, '12 at 8:37p
posts7
users5
websiteclojure.org
irc#clojure

People

Translate

site design / logo © 2022 Grokbase