DDL-Processing-Parallel-DBMS

Implementation of the DDL processing component of a parallel SQL processing system. The parallel SQL # processing system consists of a cluster of DBMS instances running on different machines (possibly virtual # machines). DDLs submitted to the system will need to be translated into corresponding DDLs for each individual # DBMS instance in the cluster and executed there. In addition a catalog database stores metadata about what # data is stored for each table on each DBMS instance in the cluster.

==========================

LOCAL MACHINE (macOS)

Install Homebrew:
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install virtualbox & vagrant:
$ brew cask install virtualbox
$ brew cask install vagrant
$ brew cask install vagrant-manager

Install python3 if not already on machine:
$ brew install python3

==========================

LOCAL MACHINE (Linux)

Install virtualbox & vagrant:
$ sudo apt install virtualbox
$ sudo apt install vagrant
$ sudo apt install vagrant-manager

Install python3 if not already on machine:
$ sudo apt install python3

==========================

Install PyMySQL if not already on machine:
$ pip3 install PyMySQL

Create a Directory for the Catalog and each Node:
$ mkdir catalog
$ mkdir node1
$ mkdir node2

Install all necessary files from the repo:

  1. test.py
  2. c.cfg
  3. d.sql
  4. run.sh

Initialize a virtual machine in each directory:
$ vagrant init ubuntu/xenial64
$ vagrant up
$ vagrant ssh

Change to the /vagrant directory of each virtual machine
$ cd /vagrant

Open Vagrantfile in Each Directory:
Replace line 25 with:
config.vm.network "forwarded_port", guest: 3306, host: 3306, auto_correct: true
Replace line 29 with:
config.vm.network "private_network", ip: "ADDRESS_VALUE"
Note: ADDRESS_VALUE depends on Directory:
/textbox2, address_value = localhost_network.20
/textbox1, address_value = localhost_network.10
/catalogbox, address_value = localhost_network.30

Install MySQL in Each Directory:
$ sudo apt-get install mysql-server
Note: Password for MySQL-server: password
$ /usr/bin/mysql_secure_installation
Note: Respond No to everything but Remove test database and access to it, and Reload privilege tables

Connect to MySQL in Each Directory:
$ mysql -u root -p;
Enter password: 'password'

Create a database in Each Directory:
NOTE: If a user already exists then drop it:
mysql> drop user 'username'
Create the database:
mysql> create database TESTDB;

Create Remote Users in Each Directory:
mysql> use TESTDB;
mysql> create user 'username';
mysql> grant all on TESTDB.* to username@'%' identified by 'password';
mysql> exit
$ exit

Run the DDL from your local host repo:
$ python3 test.py c.cfg d.sql