General outline
- Spin up machine
- 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) - Deploy Sufia
- Ensure apache is off
- Activate maintenance mode on old server
- Move over minter
- Fedora Export - see below
- migrate postgres
- Fedora Import - see below
- run (currently nonexistent) verification job
- migrate dump.rdb
- Reindex solr
...
The current build scripts in Ansible have problems with two a few changes we 're making to the new boxesneed.
- Migration from Postgresql 9.3 to 9.5
- Moving to Fedora 4.7
- Creating drives
Creating Drives
- In the AWS visual interface, go to EC2
- Go to Volumes
- Select Create Volumes
- Make sure the volume is
- General Purpose SSD
- 150 GB
- Availability Zone b
- Create 2 of these
- 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.
- ssh into the box
- Run sudo fdisk -l
- You should see /dev/vxdg and /dev/xvdh
- If not, check if the volumes are attached
- Create the filesystem for each disk
- sudo mkfs.xfs /dev/xvdg
- sudo mkfs.xfs /dev/xvdh
- Mount each disk
- sudo mount /dev/xvdg /opt/fedora-data
- sudo mount /dev/xvdh /opt/sufia-project/releases/XXXX/tmp
- Edit the fstab file to retain these mounts
- sudo vi /etc/fstab
/dev/xvdg /opt/fedora-data xfs defaults 0 0
- /dev/xvdh /opt/sufia-project/releases/XXXX/tmp xfs defaults 0 0
- sudo vi /etc/fstab
Postgres
- Remove the old version of postgres:
- sudo apt-get purge postgresql*
- Create the file /etc/apt/sources.list.d/pgdg.list
- Add the lineĀ deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main to that
- Add the repo key with this command
- wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
- sudo apt-get update
- sudo apt-get install postgresql-9.5
- Log in as postgres and enter psql
- sudo su postgres
- psql
- In Postgres create the chf_hydra and fcrepo databases
- CREATE DATABASE chf_hydra;
- CREATE DATABASE fcrepo;
- In Postgres create the needed users
- CREATE USER chf_pg_hydra WITH PASSWORD 'SEE ANSIBLE GROUPVARS/ALL';
- CREATE USER trilby WITH PASSWORD 'porkpie2';
- Grant each user access to their table
- GRANT Create,Connect,Temporary ON DATABASE chf_hydra TO chf_pg_hydra;
- GRANT All Privileges ON DATABASE fcrepo TO trilby;
- Set the user password for postgres
- \password postgres
- Enter password from groupvars/all
- sudo nano /etc/postgresql/9.5/main/pg_hba.conf
- Change the sections under "Database administrative login by Unix domain socket"
- peer should be set to md5 for
- local all postgres
- local all all
- host all all
- peer should be set to md5 for
- Restart postgres, try to log in with
- psql -U postgres
- If it lets you use the password, it works!
...