Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load balance multi service of the same app. #136

Open
Fred-J opened this issue Nov 25, 2016 · 0 comments
Open

Load balance multi service of the same app. #136

Fred-J opened this issue Nov 25, 2016 · 0 comments

Comments

@Fred-J
Copy link

Fred-J commented Nov 25, 2016

This mup.js (using kadirahq meteor-up) tries to load balance incoming traffic to a example.com to 2 running services of the same App, each service is running on a different AWS EC2.
But when I shut down the first ec2 service, then reload the page, I get page can't be found instead of the expected behaviour of being routed to the other running "second ec2 sevice".
Any idea what is wrong with my mup.js file please.

module.exports = {
  servers: {
    one: {
      host: 'first ec2 public ip',
      username: 'ubuntu',
      pem: "../path to key.pem",
      env: {
        CLUSTER_BALANCER_URL: 'http://one.example.com'
      }
    },
    two: {
      host: 'second ec2 public ip',
      username: 'ubuntu',
      pem: "../path to key.pem",
      env: {
        CLUSTER_BALANCER_URL: 'http://two.example.com'
      }
    }
  },

  meteor: {
    name: 'example',
    path: '../../example',
    servers: {
      one: {},
      two: {}
    },
    buildOptions: {
      serverOnly: true
    },
    env: {
      ROOT_URL: 'http://example.com',
      MONGO_URL: 'mongodb://url from mongodb host',
      CLUSTER_DISCOVERY_URL: 'mongodb://url from mongodb host',
      CLUSTER_SERVICE: 'example'
    },
    docker: {
      image: 'abernix/meteord:base'
    },
    deployCheckWaitTime: 60
  }
};

A records on the AWS DNS looks like this
example.com --> first ec2 public ip
one.example.com --> first ec2 public ip
two.example.com --> second ec2 public ip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant