Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

General outline

  1. Spin up machine
  2. Create 2 new drives following the instructions in Creating Drives under Build Box Changes
    a. If mounting drives for fedora-data or for the tmp directory for migration, make sure to change the owner to tomcat7 (sudo chown tomcat7:tomcat7 folder) for fedora-data and hydep:deploy for the tmp directory (sudo chown hydep:deploy folder)
  3. Deploy Sufia
  4. Ensure apache is off
  5. Activate maintenance mode on old server
  6. Move over minter
  7. Fedora Export - see below
  8. migrate postgres
  9. Fedora Import - see below
  10. run (currently nonexistent) verification job
  11. migrate dump.rdb
  12. Reindex solr

...

The current build scripts in Ansible have problems with two a few changes we 're making to the new boxesneed.

  1. Migration from Postgresql 9.3 to 9.5
  2. Moving to Fedora 4.7
  3. Creating drives

Creating Drives

  1. In the AWS visual interface, go to EC2
  2. Go to Volumes
  3. Select Create Volumes
  4. Make sure the volume is
    1. General Purpose SSD
    2. 150 GB
    3. Availability Zone b
  5. Create 2 of these
  6. Once each one is made, select it and under Actions choose Attach Volume. Type the name or id of the machine and attach the volume.
  7. ssh into the box
  8. Run sudo fdisk -l
    1. You should see /dev/vxdg and /dev/xvdh
    2. If not, check if the volumes are attached
  9. Create the filesystem for each disk
    1. sudo mkfs.xfs /dev/xvdg
    2. sudo mkfs.xfs /dev/xvdh
  10. Mount each disk
    1. sudo mount /dev/xvdg /opt/fedora-data
    2. sudo mount /dev/xvdh /opt/sufia-project/releases/XXXX/tmp
  11. Edit the fstab file to retain these mounts
    1. sudo vi /etc/fstab
      1. /dev/xvdg /opt/fedora-data xfs defaults 0 0

      2. /dev/xvdh /opt/sufia-project/releases/XXXX/tmp xfs defaults 0 0

Postgres

  1. Remove the old version of postgres:
    1. sudo apt-get purge postgresql*
  2. Create the file /etc/apt/sources.list.d/pgdg.list
  3. Add the lineĀ  deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main to that
  4. Add the repo key with this command
    1. wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
  5. sudo apt-get update
  6. sudo apt-get install postgresql-9.5
  7. Log in as postgres and enter psql
    1. sudo su postgres
    2. psql
  8. In Postgres create the chf_hydra and fcrepo databases
    1. CREATE DATABASE chf_hydra;
    2. CREATE DATABASE fcrepo;
  9. In Postgres create the needed users
    1. CREATE USER chf_pg_hydra WITH PASSWORD 'SEE ANSIBLE GROUPVARS/ALL';
    2. CREATE USER trilby WITH PASSWORD 'porkpie2';
  10. Grant each user access to their table
    1. GRANT Create,Connect,Temporary ON DATABASE chf_hydra TO chf_pg_hydra;
    2. GRANT All Privileges ON DATABASE fcrepo TO trilby;
  11. Set the user password for postgres
    1. \password postgres
    2. Enter password from groupvars/all
  12. sudo nano /etc/postgresql/9.5/main/pg_hba.conf
  13. Change the sections under "Database administrative login by Unix domain socket"
    1. peer should be set to md5 for
      1. local all postgres
      2. local all all
      3. host all all
  14. Restart postgres, try to log in with
    1. psql -U postgres
  15. If it lets you use the password, it works!

...