MUP 1.5 Loadbalancing on 2 EC2 Servers

I wanted to try out horizontal scaling. It seems the beanstalk version of MUP is not quite stable yet so I’d like to just try with 2 servers using MUP now that it has load balancing. I configured everything as follows (I left out the other details that I think aren’t relevant):

module.exports = {
  servers: {
    one: {
      host: '1.2.3.4',
      username: 'ubuntu',
      pem: "xxx.pem",
      privateIp: '1.2.3.5'
    },
    two: {
      host: '1.2.3.6',
      username: 'ubuntu',
      pem: "xxx.pem",
      privateIp: '1.2.3.7'
    }
  },

  app: {    
    servers: {
      one: {},
      two: {},
    },
  },

  proxy: {
    domains: 'app.practicle.sg',
    ssl: {
      // Enable let's encrypt to create free certificates
      letsEncryptEmail: 'chongming@practicle.sg',
      forceSSL: true
    },
    loadBalancing: true
  }

};

Is that all that is needed for it to work? For route53 I will point to both public IPs. Do I need to set up anything extra like a load balancer on AWS?

Thanks in advance.

1 Like

Dna failiver can be quite slow, and changing your dna entries in the future can be exceptionally slow. Similarly, you can’t point the dns at the two hosts directly or you’ll bypass your ssl proxy.

I’d strongly recommend using an external load balancer. You can point route53 at it using aliases which are super fast to update when you need too and aws has free public ssl too, which makes life easier.

I wrote a plugin for zero downtime deploys using aws elb but I don’t think it will work with the new mup tool. We switched to a custom deployment as it is so much faster and easier to roll back

You can’t use automatic SSL and load balancing at the same time, you can use manual certificates plus load balancing,

Just like that:

ssl: {
			crt: './chain.crt',
			key: './private.key'
		},

I recommend you manually generate wildcard encryption certificates like this *.domain.com