Has anyone installed Jira and Confluence in the same postgres database but with different schemas?
Asked by Steve Parker:

I have been tasked to install JIRA and Confluence into the same postgres database but into different schemas.

Has anyone had success in doing this? I am struggling to get it to work.

Thanks!

Nic: For some reason the system won't let me add a comment, so I'm going to try to edit the original post with my info:

=====

Hi Nic. I install postgres and JIRA with no problem. But once i install Confluence, I start to use Confluence a little and then get this "Oops" error:

java.lang.RuntimeException: javax.servlet.ServletException: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getConfluenceResourceTags' in class com.atlassian.confluence.setup.velocity.VelocityFriendlyPageBuilderService threw exception com.atlassian.activeobjects.internal.ActiveObjectsInitException: bundle \[com.atlassian.plugins.base-hipchat-integration-plugin-api\] at /decorators/includes/header.vm\[line 84, column 20\]  
at com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator.render(BaseWebAppDecorator.java:37)

caused by: javax.servlet.ServletException: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getConfluenceResourceTags' in class com.atlassian.confluence.setup.velocity.VelocityFriendlyPageBuilderService threw exception com.atlassian.activeobjects.internal.ActiveObjectsInitException: bundle \[com.atlassian.plugins.base-hipchat-integration-plugin-api\] at /decorators/includes/header.vm\[line 84, column 20\]  
at com.atlassian.confluence.util.profiling.ConfluenceSitemeshDecorator$ErrorSendingErrorHandlingStrategy.handleException(ConfluenceSitemeshDecorator.java:249)

caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getConfluenceResourceTags' in class com.atlassian.confluence.setup.velocity.VelocityFriendlyPageBuilderService threw exception com.atlassian.activeobjects.internal.ActiveObjectsInitException: bundle \[com.atlassian.plugins.base-hipchat-integration-plugin-api\] at /decorators/includes/header.vm\[line 84, column 20\]  
at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:337)

caused by: com.atlassian.activeobjects.internal.ActiveObjectsInitException: bundle \[com.atlassian.plugins.base-hipchat-integration-plugin-api\]  
at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects$1$1$1.call(TenantAwareActiveObjects.java:105)

caused by: java.lang.RuntimeException: Could not read fields for table AO_5FB9D7_AOHIP_CHAT_LINK  
at [net.java.ao](http://net.java.ao/).schema.helper.DatabaseMetaDataReaderImpl.getFields(DatabaseMetaDataReaderImpl.java:149)

caused by: org.postgresql.util.PSQLException: ERROR: relation "AO_5FB9D7_AOHIP_CHAT_LINK" does not exist Position: 15  
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2182)

-----------------------------------------

Here are the steps I am using to perform the install on a virtual machine running on Virtual Box (with NAT)

Sorry, some of the numbering got screwed up, but the order is the same.

Steps to install Postgres and Jira

