Add new Specify instance to Specify Cloud
Example for
Create Database
Review the SQL file before importing to the production server. Test the import locally before uploading to a production instance.
Ensure the new database has the same name as the subdomain the user wishes to use, remembering that underscores (
_
) are replaced with dashes (-
) for the URL.Create the database:
mariadb -u<master> -p<master_password> -e "CREATE DATABASE <dbname>;"
Upload and restore the existing database:
mariadb -u<master> -p<master_password> <dbname> < <dbname>.sql
Note: You may
GRANT ALL PRIVILEGES ON <dbname>.* TO <master_password>@'%';
if master doesn’t have accessFLUSH PRIVILEGES;
DNS Registration:
Login to Dreamhost, select Websites -> Manage Websites
For
specifycloud.org
, select DNS (Direct link)Add CNAME record that has a name matching the database name and links to the appropraite regional domain value (i.e.
na-specify7-1.specifycloud.org.
,eu-specify7-1.specifycloud.org.
, etc.). If the database name has underscores (_), replace these with dashes (-).<dbname>
points to<subdomain>.specifycloud.org.
For example, database nameherb_rbge
would have the nameherb-rbge.specifycloud.org
.
Wait at least 10 minutes for domain to circulate.
For the ku servers, request the dns CNAME record to bitech@ku.edu
Config
Add to
spcloudservers.json
on the appropriate server in the/home/ubuntu/docker-compositions/specifycloud
dir.Make sure to add https: false
Run
make
asubuntu
Run
docker compose up -d
Run
docker compose restart nginx
(reload should be just fine here:docker exec -it specifycloud_nginx_1 nginx -s reload
)Check url
Add SSL
Run the
add_ssl.sh
script and follow the prompts.sudo bash add_ssl.sh
You will need to provide the
<subdomain>
for the new instance that you wish to add. After this, it will update thespcloudservers.json
and set"https": false
to"https": true
for that instance, then restart all of the running containers.Check URL
Note: After an SSL certificate renewal, you can reload nginx without restarting the whole container:
docker exec -it specifycloud-nginx-1 nginx -s reload
For automatic nginx reloading on certificate renewal create /etc/letsencrypt/renewal-hooks/post/reload-nginx.sh
#!/bin/bash docker exec -it specifycloud-nginx-1 nginx -s reload
crontab -e;
and then add the line0 3 * * 0,2,4,6 docker exec specifycloud_nginx_1 nginx -s reload
crontab -l
to list cronjobs
Add Specify Admin user credentials to the Bitwarden Vault
Setup attachments for the database
SSH into the appropriate Web Asset Server
Navigate to the
web-asset-server
directoryUse the
manage_collection_dirs.py
utility to add the new database(s) to the server:python3 manage_collection_dirs.py add <database_name>
This creates a new attachment directory and updates the
settings.py
file to add the collection directory.
Updown
Add url:
<subdomain>.specifycloud.org/context/system_info.json
Add alias:
<subdomain>
Misc
Add ssh key:
nano .ssh/authorized_keys
sudo systemctl reload sshd
Troubleshooting
Handle mariadb failing to restart after restarting the Database droplet:
mysqld --tc-heuristic-recover=ROLLBACK
systemctl start mariadb.service
Fix an instance by restarting it:
sudo docker exec -it specifycloud-nginx-1 nginx -s reload;
sudo docker stop client client-worker;
sudo docker compose up -d;
sudo docker exec -it specifycloud-nginx-1 nginx -s reload;