-
-
- Yaseen Khan([email protected])
- Jadon Kwan([email protected])
-
https://drive.google.com/file/d/1p6V2Ix3EC5MszBOfSZsux6rmG2GLTcid/view?usp=sharing
-
-
- Download the latest version of MySQL if you don't have it
- Login to mysql as the root user:
local> mysql -u root -p
- Create user CS122B and grant privileges
mysql> CREATE USER 'CS122B'@'localhost' IDENTIFIED BY 'FabFlix'; mysql> GRANT ALL PRIVILEGES ON * . * TO 'CS122B'@'localhost'; mysql> quit;
- Create the moviedb database
local> mysql -u CS122B -p mysql> CREATE DATABASE IF NOT EXISTS moviedb; mysql> USE moviedb; mysql> quit;
- Create the moviedb tables using the create_table.sql file:
local> mysql -u CS122B -p < create_table.sql
- Populate the database data using the movie-data.sql file:
local> mysql -u CS122B -p --database=moviedb < PATH/movie-data.sql
Populate the database data using the movie-data.sql file:local> mysql -u CS122B -p --database=moviedb < PATH/movie-data.sql
-
- SSH into your AWS instance. EX:
ssh -i My.pem [email protected]
- Clone the github repo using
git clone https://github.com/uci-jherold2-teaching/cs122b-fall-team-37.git
- If you don't have the moviedb database setup, follow the Database Setup instructions
- If using a different database account, change the username and password in
web/META_INF/context.xml
- Run
mvn package
to build the war file. - Copy the war file:
sudo cp ./target/*.war /var/lib/tomcat9/webapps/
- Refresh your tomcat manager and deploy the app.
- Head to the web page of your AWS instance.
- SSH into your AWS instance. EX:
-
- Clone the github repo using
git clone https://github.com/uci-jherold2-teaching/cs122b-fall-team-37.git
- Open the Project in Intellij
- If you don't have the moviedb database setup, follow the Database Setup instructions
- If using a different database account, change the username and password in
web/META_INF/context.xml
- Build project using maven.
- Set up tomcat to use your war file (IntelliJ has configuration with Tomcat).
- Open your localhost to the correct port.
- Clone the github repo using
-
-
- Set up Connection Pooling
- Performed Single-Instance JMeter tests
- Wrote log_processing.py script
- Set Up Master/Slave instances
- Set Up Load Balancer
- Performed Scaled JMeter tests
-
-
Include the filename/path of all code/configuration files in GitHub of using JDBC Connection Pooling.
- src/main/java/FullTextSearchServlet.java
- src/main/java/SearchMovieServlet.java
- src/main/java/AutocompleteSearchServlet.java
- WebContent/META-INF/context.xml
-
Connection Pooling is utilized in the Search servlets for the JMeter tests. The connection pool configurations are in the context.xml file. The max number of pool connections is 100. The max number of idle connections is 30. The maximum timeout period for a connection is 10000 ms. Additionally, the Prepared Statements for each servlet is cached so more than one JDBC connection can utilize these statements. Caching the Prepared Statements is needed since Prepared Statements are usually associated with one Connection. Once all the Prepared Statements are executed, the database connection closes.
-
Since there are 2 backend instances, there will also be 2 database instances when the connection pools are created. When both the master and slave connections are opened, and a new connection is created in slave or master, the connection pool will direct to where the new connection is created. These connections are added to the connection pool for reusability but are separated by the database.
-
-
WebContent/META-INF/context.xml
For the Slave Instance, if it is given a write request, it uses a different connection and connects to the Master database rather than the localhost (its own). So even if it still receives write requests which is intended, it will write to the other database using the different connection.
-
- The log processing script is written using Python3
- The JMeter logs are stored as text files. The log processing script only supports text files
- To run log_processing.py, you need 2 parameters: directory/filename.txt and a positive integer representing the test case
python3 log_processing.py <directory_name>/logfile.txt <integer case number>
- If the log files are in the same directory as log_processing.py script, then the directory name does not need to be specified
python3 log_processing.py logfile.txt <integer case number>