How to Restart Services - QualitativeDataRepository/TechnicalTeam GitHub Wiki
- Before you begin, please make sure you are connected to the QDR VPN.
Dataverse
Connect to the production instance
ssh qdr-prod
Restart the service
sudo service glassfish-dataverse restart
Drupal
Connect to the production instance
ssh qdr-prod
Restart the service
sudo service apache2 restart
IDP
Connect to the production instance
ssh qdr-prod
Restart the service
sudo service jetty restart
AnnoRep Client (option 1 - Jenkins)
- Open AnnoRep-Frontend pipeline
- Click "Build Now" to redeploy (this will stop any running container and restart the service)
AnnoRep Client (option 2 - manually)
Connect to the production instance
ssh qdr-prod
Sudo to annorep
sudo su -
su annorep
List running containers
docker ps
(Optional) stop running image
docker stop $CONTAINER_ID
..where $CONTAINER_ID is obtained from the previous command
List available images
docker image ls | grep annorep
Restart docker container
docker run -d -it --env-file annorep-env -p 3000:3000 "164919093702.dkr.ecr.us-east-1.amazonaws.com/annorep:$TAG"
..where $TAG is obtained from the previous command
Note: In /srv/annorep there is a deploy command and an annorep-env file. The latter contains the URL for the ARServer instance - the machine name and port must match where ARServer is deployed. The script, which runs the docker command above, can be run by:
export DEPLOY_TAG=<8char from commit on desired branch - eea2ac29 from main as of now> ./deploy
AnnoRep Server
cd /opt/annorep
Select the latest jar (0.0.4 in the example) and select a log file name to use (there is no log rotation currently, naming has been per version so far, i.e. jar 0.0.4 -> arlog4.log)
su annorep
java -jar ARServer-0.0.4.jar --server.port=11111 --dataverse.url=https://data.qdr.syr.edu > arlog4.txt &
Building the jar can be done by checking out the Anno-Rep repository develop branch and running
mvn clean install
The jar will be in the ./target subdirectory.
Note: The ARServer requires OpenOffice (just the back-end, no UI). This can be installed following https://linuxhint.com/install-open-office-ubuntu-22-04/.
Make Data Count
Dataverse uses a separate application (Counter-Processor (CP)) to process the ./logs/mdc/* log files to generate MDC statistics and has two scripts run by cronjobs to send/retrieve info from DataCite:
- counter_daily.sh - runs counter-processor over the logs, calls the Dataverse API to update its internal table and sends the same results to DataCite
- counter_weekly.sh - calls Dataverse to initiate a scan of all datasets and calls to DataCite to get any updated citations of the dataset.
CP is in /opt/counter-processor-0.1.04 on all machines with files owned and processing run as the counter user. In addition to python and ~standard extensions, CP requires installation of the peewee and geoip2 packages. The configuration of CP is in files in the ./config dir. No changes should be needed for a restart but CP does need a signed JWT token from DataCite to function - it goes in the ./config/secrets.yaml file. Updates are currently needed yearly - the next will be 5/1/2024.
The scripts use python and curl and currently assume that python is available as python3 and that curl resides at /usr/bin/curl. If these change, the scripts need to be edited. (There are also a couple cronjobs that use curl - one to update the sitemap and an old one that appears to have deleted ldap test users. These need to know the curl path as well).