Skip to content

Instantly share code, notes, and snippets.

@bellerbrock
Last active October 21, 2019 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bellerbrock/03b49767b2e2b50352c07109f723b80e to your computer and use it in GitHub Desktop.
Save bellerbrock/03b49767b2e2b50352c07109f723b80e to your computer and use it in GitHub Desktop.
1. Download the latest schemaspy release from https://github.com/schemaspy/schemaspy
2. Check your java installation, and if not installed already install the required version of java. In this case java 8
To check:
java -version
update-alternatives --list java
To install: (from https://www.vultr.com/docs/how-to-manually-install-java-8-on-ubuntu-16-04)
wget http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-i586.tar.gz
sudo mkdir /usr/lib/jvm
cd /usr/lib/jvm
sudo tar -xvzf ~/Downloads/jdk-8u151-linux-x64.tar.gz
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_151/bin/java" 0
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_151/bin/javac" 0
sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0_151/bin/java
sudo update-alternatives --set javac /usr/lib/jvm/jdk1.8.0_151/bin/javac
# verify
java -version
# If you get `bash: /usr/bin/java: No such file or directory` error may also have to run
apt-get install libc6-i386
3. Download postgres database driver from https://jdbc.postgresql.org/download.html
wget https://jdbc.postgresql.org/download/postgresql-42.2.6.jar
4. Make schemaspy.jar file executable and make output dir
chmod 755 schemaspy.jar
mkdir schemaspy
5. Run schemaspy. If anything goes wrong add -debug flag to see details and troubleshoot
java -jar schemaspy-6.0.0.jar -t pgsql -dp Downloads/postgresql-42.2.6.jar -db cxgn_batatabase -host localhost -u postgres -p postgres -o schemaspy -schemas public,sgn_people,metadata,phenome,sgn -i "(nd_experimentprop|cvtermpath|nd_experiment_stock|nd_experiment_phenotype|phenotype|nd_experiment|nd_experiment_project|stockprop|stock_relationship|stock|dbxref|organism|organism_dbxref|phylonode|phylonode_organism|cvtermsynonym|cvterm_relationship|cvterm_dbxref|organismprop|cvterm|projectprop|cvtermprop|project_relationship|project|genotype|genotypeprop|nd_geolocationprop|db|matviews|nd_geolocation|cv|cvprop|list_item|list|sp_person_roles|sp_person|sp_roles|sp_dataset|forum_topic|forum_post|sp_organisms|md_metadata|md_files|md_dbversion|md_json|md_image|md_image_cvterm|md_tag|md_tag_image|nd_experiment_md_files|stock_owner|nd_experiment_md_json|stock_image|marker|marker_alias|common_name|experiment_type|marker_confidence)"
# Fix for error Caused by: java.lang.UnsatisfiedLinkError: /usr/lib/jvm/jdk1.8.0_221/jre/lib/i386/libfontmanager.so: libgcc_s.so.1: cannot open shared object file: No such file or directory
apt-get install gcc-multilib
6. Copy results to be served from jbrowse test
sudo scp -r /schemaspy production@jbrowse-test.sgn.cornell.edu:/var/www/schemaspy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment