Scaling Servers

When you know you're going to get some traffic, or you see your traffic spike, these three steps will keep you in the game.

1) Add a new Clone Server from your image

By now you're a pro at this thing, so go ahead and create a new Cloud Server from your image "WPClone02″.

2) Edit lsync config on your Master Server

Now we edit the /etc/lsyncd.lua configuration file. Inside the configuration file a block of code containing the private IP address of the clone server was present. This block needs to be replicated with the file for each new clone server created. For example, once two clone servers are present the file would look like the below block of code. Insert the private IP addresses of each clone server.

sudo echo 'sync {
    default.rsync,
    source="/var/www/",
    target="your.clone2.private.ip.address:/var/www/",
    rsync = {
        compress = true,
        acls = true,
        verbose = true,
        rsh = "/usr/bin/ssh -p 22 -o StrictHostKeyChecking=no"
    }
}' >> /etc/lsyncd.lua

Reload the configuration file for the changes to take effect.

restart lsyncd

3) Add Clone to Load Balancer

Finally, add the clone server to the load balancer. This step is identical to that taken upon when we created our first clone server.

Log into the control panel. On the top of the screen, from the list of Rackspace Cloud Products, select the Load Balancers tab.

  • Select the "Load Balancers" tab
            
    

Use the action cog next to the load balancer you wish to modify and select "Add Cloud Servers".

  • Use the Action Cog to select "Add Cloud Servers"
            
    

Place a check in the box into the server you would like to add to the load balancer. You will not need to place a check next to servers already added to the load balancer.

  • Add servers and select "Add Selected Servers.
            
    

You will notice the load balancer go into build state and the nodes will be added to the load balancer. Once finished it will return to active status.