H2 database configuration confusion

22 views
Skip to first unread message

Charity Goeckeritz

unread,
Jul 29, 2021, 3:11:36 PM7/29/21
to apollo

Hi there,

My name is Charity and I am trying to set up Apollo for the first time on ubuntu 20.04. I successfully installed apache-tomcat 8.5.69 and can start it up no problem.

When I got to your database configuration instructions for apollo though, I got really confused. (Apologies, I've not done a software installation like this before!) And I think I may have dug myself in a bit of a hole, because I went on to run ./apollo deploy before properly configuring the h2 database. It seemed to work and created a .war file...

First things first, can you help with the h2 database configuration?

  1. Where is the prodDb? Do I need to create it? I'm not even sure what to set it to in the apollo-config.groovy file, and I can only find the devDb databases in my apollo installation directory.

  2. I'm confused by the next step as well... when I do chown -u tomcat:tomcat /any/directory/ , it says the -u flag isn't an option. Am I supposed to replace -u with my literal username?

And finally -- should I delete that first .war file before rerunning ./apollo deploy after my h2 database is properly configured?

Thanks so much for your help on this - I'm extremely new to all of this. I didn't even know what the hell a servlet container was a couple days ago...

Kindly,
Charity

Nathan Dunn

unread,
Jul 29, 2021, 9:20:47 PM7/29/21
to Charity Goeckeritz, apollo

On Jul 29, 2021, at 12:11 PM, Charity Goeckeritz <charityz...@gmail.com> wrote:


Hi there,

My name is Charity and I am trying to set up Apollo for the first time on ubuntu 20.04. I successfully installed apache-tomcat 8.5.69 and can start it up no problem.

When I got to your database configuration instructions for apollo though, I got really confused. (Apologies, I've not done a software installation like this before!) And I think I may have dug myself in a bit of a hole, because I went on to run ./apollo deploy before properly configuring the h2 database. It seemed to work and created a .war file...

First things first, can you help with the h2 database configuration?

  1. Where is the prodDb? Do I need to create it? I'm not even sure what to set it to in the apollo-config.groovy file, and I can only find the devDb databases in my apollo installation directory.


It is specified here (https://github.com/GMOD/Apollo/blob/develop/grails-app/conf/DataSource.groovy#L57) it is isn’t there by default. 

If you use the dev mode it puts it in the file system here: https://github.com/GMOD/Apollo/blob/develop/grails-app/conf/DataSource.groovy#L32   -. AnnotationDatabase.prod (or something like this). 

If you are only supporting a single user or two YOU CAN PROBABLY STOP HERE! (but make sure to backup all of the AnnotationDatabase.prod.* files).

So, I would copy over the sample-h2-apollo-config.groovy to apollo-config.groovy:


It specified a directory https://github.com/GMOD/Apollo/blob/develop/sample-h2-apollo-config.groovy#L39 /opt/apollo/h2/prodDB.db which may not be accurate for you. 

If you are using something like tomcat, you’ll need to fix permissions, etc.


  1. I'm confused by the next step as well... when I do chown -u tomcat:tomcat /any/directory/ , it says the -u flag isn't an option. Am I supposed to replace -u with my literal username?


Oh weird.  Must be an error I the doc.  

Maybe just chown tomcat:tomcat:/any/directory

Whatever those relevant permissions are.  You could probably do:

chmod -R 777 /any/directory 

And finally -- should I delete that first .war file before rerunning ./apollo deploy after my h2 database is properly configured?


The first war and the directory it expanded into, yes.

Thanks so much for your help on this - I'm extremely new to all of this. I didn't even know what the hell a servlet container was a couple days ago...

Kindly,
Charity


Keep on keeping on.

Good luck! 

Nathan


--
To unsubscribe from this group and stop receiving emails from it, send an email to apollo+un...@lbl.gov.

Charity Goeckeritz

unread,
Aug 16, 2021, 2:13:07 PM8/16/21
to apollo, ndu...@gmail.com, apollo, Charity Goeckeritz
Hi Nathan, 

Thanks so much for the explanations and the encouragement. I seem to get the build to run successfully when doing ./apollo run-local, so I was hoping to do my manual annotations just locally. I made sure I added a concrete file (.db) for running in development mode to the apollo-config.groovy file then fired it up (note, I could only get a successful build when I deleted the /jbrowse directory in the main /apollo folder. I'd get a 'can't copy JBrowse directory to the webapps folder' sorta error during the build if I didn't do so).

Anyway, I uploaded my new organism and was ready to go -- but I couldn't get any .bam files to load. I'd press +New Track and fill out the info, click upload and then... nothing would happen. Is it just taking forever to load the tracks?

Any help / advice is much appreciated -- thanks so much!
Kindly, 
Charity 

Nathan Dunn

unread,
Aug 16, 2021, 3:08:38 PM8/16/21
to Charity Goeckeritz, apollo

On Aug 16, 2021, at 11:13 AM, Charity Goeckeritz <charityz...@gmail.com> wrote:

Hi Nathan, 

Thanks so much for the explanations and the encouragement. I seem to get the build to run successfully when doing ./apollo run-local, so I was hoping to do my manual annotations just locally. I made sure I added a concrete file (.db) for running in development mode to the apollo-config.groovy file then fired it up (note, I could only get a successful build when I deleted the /jbrowse directory in the main /apollo folder. I'd get a 'can't copy JBrowse directory to the webapps folder' sorta error during the build if I didn't do so).

Anyway, I uploaded my new organism and was ready to go -- but I couldn't get any .bam files to load. I'd press +New Track and fill out the info, click upload and then... nothing would happen. Is it just taking forever to load the tracks?

It's hard to say.  Would have to look at the client and server-side logs to see what is going on for sure. 

I might try just configuring it manually via trackList.json like a normal JBrowse if its otherwise not working. 

Nathan

Charity Goeckeritz

unread,
Aug 16, 2021, 4:04:39 PM8/16/21
to apollo, ndu...@gmail.com, apollo, Charity Goeckeritz
Hi Nathan, 

I see... maybe a silly question but... where do I find such logs? I also installed tomcat and I can find the .war file when running apollo in production mode (./apollo deploy)... I experience the same track loading issues in production mode as well. 

I search my unpacked .war file for such a trackList.json file and nothing comes up: find . -name trackList.json

Is this normal? There's also no data/ or sample_data/ folder in my unpacked .war file's jbrowse/ directory... 

Appreciate you helping me sort this out!

Kindly, 
Charity 

Charity Goeckeritz

unread,
Aug 16, 2021, 4:23:14 PM8/16/21
to apollo, Charity Goeckeritz, ndu...@gmail.com, apollo
PS - I found a trackList.json file in ~/apache-tomcat-8.5.9/bin/apollo_data/1-Name/ 

Is this the one I need to try and manually edit?

Kindly, 
Charity 

Garrett Stevens

unread,
Aug 16, 2021, 10:13:23 PM8/16/21
to Charity Goeckeritz, apollo
You might be able to see some errors in your web browser by opening the developer tools (right-click -> Inspect and then go to the "Console" tab). The server logs are in "catalina.out" in your Tomcat directory.

If you go to the "Organism" tab in Apollo and click on your organism, you should be able to see its directory in its details. The trackList.json should be in there.

Hope this is helpful,
Garrett

Nathan Dunn

unread,
Aug 16, 2021, 10:35:46 PM8/16/21
to Garrett Stevens, Charity Goeckeritz, apollo

You might also try setting up your BAM track using a regular JBrowse track:


And adding an organism by adding the directory instead of uploading.   You could even start by copying the directory that Garret pointed out. 

Nathan

Charity Goeckeritz

unread,
Aug 24, 2021, 4:25:06 PM8/24/21
to apollo, ndu...@gmail.com, Charity Goeckeritz, apollo, stevens....@gmail.com
Hi Nathan and Garret,

Thanks for the pointers. I was able to add tracks manually, although I'm having a little bit of an issue visualizing some of the data that I think is a memory issue. If it gets unbearable I'll reexamine the memory-changing instructions for tomcat, but for now I seem to have found a workaround. 

Thanks for all your help! 
Kindly, 
Charity 

Nathan Dunn

unread,
Aug 24, 2021, 4:37:06 PM8/24/21
to Charity Goeckeritz, apollo, stevens....@gmail.com

Glad you got it working.

Low memory will just make it slow or outright crash it.   Running an HTML BAM instead of a Canvas BAM is usually the issue.  

I think you’ll be okay for running for just yourself if you have 512 MB or more. 

ps -ef | grep java

Nathan
Reply all
Reply to author
Forward
0 new messages