TASK: Migrate database

Your task is to migrate the database from machine15s to db_machines.

Some notes:

Operator procedure:

On the new machine:
  1. In the directory with the mysql source, run the "configure" script with the following options: --prefix=/scratch/mysql and --exec-prefix=/scratch/mysql.
  2. Compile and install MySQL by running "make" followed by "make install". This may take a few minutes.
Bring down the service by shutting down the web servers (...bin/apachectl stop) and the application servers (...bin/shutdown.sh).

On the machine currently running MySQL:
  1. Run mysqldump to dump the "rubis" database. You will have to run slide to complete this operation. This may take several minutes.
  2. Copy the directory with the dump files to the new machine. This may take several minutes.
  3. Copy the mysql configuration file from /etc/my.cnf to the corresponding location on the new machine.
On the new machine:
  1. Modify /etc/my.cnf which was previously copied from machine15s (set innodb_log_group_home_dir and innodb_log_arch_dir to /mnt/disk1/; set query_cache_size, innodb_buffer_pool_size and innodb_log_file_size to double their current values)
  2. Run ...bin/mysql_install_db to create the "mysql" database.
  3. Set mysql as the owner and group of the /scratch/mysql/var subdirectory and all files within it.
  4. Start mysql (use slide) by running ...bin/mysqld_safe. Make sure the ibdata files have grown to their maximum size, which is specified in /etc/my.cnf. This may take a few minutes.
  5. Setup a password for MySQL's user "root".
  6. Create a new database called "rubis".
  7. Create the tables pertaining to the rubis database. Make use of the .sql  files generated by the dump operation.
  8. Connect to the MySQL server as root and create a user "rubis" with password "rubispass" and grant all priviledges to the new user.
  9. Connect to the rubis database and set autocommit to 0 (turn it off). This is going to speed up the next step.
  10. Populate the just created "rubis" database with the text files located in the directory DIR. This step will load data into the tables. This may take several minutes.
  11. Connect to the rubis database and set autocommit to 1 (turn it on).
On each of the application server machines:
  1. In the Tomcat configuration file ....webapps/RUBiS/WEB-INF/web.xml, modify the jdbc/url entry to the name of the new database server.
  2. Start tomcat (..../bin/startup.sh).
  3. Check to see if tomcat and a heartbeat process are running.
On each of the web server machines:
  1. Start up Apache (.../bin/apachectl start).
  2. Check if Apache and a heartbeat process are running.

End of operator procedure.