1. Chose Centos 6.7 and Basic Server in Virtual Box
   1. Modify ifcfg-eth0 ONBOOT=yes
   2. service iptables stop
   3. chkconfig iptables off
   4. service network restart
   5. add proxy=[http://gatekeeper.mitre.org:80](http://gatekeeper.mitre.org/) to /etc/yum.conf
   6. yum clean all;yum update
2. reboot
3. Following <https://wiki.postgresql.org/wiki/YUM_Installation> instructions
4. Add exclude=postgresql\* to /etc/yum/pluginconf.d/rhnplugin.conf
5. For Centos: On CentOS: /etc/yum.repos.d/CentOS-Base.repo, \[base\] and \[updates\] sections
6. Install PGDM RPM file sudo yum localinstall <http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm>
   1.
      1. For Centos: <http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-2.noarch.rpm>
7. Change https to http in /etc/yum.repos.d/pgdg-94-centos.repo
8. Confirm install available: sudo yum list postgres\*
9. Install postgresql: sudo yum install postgresql94-server
10. Initialize database: sudo service postgresql-9.4 initdb
11. Set startup: sudo chkconfig postgresql-9.4 on
12. Start service: sudo service postgresql-9.4 start
13. Switch to postgres user : sudo su -- postgres
14. Launch psql
15. Create user : CREATE ROLE jiradbuser WITH LOGIN;
16. Connect to jiradb : \\c jiradb
17. Create schema: CREATE SCHEMA jiraschema;
18. Change ownership of schema to jiradbuser: ALTER SCHEMA jiraschema OWNER TO jiradbuser;
19. Create database: CREATE DATABASE jiradb WITH ENCODING 'UNICODE';
20. Grant user rights to database: GRANT ALL ON DATABASE jiradb TO jiradbuser;
21. Set user's password: ALTER USER jiradbuser WITH PASSWORD '\<password\>';
22. Change the postgres authentication method. Edit /var/lib/pgsql/9.4/data/pg_hba.conf change to:

# "local" is for Unix domain socket connections only

local all all password

# IPv4 local connections:

host all all 127.0.0.1/32 password

# IPv6 local connections:

host all all ::1/128 password

1. Restart the postgres service: service postgresql-9.4 restart
2. Download the Jira installer and sftp it to the home folder on the postgres server
3. Make the file executable: chmod a+x atlassian-jira-software-7.0.0-jira-7.0.0-x64.bin
4. Launch the installer: ./atlassian-jira-software-7.0.0-jira-7.0.0-x64.bin
5. User default install settings and install as service
6. Stop iptables: service iptables stop
7. Navigate to the Jira config web page from a browser
8. Choose "I'll set it up myself"
9. Choose "My Own Database"

To shutdown jira:

1. service jira stop
2. service postgresql-9.4 stop

To create Confluence schema:

1. On the postgres server, using psql:
   1. \\c jiradb
   2. CREATE SCHEMA confluenceschema;
   3. Change ownership of schema to confluenceuser: ALTER SCHEMA confluenceschema OWNER TO jiradbuser;
   4. Re order search path: SET search_path TO confluenceschema,jiraschema;

To install Confluence

1. Following instructions at: <https://confluence.atlassian.com/doc/installing-confluence-on-linux-143556824.html>
2. Download 64 bit Linux bin installer: <https://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-5.8.14-x64.bin>
3. SFTP file to server
4. Make the file executable: chmod a+x atlassian-confluence-\*
5. Launch the installer: ./atlassian-confluence-5.8.14-x64.bin
6. Custom install
7. Where to be installed: /opt/atlassian/confluence
8. Confluence data location: /var/atlassian/application-data/confluence
9. User default ports: HTTP: 8090, Control: 8000
10. Run as a service: Yes
11. Install completes: Confluence 5.8.14 can be accessed at [http://localhost:8090](http://localhost:8090/)
12. Choose "Production Installation"
13. No add ons. Click Next
14. Use the server ID to generate a license key and enter it.
15. Click next
16. Choose PostgreSQL external database.
17. Choose Direct JDBC database connection
18. Database setup: Driver Class Name org.postgresql.Driver

Database URL jdbc:<postgresql://localhost:5432/jiradb>

User Name jiradbuser

Password \<jiradbuser password\>

1. Load content: Example Site
2. Manage users and groups with JIRA: Connect to JIRA
3. JIRA Server Location: [http://localhost:8080](http://localhost:8080/)
4. JIRA Admin login: enter administrator username and password
5. Advanced options: change jira-users to jira-software-users

Thanks in advance for any help you can give!


Answers:
author: Steve Parker
body: Hi Nic. I tried to add a response yesterday, but the system wouldn't let me. I edited my original question with more information...


author: Nic Brough -Adaptavist-
body: Yup. In fact, there's a postgres on this laptop with at least 4 JIRA databases and 2 Confluences in it (don't ask me about versions...) The two schemas are effectively separate, so JIRA and Confluence don't interfere in any way. In theory.

What problems are you actually having with this?


Tags: confluence-administration

jira-administration