LOG8415: Final Project
Scaling Databases and Implementing Cloud Patterns
Author: Simon Tran - 1961278
Installation
- Create 5 t2.micro EC2 instances (for standalone, master, slave1, slave2, slave3)
- Create 1 t2.large instance for the proxy server
- Add the IP addresses of all the VMs in the
.env
file. You may use this command to easily get all the IPsaws ec2 describe-instances --output table --query 'Reservations[].Instances[].[Tags[?Key==`Name`] | [0].Value, PublicIpAddress, PrivateIpAddress]'
- Run the installation script
./install.sh
Benchmark
./scripts.sh standalone start sysbench
./scripts.sh master start sysbench
Proxy
./scripts.sh proxy dependencies
./scripts.sh proxy install
./scripts.sh proxy start
Test some queries
./scripts.sh proxy query direct-hit "SHOW STATUS;"
./scripts.sh proxy query random "SELECT * FROM actor;"
./scripts.sh proxy query customized "SHOW DATABASES;"
./scripts.sh proxy query random "SHOW VARIABLES WHERE Variable_name = 'ndb_nodeid';"
./scripts.sh proxy query customized "SHOW VARIABLES WHERE Variable_name = 'hostname';"
Useful commands
# To connect to the VM via SSH
./scripts.sh master connect
# You may also use `connect` to run commands
./scripts.sh master connect "ps aux"
# To run SQL commands on the VM
./scripts.sh master sql "SHOW DATABASES;"
Stop processes
./scripts.sh master stop ndb
./scripts.sh master stop mysql
Status commands
./scripts.sh master status mysql
./scripts.sh master status cluster
./scripts.sh master status ndb
./scripts.sh master status sakila
NDB Manage
./scripts.sh master manage