Can you help me get Jira installed on Amazon EC2 Ubuntu?

Nick Skitch May 26, 2013

I've signed up for an Amazon micro-instance and I'm trying to host Jira on one of their Ubuntu AMI's. Jira's process seems to be running and I see in the catalina.out log that it starts up all the way. ?? scratching my head.

As soon as I launch the application in the browser I see in my terminal ps -ef that the Jira process exits from memory, .. but there is no mention of it in the logs.

-I've turned the logging feature to 'fine'.

-I've upped the timeout on the plugins

-I even replaced Java with Sun's version.

The next time I start it up I see in the browser:

Unable to create and acquire lock file for jira.home directory '/home/ubuntu/atlassian/application-data/jira'.

and in my terminal:

drwxrwxr-x 12 ubuntu ubuntu 4096 May 26 21:20 ./
drwxrwxr-x  3 ubuntu ubuntu 4096 May 26 22:13 ../
drwxrwxr-x  3 ubuntu ubuntu 4096 May 26 21:32 caches/
drwxrwxr-x  3 ubuntu ubuntu 4096 May 26 07:02 data/
drwxrwxr-x  2 ubuntu ubuntu 4096 May 26 21:38 database/
-rw-rw-r--  1 ubuntu ubuntu  903 May 26 07:14 dbconfig.xml
drwxrwxr-x  3 ubuntu ubuntu 4096 May 26 21:44 export/
drwxrwxr-x  4 ubuntu ubuntu 4096 May 26 07:02 import/
-rw-r--r--  1 root root      0 May 26 21:38 .jira-home.lock
drwxrwxr-x  2 ubuntu ubuntu 4096 May 26 09:24 log/
drwxrwxr-x  2 ubuntu ubuntu 4096 May 26 09:29 logos/
drwxrwxr-x  2 ubuntu ubuntu 4096 May 26 07:16 monitor/
drwxrwxr-x  5 ubuntu ubuntu 4096 May 26 21:20 plugins/
drwxrwxr-x  3 ubuntu ubuntu 4096 May 26 07:02 tmp/
ubuntu@ip-172-31-15-40:~/atlassian/application-data/jira$

Here's a tail of my catalina.out just before the process exited memory:

May 26, 2013 9:44:27 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
May 26, 2013 9:44:29 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 377321 ms
2013-05-26 21:44:37,441 QuartzScheduler_Worker-3 INFO ServiceRunner    Backup Service [jira.bc.dataimport.DefaultExportService] Data export completed in 1555ms. Wrote 786 entities to export in memory.
2013-05-26 21:44:37,455 QuartzScheduler_Worker-3 INFO ServiceRunner    Backup Service [jira.bc.dataimport.DefaultExportService] Attempting to save the Active Objects Backup
2013-05-26 21:44:37,919 QuartzScheduler_Worker-3 INFO ServiceRunner    Backup Service [jira.bc.dataimport.DefaultExportService] Finished saving the Active Objects Backup

It's a permissions issue right?... but what do I need to do?

2 answers

0 votes
Timothy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 26, 2013

It looks like it is a permission issue from the OS. Did you set jira.home to a folder where the user starting JIRA can r+w+x?

Nick Skitch May 26, 2013

I believe so, but maybe someone could confirm:

jira.home = /home/ubuntu/atlassian/application-data/jira is set in the file: ~/atlassian/jira/atlassian-jira/WEB-INF/classes/jira-application.properties
Here is a directory listing:
My ownly concern is that I see this file market as root.

-rw-r--r-- 1 root root 0 May 26 21:38 .jira-home.lock
drwxrwxr-x 12 ubuntu ubuntu 4096 May 26 21:20 ./
drwxrwxr-x 3 ubuntu ubuntu 4096 May 26 22:13 ../
drwxrwxr-x 3 ubuntu ubuntu 4096 May 26 21:32 caches/
drwxrwxr-x 3 ubuntu ubuntu 4096 May 26 07:02 data/
drwxrwxr-x 2 ubuntu ubuntu 4096 May 26 21:38 database/
-rw-rw-r-- 1 ubuntu ubuntu 903 May 26 07:14 dbconfig.xml
drwxrwxr-x 3 ubuntu ubuntu 4096 May 26 21:44 export/
drwxrwxr-x 4 ubuntu ubuntu 4096 May 26 07:02 import/
drwxrwxr-x 2 ubuntu ubuntu 4096 May 26 09:24 log/
drwxrwxr-x 2 ubuntu ubuntu 4096 May 26 09:29 logos/
drwxrwxr-x 2 ubuntu ubuntu 4096 May 26 07:16 monitor/
drwxrwxr-x 5 ubuntu ubuntu 4096 May 26 21:20 plugins/
drwxrwxr-x 3 ubuntu ubuntu 4096 May 26 07:02 tmp/
However, when the process runs it's run as ubuntu:
ubuntu 4461 1 0 May26 ? 00:01:06 /home/ubuntu/atlassian/jira/jre/.. (etc)
Harry Chan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 26, 2013

