Skip to content
This repository has been archived by the owner on Sep 12, 2019. It is now read-only.

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

docker-atlassian-jira-data-center

Version 7.8.0

Start an Atlassian JIRA® Software Data Center version 7.8.0 with Docker for local testing during plugin development. It starts a PostgreSQL Database, several JIRA® Software cluster nodes and Apache2 HTTPD as sticky session loadbalancer. The shared jira-home is handled via a shared Docker volume.

 


 

Manage Cluster Script

To start, scale, stop and destroy the cluster, the manage-jira-cluster-7.8.0.sh script is provided. It basically works in the following way:

  • It creates a docker bridge network called jira-cluster-780.
  • It creates a shared volume called jira-shared-home-780.
  • It creates a docker container called jira-cluster-780-lb as the loadbalancer.
    • Binds Port 50611/tcp to the host.
  • It creates a docker container called jira-cluster-780-db as the database.
    • Port 5432/tcp are only exposed inside the jira-cluster-780 network.
  • It creates multiple docker containers called jira-cluster-780-node{n} as JIRA Software instances.
    • With n ∈ {1,2,3,...,100}.
    • An instance runs JIRA Software on Port 8080/tcp.
    • Port 8080/tcp and the multicast Ports 40001,4446/tcp are only exposed inside the jira-cluster-780 network.

The script is meant to follow the convention over configuration paradigma, therefore there is not much to be configured, except one thing:

  • It relies on the hostname jira-cluster-780-lb pointing to the interface which binds 60780/tcp.

 

Prerequisites

  • All Docker containers run internally as non-root with fixed UID 10777 and GID 10777.
  • You need Linux or macOS®.
  • Basic unix-tools like wc, awk, curl, tr, head and bash must be installed.
  • Bash 3 or 4 must be installed.
  • Latest Docker version must be installed.

 

Initial Configuration

(1) Add cluster hostname alias

Add the alias on your Docker-Host machine.

sudo su
echo "127.0.0.1  jira-cluster-780-lb" >> /etc/hosts

If you like to work with your cluster from your local network, use the servers public IP instead.

 

(2) Enable Network Forwarding (Multicast)

JIRA® Data Center uses EHCache Multicast networking features. We need to enable IP Forwarding.

On macOS® you do this with:

sudo sysctl -w net.inet.ip.forwarding=1

 

(3) Install Cluster Management Script

On macOS® you do this with:

#
# DOWNLOAD MANAGEMENT SCRIPT
#
curl -so /usr/local/bin/manage-jira-cluster-7.8.0.sh \
"https://raw.githubusercontent.com/codeclou/docker-atlassian-jira-\
data-center/master/7.8.0/manage-jira-cluster-7.8.0.sh"

#
# MAKE EXECUTABLE
#
chmod +x /usr/local/bin/manage-jira-cluster-7.8.0.sh

 

Usage

(1) Start a JIRA® Data Center 7.8.0 Cluster

manage-jira-cluster-7.8.0.sh --action create --scale 1

Important:

  • We start with one loadbalancer, one JIRA® node and one PostgreSQL Database.
  • After we post configured the first JIRA® node we will add more nodes.

 

(2) Browse to JIRA® Software

 

(3) Check Containers

Check if all containers have started with:

manage-jira-cluster-7.8.0.sh --action info

Should show something like:

101c71ae0c12    jira-cluster-780-node1     4446/tcp, 8080/tcp, 40001/tcp
e2e9a6b1b757    jira-cluster-780-db        5432/tcp
72f92316309f    jira-cluster-780-lb        0.0.0.0:60780->60780/tcp

You can check the logs of each container by calling e.g.:

docker logs jira-cluster-780-node1

 

(4) Start Post Configuration

Once the cluster is fully started up, you need to configure JIRA® Software in the browser.

Go to http://jira-cluster-780-lb:60780/ and make sure you enabled cookies (sticky session).

Use http://jira-cluster-780-lb:60780 as Base URL.

You can either use an Atlassian Data Center Timebomb Licenses or at best get a JIRA® Software Data Center 30 Days Trial License from my.atlassian.com.

Configure your user.

Skip E-Mail Setup and click yourself through to the end of the installation.

Use the JIRA® Data Center Health Check Tools to check the Health of each cluster node. SystemAtlassian Support ToolsHealth Checks tab

 

(5) Scale Up Cluster - Add JIRA® Nodes

Now that our first JIRA® Node is fully working we add additional nodes to our existing cluster.

manage-jira-cluster-7.8.0.sh --action update --scale 3

This will add two additional JIRA® Nodes and reconfigure the loadbalancer automatically.

Wait again several minutes and now check if all nodes are active and alive under SystemSystem Info and search for Cluster Nodes

If not all nodes you have started are active, try restarting all nodes not showing up.

For example if Instance 3 does not show up, you can restart it like so:

manage-jira-cluster-7.8.0.sh --action restart-node --id 3

 

Now your cluster should be up and running.

 

(6) Shutting down the cluster

manage-jira-cluster-7.8.0.sh --action destroy

This will kill and remove all instances.


 

FAQ

Why not use Docker Swarm Mode?

  • Because we need a sticky session loadbalancer, and the whole idea of swarm mode is to have identical stateless worker nodes. JIRA® Data Center on the other hand relies on a state for each node.

 

Why PostgreSQL 9.4?

 

Running with ufw and iptables on Ubuntu

If you run docker on ubuntu behind UFW and started docker with --iptables=false then you need to enable Postrouting in /etc/ufw/before.rules for the network.

Use docker network list to get Network-ID which is then br-NETWORK-ID under ifconfig, where you get the network range in my case 172.18.0.0.

*nat
:POSTROUTING ACCEPT [0:0]
#...
# DOCKER jira-cluster-780 network
-A POSTROUTING ! -o br-8a831390552b -s 172.18.0.0/16 -j MASQUERADE
#...
COMMIT

 


 

Compatibility

Tested under the following Operating Systems:

  • Ubuntu 16.04 64 Bit Server
    • Docker version 17.03.0-ce, build 60ccb22
    • GNU bash, version 4.3.46(1)-release (x86_64-pc-linux-gnu)
  • OS X El Capitan
    • Docker version 17.03.0-ce, build 60ccb22
    • GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin15)

Not tested and not compatible under the following Operating Systems:

  • Microsoft Windows

 

Trademarks and Third Party Licenses


 

License

MIT © Bernhard Grünewaldt