Some may consider the set-up of a test or sandbox Jira Data Center environment to be a non-trivial and expensive endeavor, but that assumption may be unwarranted. Using Docker, you can set up a multi-node test Data Center instance on a single host with ease. The process is almost as easy as setting up a single node server/data center instance!
At Addteq, we were early adopters of Docker because it allowed our Development, QA, and DevOps teams to spin up dedicated test instances of Atlassian and other DevOps tools, which was a game-changer. However, when we speak to customers, we find that most struggle with similar use cases. They use common sandbox instances in most cases, making it difficult to experiment with new code, apps, and configurations. Worse, in some cases, they only have the staging and production instances which is even less ideal.
Docker Images for Atlassian Tools
Atlassian provides an official Docker image for Jira and other Atlassian tools. However, setting up a Data Center instance requires running, creating, and managing multiple Docker containers since you need one for each node, database, and load balancer (Haproxy). Docker Compose is an open-source tool that enables orchestrating multiple Docker containers using a YAML-based configuration file. We will use it to set up and manage our data center instance. Instead of starting up from scratch, we can fork an open-source example from GitHub and create our own fork for making any changes to adapt to our own needs.
Set Up a Data Center instance with Docker
Here is how you can set up a Data Center instance on a host with Docker and Docker-Compose installed:
Clone the repository
git clone https://github.com/AddteqDemo/Jira-datacenter-docker
- Change to the directory and run the init.sh script
cd Jira-datacenter-docker ./init.sh
- Bring up the Postgres database container.
docker-compose up -d database
- Monitor the logs to ensure the database started successfully
docker-compose logs -f database
- Bring up the first Jira Data Center node and monitor the logs to ensure it has started successfully.
docker-compose up -d node1 docker-compose logs -f node1
- Browse to http://localhost:9090/ and complete the Jira setup
- Bring up the second Jira Data Center node & Haproxy and monitor the logs to ensure it has started successfully
docker-compose up -d node2 proxy docker-compose logs -f node2 proxy
Frequently Asked Questions
Some frequently asked questions for utilizing this approach include:
Can I use a different database like Mysql or Oracle?
Yes, however, due to licensing issues, the driver is not included and must be copied into the container as mentioned here.
Can I update the JVM heap and other configurations via environment variables?
Yes, it can be set as environment variables documented here, in the docker-compose.yml configuration.
Can I deploy Jira Datacenter on a Kubernetes cluster instead of a single host using Docker Compose?
Yes. We will have a follow-up blog post about setting up Jira Data Center in Kubernetes.
How can I update to a newer version of Jira Data Center?
Update the Docker image for Jira Software to the target version number. Make sure it matches the image tag outlined here