Advanced Guide: Creating 3 servers linked via VPC - Part 1

The only prerequisite for adding a server is that you must have billing details added.

In this 2-part tutorial, we will show you how to create a cluster of servers using 3 CloudAfrica server instances.

Part 1

In part 1, we will guide you through creation of 3 servers and linking them up to each other via the VPC (Virtual Private Cloud).

Getting Started

The general setting up of servers follows the same procedure as the Visual Guide found here: Visual Basic Guide

However, the only difference is that all 3 of our servers will be connected to each other via the VPC. 1 of the 3 servers will also have a public API (so we can SSH to it).

Setting up the VPC

Add a name for the VPC and a description. Also, link the account/credit-card under "Account". 

Lastly select a DC - The Data Centre / Physical Location of the server.

Following the screenshot below, this is how we will setup the VPC.

Setting up Server 1 (with public API)

We will follow the same setup procedure as the Visual Basic Guide, except that in the VPC tab, we will connect the new server to the existing VPC, as seen below

We will also give this server a public IP-address, so that we can SSH into it

Setting up the other 2 servers

Servers 2 and 3 will follow the same setup procedure as Server 1, except that we won't give these servers their own public IP-addresses

Please note down the private IP-addresses for each of these 2 servers, so that we can ping them (below)

SSH and pinging other servers from Server 1

Using the following command:

ssh -i /path/to/.ssh/privatekey root@{IP-address}

Once successfully connected to the server, we will now attempt pinging the other 2 servers

ping {private-IP-address}

If you are able to ping the other 2 servers, then you have successfully connected your 3 servers internally.

If you are experiencing any issues, please reach out to us at:

What can this be used for?

A common use-case for this setup is to have the following structure:

  • Frontend HTTP server: Apache, Nginx
    • This will be the server with the public IP-address
    • This will handle all incoming traffic to your website/application

  • Application Server: Tomcat, WSGI, gunicorn
    • This server will receive requests from the Frontend server and process those requests
    • Can use >1 application server with a single Frontend server

  • Database server: Postgres, MySQL, MongoDB
    • All requests from the Application Server will interact with the database server(s)

Part 2 - Next steps

In Part 2 of this guide, we will go through an actual setup where a Frontend, Application and database servers are setup

You can find part 2 here:

Advanced Guide: Creating 3 servers VPC - Part 2 (Reddit Clone)