IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changes between Initial Version and Version 1 of HeathersInstructionsToCopyGpc1ForTestingPurposes


Ignore:
Timestamp:
Nov 4, 2014, 11:43:01 AM (12 years ago)
Author:
heather
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HeathersInstructionsToCopyGpc1ForTestingPurposes

    v1 v1  
     1= How to copy the gpc1 databases for code testing purposes =
     2
     3Once upon a time, the gpc1 database was small enough to take one of the backup dumps to ingest into a database (of a slightly different name, like haf_gpc1) which was extremely useful for testing purposes. One example is code changes to addstar which is hard to debug without testing it with a live database, but which also may end up creating a mess on the real database.
     4
     5The new method is to rsync a copy of the mysql database (off of ippdb03), and configure one of the other machines to host it (brain transplant).  The instructions have been split up by machines
     6
     7== ippdb03 ==
     8
     9The following steps are to be done on ippdb03, as root:
     10
     11cd /var/lib/mysql
     12du -h
     13mkdir /data/(place with enough space).0/heather_gpc1_copy
     14rsync -rvua /var/lib/mysql/ heather@(placewitheoughspace):/data/(place with enough space).0/heather_gpc1_copy/
     15
     16wait for the copy to finish. Note that I didn't stop the gpc1 database - I assumed whatever it had is good enough for my purposes (hopefully it will be?)
     17
     18== (new machine) ==
     19
     20I did this on stare01 because I know those machines - they are high memory, they have mysql that I use for the temp ipptopsps databases.  This first attempt was a bit tricky because i had to shift the ipptopsps databases to stare01.1 (because of out of space problems). '''Note that this is a brain transplant -- the exisiting databases are shoved aside and are unusable, so check that A) there are no databases on that machine so you can do this, and B) if there are databases that no one is using them and it's ok to do that.'''
     21
     22as root on new machine:
     23
     24 * Stop mysql and make sure it's Dead
     25  * /etc/init.d/mysql stop
     26  * ps auxw | grep mysql
     27  * kill -9 (mysql id if still running)
     28  * (check that mysql is not running)
     29 * move the copy of gpc1 into place
     30   * /var/lib/mysql usually points to /data/stare01.1/mysql, for example.  Move that mysql out of the way  ---
     31   * cd /data/stare01.1
     32   * mv mysql mysql.save
     33 * start mysql with the usually variety of
     34   * /etc/init.d/mysql stop
     35   * /etc/init.d/mysql start
     36   * (maybe a zap as needed)
     37 * add accounts, you will need to do:
     38   * mysql -u root
     39   * CREATE USER 'ipptest'@'%' IDENTIFIED BY 'ipptest'
     40   * GRANT ALL on *.* to 'ipptest'@'%';
     41   * show grants;
     42 * should be able to mysql -h stare01 -u ipptest -pipptest gpc1
     43 
     44