Skip to content
This repository was archived by the owner on Feb 10, 2021. It is now read-only.

Virtual Infrastructure

Iosif George Andrei edited this page Jun 18, 2020 · 5 revisions

Components

The virtual infrastructure consists of the four virtual machines, hosted in VMware Workstation:

  • one load balancer
  • two servers
  • one development environment

A top-down view of the network configuration is listed in the table above:

VM's Name IP Used Ports
Load Balancer 192.168.0.1 10000
First Server 192.168.0.2 10001
Second Server 192.168.0.3 10001
Development 192.168.0.10 8080

Setup

VMs Creation

  • download the .iso images for lubuntu and Ubuntu Server from this link, respectively this one
  • create one virtual machine with lubuntu, further used as load balancer host:
    • name: Load Balancer
    • credentials: admin:admin
    • network connection: NAT
  • create one virtual machine with Ubuntu Server, further used as first server host:
    • name: First Server
    • credentials: server_admin:server_admin
    • network connection: NAT
  • clone the last created VM from VMware Workstation, by right-clicking it, then Manage - Clone option path
  • rename the cloned VM as Second Server

Note: The development virtual machine will not be considered in this section as it depends on each one preference. It only matters to have the required software installed for building the project and creating a web server, for delivering files.

DHCP Configuration

  • find out the four MAC addresses by right clicking each virtual machine in VMware Workstation, then Settings - Network Adapter - Advanced option path
  • in a privileged command line, stop the VMware's DHCP services: net stop vmnetdhcp
  • with a text editor, open C:\ProgramData\VMware\vmnetdhcp.conf and add the following configuration in order to assign the static IP addresses:
# Subnet for Virtual Network 8
subnet 192.168.0.0 netmask 255.255.255.0 {
    range 192.168.0.1 192.168.0.254;
    option broadcast-address 192.168.0.255;
    option domain-name-servers 192.168.0.128;
    option domain-name "localdomain";
    option netbios-name-servers 192.168.0.128;
    option routers 192.168.0.128;
    default-lease-time 1800;
    max-lease-time 7200;
}

# Load Balancer VM
host VMnet8 {
    hardware ethernet AA:AA:AA:AA:AA:AA;
    fixed-address 192.168.0.1;
}

# First Server VM
host VMnet8 {
    hardware ethernet BB:BB:BB:BB:BB:BB;
    fixed-address 192.168.0.2;
}

# Second Server VM
host VMnet8 {
    hardware ethernet CC:CC:CC:CC:CC:CC;
    fixed-address 192.168.0.3;
}

# Development VM
host VMnet8 {
    hardware ethernet DD:DD:DD:DD:DD:DD;
    fixed-address 192.168.0.10;
}
  • from the same privileged command line, opened previously, start the VMware's DHCP services: net start vmnetdhcp

Development VM Configuration

  • build the project following the steps provided in corresponding sections of this documentation
  • create a web server for delivering files, for example, by using Python: python3 -m http.server -d build/ 8080

Server VMs Configuration

  • add to .bashrc, at the end of the file the following lines:
# command alias for updating the server executable
alias update_server = 'wget 192.168.0.10:8080/server -O ~/server'
  • open a new terminal
  • download the executable: update_server
  • give permissions to the executable: chmod 755 ~/server
  • run the executable: ~/server

Note: The steps above must be followed in both server virtual machines.

Load Balancer VM Configuration

  • download the required libraries: sudo wget 192.168.0.10:8080/libsciter-gtk.so -O /lib/libsciter-gtk.so
  • add to .bashrc, at the end of the file the following lines:
# command alias for updating the load balancer executable
alias update_load_balancer = 'wget 192.168.0.10:8080/sciter_load_balancer -O ~/Desktop/load_balancer'
  • download the executable: update_load_balancer
  • give permissions to the executable: chmod 755 ~/Desktop/load_balancer
  • run the executable: ~/Desktop/load_balancer
Clone this wiki locally