Creating 3 Servers and connecting them via the VPC

Modified on Tue, 13 Dec, 2022 at 7:46 AM

TABLE OF CONTENTS


In this two-part guide, a cluster of servers is created using 3 CloudAfrica server instances.


The virtual server setup follows the same procedure as the visual guide found > here. However, all 3 of our servers will be connected to each other via the VPC. In addition, one of the three servers will also have a public IP (for SSH access).


Setting Up the VPC

To set up the VPC, locate the VPC menu item and click 'Create VPC'. Add a name for the VPC, description and link account/credit-card under 'Account' - all servers in this VPC will be billed to this account/credit-card automatically. Lastly, select a DC and click 'Save'.


Setting Up Server 1 (with Public IP)

To set up Server 1, the same procedure is followed from the > Virtual Server Setup, except in the private network/VPC tab, the new server will be connected to the existing VPC. The server will also be given a public IP address, for SSH access.


Setting Up Server 2 and Server 3

Server 2 and Server 3 will follow the same setup procedure as Server 1, except these servers will not have their own public IP address. 


Please note down the private IP addresses for each server in order to ping them.


SSH Access and Pinging Other Servers from Server 1 

To connect to Server 1, use the following command:          

ssh -i /path/to/.ssh/privatekey user@{public-ip-address}

Once successfully connected to the server, we will now attempt pinging the other two 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


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. The server 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. Note than one can use multiple application servers with a single frontend server.

  • Database server: Postgres, MySQL, MongoDB:

All requests from the application server will interact with the database server(s)


Noticed a discrepancy or a bug? > Let Us Know!

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article