1

Ok, this is a two-part question.

I got an unmanaged VPS with CentOS from a hosting company in order to install several Atlassian tools, however, I ran into the problem that when starting a second application, the first one begins to crash.

So far I have installed Confluence (running on port 8090), JIRA (running on 8080) and Crowd (some other port I cannot remember), but I can only run one at a time. I tried setting up a reverse proxy but this does not seem to work.

While doing some research I found that apparently this is not possible: https://confluence.atlassian.com/display/JIRA/Deploying+Multiple+Atlassian+Applications+in+a+Single+Tomcat+Container https://confluence.atlassian.com/display/DOC/Installing+Confluence+and+JIRA+Together

I find this weird, since I thought each Atlassian app came with it's own Tomcat... so I'm wondering if I just need to find a way to "use different Tomcat containers", but I am stupid and I don't even know what that means (yes, I used teh googles, and they do nothing).

So, part #1: am I missing something?, or there is just no way of doing this in an accepted way

I think I found a solution though, linux containers:

http://blogs.atlassian.com/2013/06/deploy-java-apps-with-docker-awesome/ http://blogs.atlassian.com/2015/01/stash-docker/ http://blogs.atlassian.com/2013/11/docker-all-the-things-at-atlassian-automation-and-wiring/

Since they seem to isolate the running envirnoment and even enable you to setup network routing between the container and your OS.

So, part #2: are linux containers / docker the accepted solution to my problems?

I honestly don't feel like renting several servers...

  • What kinds of errors did you have when trying to start up a second service? While it might not be a supported config, I've seen at least JIRA+Crowd+Fisheye running together on one server successfully. – Shane Madden Apr 17 '15 at 6:28
1

I ran into the problem that when starting a second application, the first one begins to crash.

You did not mention any system specifications of your VPS. For me this sounds like you're running out of memory. Do you mean that when the application crashes, the JVM is not shown in the process list anymore? You should check the output of dmesg to see if the JVM was killed by OOM killer.

I find this weird, since I thought each Atlassian app came with it's own Tomcat... so I'm wondering if I just need to find a way to "use different Tomcat containers",

All Atlassian applications are bundled with a Tomcat. You can download the applications in WAR packages as well. You can deploy these packages into your own application servers, if you want to, but that's another story.

Putting all applications into one Tomcat container is not wise. From your description I deduce that you are not familiar with running multiple applications in one Tomcat instance. Therefore:

  • The applications you mention (Confluence, JIRA, Crowd) have different memory requirements, especially when you install plugins into them. You'll run into OOM errors very easily.
  • Upgrading the applications is much easier when all applications are running in their own Tomcat instances. From a security perspective this is very important.
  • If you want to migrate one application to another server, you can just copy the whole Tomcat instance as-is with the application. Only minor configuration changes are required.

A very brief workflow for installing such environment:

  • Create separate users for all applications.
  • Download applications (the Tomcat bundle version) and extract them.
  • Configure server.xml so that the applications are running in different ports. This is crucial. Otherwise only one application can reserve a TCP port for the Tomcat HTTP/AJP connector. Use a unique port per application.
  • Create virtual hosts for all applications.
  • Start the applications per application user.

So, part #2: are linux containers / docker the accepted solution to my problems?

It's one solution. You should consider your setup. If your current setup allows you to run all applications in their own Tomcat instances, what are the benefits of running them in separate Linux containers? It is very easy to over-engineer your setup with Docker. Also, if Docker is not something you're familiar with, you'll have to learn how to use it.

  • Yep, this was what happened... not enough memory in the server, each application uses roughly ~1GB RAM – dukeofgaming May 8 '15 at 4:32
1

This is certainly possible, but you'll use three different Tomcat containers.

Each product can be run standalone. IIRC, something like this

/.../crowd/bin/start_crowd.sh
/.../jira/bin/start-jira.sh
/.../confluence/bin/start-confluence.sh

And you'll want, say, Apache httpd operating as a reverse-proxy. So /crowd points to your crowd port, /jira points to your jira port, and /confluence points to your confluence port.

Those paths will be wrong, but hopefully you get the idea (with /.../ being whereever you unpacked the product).

You could have them use the same or different JAVA_HOMEs too, which can be useful if the person/team responsible for running the application is different to the person/team managing the OS.

I have a suitable startup script for starting the whole stack (Crowd, Jira and then Confluence in that order, and testing that one is ready before starting the next one). Its written for RHEL 5. Call out if you need it; it saves time during patching.

  • How can I tell they are in different Tomcat containers?, how can I force them to be in different Tomcat containers?, how do I know if they are in a single one? – dukeofgaming Apr 17 '15 at 13:49
  • Each container will have one java process (with lots of child threads). You can easily see this with pstree or similar – Cameron Kerr Apr 17 '15 at 14:35
1

At the moment I'm using apache as reverse proxy and 5 jira instances.

<VirtualHost *:80>
    ServerName jira1.example.net

    ProxyTimeout 300
    ProxyRequests Off
    ProxyPreserveHost On

    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    ProxyPass / http://127.0.0.1:8080/
    ProxyPassReverse / http://127.0.0.1:8080/

    <Location />
        Order allow,deny
        Allow from all
    </Location>
</VirtualHost>

<VirtualHost *:80>
    ServerName jira2.example.net

    ProxyTimeout 300
    ProxyRequests Off
    ProxyPreserveHost On

    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    ProxyPass / http://127.0.0.1:8181/
    ProxyPassReverse / http://127.0.0.1:8181/

    <Location />
        Order allow,deny
        Allow from all
    </Location>
</VirtualHost>

All you need is to bind each jira/confl/crowd instance to unique port. For each jira instance you should edit atlassian/jira/conf/server.xml

<Service name="Catalina">
   <Connector port="8080"
      maxThreads="150"
      minSpareThreads="25"
      connectionTimeout="20000"

      address="127.0.0.1"
      proxyName="jira1.example.net"
      proxyPort="80"
      scheme="http"

      enableLookups="false"
      maxHttpHeaderSize="8192"
      protocol="HTTP/1.1"
      useBodyEncodingForURI="true"
      redirectPort="8443"
      acceptCount="100"
      disableUploadTimeout="true"/>


<Service name="Catalina">
   <Connector port="8181"
      maxThreads="150"
      minSpareThreads="25"
      connectionTimeout="20000"

      address="127.0.0.1"
      proxyName="jira2.example.net"
      proxyPort="80"
      scheme="http"

      enableLookups="false"
      maxHttpHeaderSize="8192"
      protocol="HTTP/1.1"
      useBodyEncodingForURI="true"
      redirectPort="8443"
      acceptCount="100"
      disableUploadTimeout="true"/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.