TASK: Migrate database
Your task is to migrate the database from machine15s to db_machines.
Some notes:
- db_machines already has mysql source in /scratch/mysql-4.0.12.
- You might want to access MySQL documentation from www.mysql.org.
- MySQL currently running on machine15s has a database called "rubis"
and a user called "rubis" whose password is "rubispass".
- There is scope for performing some of the following steps in
parallel
with others.
Operator procedure:
On the new machine:
- In the directory with the mysql source, run the "configure"
script with the
following options: --prefix=/scratch/mysql and
--exec-prefix=/scratch/mysql.
- 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:
- Run mysqldump to dump the "rubis" database. You will have to run
slide to complete this operation. This may take several minutes.
- Copy the directory with the dump files to the new machine. This
may take several minutes.
- Copy the mysql configuration file from /etc/my.cnf to the
corresponding location on the new machine.
On the new machine:
- 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)
- Run ...bin/mysql_install_db to create the "mysql" database.
- Set mysql as the owner and group of the /scratch/mysql/var
subdirectory and all
files within it.
- 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.
- Setup a password for MySQL's user "root".
- Create a new database called "rubis".
- Create the tables pertaining to the rubis
database. Make use of the .sql files generated by the dump
operation.
- Connect to the MySQL server as root and create a user "rubis"
with password "rubispass" and grant all
priviledges to the new user.
- Connect to the rubis database and set autocommit to 0 (turn it
off). This is going to speed up the next step.
- 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.
- Connect to the rubis database and set autocommit to 1 (turn it
on).
On each of the application
server machines:
- In the Tomcat configuration file
....webapps/RUBiS/WEB-INF/web.xml,
modify the jdbc/url entry to the name of the new database server.
- Start tomcat (..../bin/startup.sh).
- Check to see if tomcat and a heartbeat process are running.
On each of the web server
machines:
- Start up Apache (.../bin/apachectl start).
- Check if Apache and a heartbeat process are running.
End of operator procedure.