This would suggest you're possibly NOT running the application as the user ubuntu but as root.

Nick Skitch May 26, 2013

I'm logged into the terminal as ubuntu. I launch jira like this:

ubuntu@ip-172-31-15-40:~/atlassian/jira/bin/startup.sh

doing a ps-ef shows ubuntu on the process:

ubuntu 5162 1 7 05:02 pts/1 00:00:50 /home/ubuntu/atlassian/jira/jre/

So I'm not sure what else I need to do to ensure it's run as ubuntu. I did remove openJDK on the machine and installed Sun's jdk7. not sure if that has anything to do with it.

Mizan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 26, 2013

@Nick , openJDK is not supported by JIRA you will need sun jdk . set JAVA_HOME to the sun jdk .

Nick Skitch May 26, 2013

I see that Jira has a jre included, so I think that's what it's using:

ubuntu@ip-172-31-15-40:~/atlassian/jira/jre/bin$ ./java -version

java version "1.7.0_13"

Java(TM) SE Runtime Environment (build 1.7.0_13-b20)

Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

0 votes
Harry Chan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 26, 2013

Do you have any logs in JIRA home directory? That should give more detailed information. Having said that, EC2 micro is not the way to go. Too little memory and CPU can be too slow for this purpose.

Is JIRA running as root or ubuntu?

Nick Skitch May 26, 2013

I did remove openJDK on the machine and installed Sun's jdk7. not sure if that has anything to do with it.

Nick Skitch May 26, 2013

Jira is running from as ubuntu when I do a 'ps'. (original post has it pasted)

Here's an error in the jira log: ~/atlassian/application-data/jira/log/atlassian-jira.log

2013-05-27 05:02:34,961 localhost-startStop-1 ERROR [NoModule] Error getting datasource via DBCP: JdbcDatasourceInfo{uri='jdbc:hsqldb:/home/ubuntu/atlassian/application-data/jira/database/jiradb', driverClassName='org.hsqldb.jdbcDriver', username='sa', password='********', isolationLevel='null', connectionProperties=null, connectionPoolInfo=ConnectionPoolInfo{maxSize=20, minSize=20, initialSize=null, maxIdle=20, maxWait=30000, sleepTime=300000, lifeTime=600000, deadLockMaxWait=600000, deadLockRetryWait=10000, validationQuery=null, minEvictableTimeMillis=4000, timeBetweenEvictionRunsMillis=5000, poolPreparedStatements=null, testOnBorrow=null, testOnReturn=null, testWhileIdle=null, maxOpenPreparedStatements=null, numTestsPerEvictionRun=null, removeAbandonedTimeout=300, validationQueryTimeout=null, defaultCatalog=null}}

org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (The database is already in use by another process: org.hsqldb.persist.NIOLockFile@a1c8b294[file =/home/ubuntu/atlassian/application-data/jira/database/jiradb.lck, exists=true, locked=false, valid=false, fl =null]: java.io.FileNotFoundException: /home/ubuntu/atlassian/application-data/jira/database/jiradb.lck (Permission denied))

Nick Skitch May 26, 2013

now i"m noticing that everything the jira process touches in owned by root, not ubuntu. What's going on? why is the process running as root?.. I'm starting it under the ubuntu user.

Harry Chan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 26, 2013

Are you sure you are using your own Java 7? The path you provided looks like the path Atlassian put their bundled JRE in.

Having said that, it looks like multiple JIRA instances are running or something and it's locked up? Confirm it's the only process running.

Nick Skitch May 26, 2013

OK, you're right, I see it's using the bundled JRE and not the one I installed, which is fine by me.. I just want to get it working.

I did a ps -ef | grep jira, and I killed the process. I don't see anything else running. any other ideas?

Harry Chan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 26, 2013

The error is that the actual database file is locked by another process. Does anything have that file opened? Do you have it opened for editing somewhere? Something's locking it is the problem.

Suggest an answer

Log in or Sign up to answer