Application Redundancy - 5huckle/OFFICIALTECHJOURNAL GitHub Wiki

Intro

Find (or write) a tiered Web Application that makes use of a remote relational database (Wordpress, Django, wiki.js or similar). Your job is to make your application's presentation and business/logic redundant. You have been provided three new Ubuntu Server Virtual machines with which to make this happen (hooray for netplan). Here's two sample demos.

Steps

  1. Set up networking on u1, u2, u3 using netplan
  2. Install MariaDB on u1,2,3
  3. Make Database redundant across u1,2,3
  4. Create a web application

Networking

Use netplan to assign U1,2,3 addresses of 10.0.5.201,202,203 respectively

network:
  version: 2
  renderer: networkd
  ethernets:
    ens160:
      dhcp4: no
      addresses:
        - 10.0.5.201/24 
      gateway4: 10.0.5.1
      nameservers:
        addresses: [10.0.5.1, 8.8.8.8]

Change the IP address as needed

MariaDB

I had severe difficulty installing mariadb. My first install went great across all boxes, and the configuration of the Galera cluster seemed to be working when I wrote it. However when I tried to restart the mariadb service, it failed every single time. I attempted to remove mariadb and reinstall it, that did not work. I attempted to remove the galera cluster configuration, which shouldn't have had an impact on mariadb ability to start its own service, this did not work. I tried troubleshooting on u1 as to not waste my time repeating all the steps on all the boxes and nothing worked. The worst part is there were no logs whatsoever. I ran 'journalctl -xeu mariadb.service' as the program instructed, and I also checked the default log location for mysql /var/logs/mysql/error and there were no entries in either. I worked with a peer in the lab and none of their troubleshooting steps worked either. No matter what we did, every time I attempted to start the mariadb service it failed with no error codes and no error logs. This has prevented me from completing this lab.

Below are the steps I took for installation and removal of mariadb

installation

sudo apt-get update
sudo apt-get install mariadb-server -y
sudo systemctl start mariadb      
sudo systemctl status mariadb
sudo mysql_secure_installation

Enter current password for root (enter for none):
Switch to unix_socket authentication [Y/n] n
Change the root password? [Y/n] Y
New password:
Re-enter new password:
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
removal

sudo apt-get purge mariadb-* 
sudo apt-get autoremove
sudo apt-get autoclean

This worked on every box, but restarting the service failed after configuration. After removing all files associated with mariadb and galera it still failed repeatedly.

image

image