Trouble with Nginx and Multiple Meteor/Nodejs Apps

后端 未结 2 2064
借酒劲吻你
借酒劲吻你 2020-12-24 09:33

I understand that multiple node.js, and I assume by extension Meteor, can be run on one server using Nginx. I\'ve got Nginx setup and running on a Ubuntu server just fine, I

2条回答
  •  抹茶落季
    2020-12-24 09:52

    People looking for alternative for Nginx: Install Cluster package for each Meteor app and the package will handle load balancing automatically. https://github.com/meteorhacks/cluster

    How to set it up:

    # You can use your existing MONGO_URL for this
    export CLUSTER_DISCOVERY_URL=mongodb://host:port/db,
    # this is the direct URL to your server (it could be a private URL)
    export CLUSTER_ENDPOINT_URL=http://ipaddress
    # mark your server as a web service (you can set any name for this)
    export CLUSTER_SERVICE=web
    

    Example setup:

    {
      "ip-1": {
        "endpointUrl": "http://ip-1",
        "balancerUrl": "https://one.bulletproofmeteor.com"
      },
      "ip-2": {
        "endpointUrl": "http://ip-2",
        "balancerUrl": "https://two.bulletproofmeteor.com"
      },
      "ip-3": {
        "endpointUrl": "http://ip-3",
        "balancerUrl": "https://three.bulletproofmeteor.com"
      },
      "ip-4": {
        "endpointUrl": "http://ip-4"
      }
    }
    

提交回复
热议问题