Over a million developers have joined DZone.

Promoting High Availability for Your ScaleBase Instance

· Cloud Zone

Build fast, scale big with MongoDB Atlas, a hosted service for the leading NoSQL database on AWS. Try it now! Brought to you in partnership with MongoDB.

Recently some customers running on Amazon EC2 asked me how to configure a HA environment for their ScaleBase instance.
For instance, let’s look at the following architecture:

To ensure that Scalebase is not a single point of failure, several ScaleBase instances can be used – so if one crashes, other instances can handle its connections.

This is quite simple to do:

  1. Start the EC2 instance to be used for the ScaleBase configuration
    1. Install MySQL on the machine and follow the database preparation instructions defined in the ScaleBase installation guide.
    2. Install ScaleBase with the –mode=ALL parameter.
    3. Create an EC2 instance that will be used as an AMI for all ScaleBase installations.
      1. Download and install ScaleBase on the machine using the InstallMachine script. Make sure you use the –mode=LB parameter, to connect to an existing configuration.
      2. Create an AMI out of the instance (in the EC2 management console, right click on the instance and select the “Create Image” option).
      3. Start instances based on the created AMI.
      4. Create an EC2 Load Balancer (see EC2 documentationfor more information).
        1. Make sure all the instances you created are mapped to the Load Balancer.
        2. Make sure the Load Balancer is connected to TCP port 9000, and is using this port for Health Check.
        3. Direct all communication to the Load Balancer DNS.

That’s it. Easy – and works like a charm.

Now it's easier than ever to get started with MongoDB, the database that allows startups and enterprises alike to rapidly build planet-scale apps. Introducing MongoDB Atlas, the official hosted service for the database on AWS. Try it now! Brought to you in partnership with MongoDB.


Published at DZone with permission of Liran Zelkha. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}