Running and managing nodejs applications on single server

前端 未结 5 704
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-31 21:19

Is there a good way to run and manage multiple nodejs apps on a single server?

I\'ve been looking at haibu and nodester, but they seem a little complex for what I am try

5条回答
  •  别跟我提以往
    2021-01-31 21:44

    I wrote an app nodegod that I use for a handful deployments of maybe 10 apps each.

    • nodegod reads an app list from json. It has an internal state machine for each app that handles the app life cycle in a safe manner including restarts, and the web page features stop/start/debug.

    • The web interface uses web sockets, so that you can manage remote servers over ssh.

    • As you deploy over rsync, apps restart automatically.

    • Because nodegod monitors the stdout of other apps, you can capture an app's final breath like segfault and malloc errors.

    • I use a fork of http-proxy in front of a slew of express instances, so any number of apps can share a single server port per dns for both http and web sockets.

    I wrote a haraldops module to read app configuration from outside the source tree. With that you can monitor and get emails whenever something's up with an app.

    App configurations I keep in a git repo in the file system.

    It's not rocket science, and it all fits very nicely together. Only node and json: SIMPLE gets more done.

提交回复
热议问题