...
The current build scripts in Ansible have problems with a few changes we need. They can be done in this order, or other orders if needed. Postgres must ALWAYS be done before the Fedora 4.7 configuration.
- Creating drives
- Migration from Postgresql 9.3 to 9.5
- Moving to Fedora 4.7Restart Solr
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
...
Solr
- 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!
Fedora
- Stop Tomcat
- sudo service tomcat7 stop
- Replace the current /etc/default/tomcat7 with
# A backup of the original file with addition options is at /etc/default/tomcat7.bak
TOMCAT7_USER=tomcat7
TOMCAT7_GROUP=tomcat7
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
#Postgres
JAVA_OPTS="-Dfcrepo.home=/opt/fedora-data -Dfcrepo.modeshape.configuration=classpath:/config/jdbc-postgresql/repository.json -Dfcrepo.postgresql.username=trilby -Dfcrepo.postgresql.password=porkpie2 -Dfcrepo.postgresql.host=localhost -Dfcrepo.postgresql.port=5432 -Djava.awt.headless=true -XX:+UseG1GC -XX:+UseCompressedOops -XX:-UseLargePagesIndividualAllocation -XX:MaxPermSize=128M -Xms512m -Xmx4096m -Djava.util.logging.config.file=/etc/tomcat7/logging.properties -server"
...
- If this is the first time sufia has been deployed, Solr now runs outside of tomcat and needs to be restarted after deployment.
- sudo service solr restart
Fedora export
In sufia 6 instance:
...