Expand all | Collapse all

Linking new Jama 8.x with MySQL DB in another docker container

  • 1.  Linking new Jama 8.x with MySQL DB in another docker container

    Posted 10-24-2016 08:53
    Hi All,
    Is there any way to link Jama 8.x docker container with MySQL docker container using link between containers?

  • 2.  Re: Linking new Jama 8.x with MySQL DB in another docker container

    Posted 10-24-2016 14:50
    That depends -- Are you just generally asking if the Jama container can communicate with a MySQL container on the same docker host, or are you asking for something more secure (where only Jama can access the MySQL container, and nothing else can)?

    If the former, then "yes" -- In my test environment, I'm running Jama 8.4.2 on a machine which is also hosting the MySQL 10.0 database in another docker container. I'm not bothering to use container-to-container linking; instead, I've just attached the MySQL container to the same default network that Jama is on ("bridge"), and published/exposed the MySQL port.

    At the moment, I'm fine with the database being visible external to the docker host, since it provides me the flexibility of remotely connecting to it for debugging or custom report development.

    If you're looking for something secure, where the only thing that can connect to the MySQL container is Jama itself, then you're getting more into a murky area.

    I don't think you can use legacy container linking with Jama 8.x (may someone correct me if I'm wrong). Jama 8.x is typically run by the replicated daemon, rather than run manually by "docker run"), so I don't think you'll typically have the option to add a "--link" parameter to link the two containers together.

    In the absence of "--link", some of your options might be:

    1. Identify the IP address of the Jama container, and only permit access to the database container from the IP address of the Jama container (I'm not sure if the Jama container always gets assigned the same IP address on restart/rebuild, so your mileage may vary)

    2. Lock down the database container to only permit acceses from the default docker network on the docker host, since Jama typically gets connected to this default network. (This might permit access to the database from other docker containers running on the host, but could at least prevent access to the database from off-host)
    Docker's modern networking allows for user-defined networks, which you would have further control over, but unless you can force the Jama container to start on a different docker network (not sure if you can), then that option would be out.

  • 3.  Re: Linking new Jama 8.x with MySQL DB in another docker container

    Posted 10-25-2016 09:20
    Thank you Ryan

  • 4.  Re: Linking new Jama 8.x with MySQL DB in another docker container

    Posted 10-26-2016 11:59
    I'll also point out that the Jama installation instructions state that the database should be on a different server than the application server:

    It is required that the application server is dedicated to Jama; no other major applications, such as other web applications or databases, should be running on the Jama application server.
    As well as the database installation page:

    The database must run on a dedicated server.
    While my own experience indicates that it technically works to have both the Jama application (docker image) and database (docker image) running on the same server, these statements imply to me Jama feels that this isn't a good idea for production use. I'm not sure why -- hopefully someone from Jama can clarify why this might be.

  • 5.  Re: Linking new Jama 8.x with MySQL DB in another docker container

    Posted 10-26-2016 19:11
    Hey Ryan,

    Thanks for jumping in on this thread, much appreciated!  :)

    You are correct, we require the database to be run on a separate, dedicated server.  There are a few reasons for this.  The largest reason is that we've seen many cases of resource contention on systems that run the database server and the Jama application server on the same server.  This is the same reason we require jama to have it's own dedicated server and not be shared with another application, like Jira or TFS -- resource contention is a real issue that we've seen, and is exceptionally difficult to troubleshoot and performance problems become exceptionally hard to troubleshoot when there are multiple applications running on the same server.

    There are other reasons, such as the fact that databases and application servers have different CPU and memory requirements based on the nature of how they operate and optimizations for one may be detrimental to the other.  Moreover, we run our tests on dedicated servers, so we can't make any guarantees about systems running shared servers (even though shared servers may work in some cases).

    Additionally, we technically don't explicitly support running your database in a Docker container -- this isn't something we've tested, so if customers run into issues in such a configuration our support may be limited.

    Hopefully that addresses the why, let me know if you have further questions!

  • 6.  Re: Linking new Jama 8.x with MySQL DB in another docker container

    Posted 10-26-2016 19:22
    This is an excellent answer, but I'd like to make another point here:

    This question tends to indicate perhaps a misunderstanding of our deployment model that I'd like to clear up/address.  While our application uses Docker "under-the-hood", we're not actually providing a set of Docker images or containers that can be manipulated -- we're providing a packaged, managed service that deploys, orchestrates, and maintains those containers.  As Ryan mentioned, the Replicated daemon is responsible for managing and orchestrating containers, so if what you're looking to do isn't supported as an option in the admin console, you're likely heading into unsupported territory. 

    To that end, we don't currently support container linking like you're requesting -- as Ryan mentioned, you'll need to use the standard TCP/IP communication for connecting to the database, as supported by the admin console (so, IP/Port + username and password, from which we build a connection string and make TCP connections).  Ryan's method of bridged networking is valid, except for the fact that we don't support docker-based DBs or DBs on the same host as the application server, as discussed below.

    We are interested in different use cases and add functionality to the admin console in some cases, so definitely don't hesitate to let us know here on the community if you have a need for functionality that isn't currently supported.

    Let me know if you have any questions about this!

  • 7.  Re: Linking new Jama 8.x with MySQL DB in another docker container

    Posted 10-27-2016 05:33
    Hello Nicholas Lawrence,

    Thank you for the answer.

    It's clear that you provide a stable solution for production environment.
    But how about small or staging environments, where DB size is about 500Mb. Is it rational to use separate server in this case?

    Could you provide an alternative solution that is supported by Jama please?

  • 8.  Re: Linking new Jama 8.x with MySQL DB in another docker container

    Posted 10-28-2016 16:21
    Konstantin, at this point we do not have an alternative suggestion—we support only housing them on separate servers. However, the database can reside on a server with other databases—we just don't support it running with other applications.