How does one go about having multiple droplets ?

February 21, 2013 4.6k views
Is there any way I can scale ? Say add additional droplets when load increases ? Also - If I have a separate job server , separate db server and separate frontend web server - How do I set up communication between them ? Links to articles would be appreciated
2 Answers
Right now, there's not an auto-scaling feature available. I'd definitely love to see one, though for the time being, you would need to manually re-size the VPS through the control panel if you needed to add more CPU/RAM to cope with higher loads. It does require that you power off the VPS, so you'll need to factor that in. Reboots are normally very quick, though if you re-size the disk as well, the time for the re-size + reboot could take a little longer.

As far as doing a cluster setup, there are a few articles to get you started, though I've not seen one which lists all the steps individually. You'd need to break down the process of setting up one server into multiple.

As an example, this is a quick-and-easy guide to setting up CentOS with NGINX, MySQL, and PHP-FPM.

If you need to setup a MySQL Server, you can do that relatively easy. On CentOS all you'd need to do is run a few commands to get things going. You'd need to skip "Step Two" in the guide above as you'll be performing that below.

1). yum update -y
- - Updates all software on the VPS

2). yum install mysql mysql-server -y
- - Installs MySQL

3). /etc/init.d/mysqld start
- - Starts MySQL

4). /usr/bin/mysql_secure_installation
- - Allows you to set a root password for MySQL, remove test users, and other un-needed info.

5). /etc/init.d/mysqld restart
- - Restart MySQL

Now MySQL is up, running, and you can connect to it using the IP of your VPS. I would advise installing a firewall to block connections from all IP's except the ones you want to connect as leaving it open as it would be right now would make it susceptible to attack.

To setup a web server, you can follow the same guide, start at the top and skip "Step Two"
by Etel Sverdlov
LEMP stack is a group of open source software to get web servers up and running. The acronym stands for Linux, nginx (pronounced Engine x), MySQL, and PHP. This tutorial explains how to install the required repos to download nginx and php-fpm, how to install MySQL, how to install nginx, how to install php-fpm, how to configure php and nginx, and how to create a php info page. This tutorial is written for CentOS.
A very simple Load Balancer can be done with Nginx. I already did mine and I'm in the process of setting up some custom scripts to auto scale up or down according to my server's load. I know, if my main droplet goes down, my entire mini network will go down as well...But hey, you get what you pay for.
Have another answer? Share your knowledge.