You might know JIRA Software already and might run it on AWS or on a physical server somehwere in your datacenter. When it comes to high load JIRA instances you might note that JIRA can become slow because it is just one Java-Application running in one Application-Server. And you can scale up and throw RAM at it all you want, at some point you need to scale out.
Therefore Atlassian introduced JIRA Data Center which consists of multiple Application-Server nodes running JIRA. A shared Database, a shared filesystem and a sticky session loadbalancer.
This blogpost aims to setup a local staging environment with virtual machines to be able to test your JIRA Plugins in a real JIRA Data Center Setup. Knowing that you could have a simpler development Setup of JIRA Data Center I really like this full fledged approach since it gives you a deeper understanding of how exactly JIRA Data Center works internally. Also this blogpost should be seen as an introduction to the followup bloposts that deal with Ansible and provisioning JIRA Data Center on AWS.
We want to Setup JIRA Data Center with two application nodes and one shared server running the database, loadbalancer and shared filesystem.
I will use some domains for my machines that point to local network addresses in my local network. The local network has its gateway on 192.168.178.1 and the subnet mask is 255.255.255.0. If you have a DNS Server you should also use Domains since this will lead to a more understandable setup.
A note to FRITZ!Box users. You need to allow your Domains to point to local network IPs like this.
You can either use a predefined Virtual Machine Image or create it yourself. We need the following basic Ubuntu System as Virtual Machine.
Here you can see some screenshots of ubuntu base install with Parallels Desktop:
After you have installed ubuntu shutdown the machine (not only hibernate) so that we can clone it in the next installation steps.
You can watch a video of the complete setup of the shared host which is described below.
First of all open the Prallels Desktop Manager and clone the Ubuntu Base System we created earlier. Call the new System jira-cluster-shared and start it up and configure the IP Address and Hostname and restart.
Static IP Config
Restart the system so that the changes take effect.
Ok now we can connect via SSH from our Host Computer.
Install and Configure PostgreSQL Server
Create the database user jiracluster and enter jiracluster as password as well.
Create the jiracluster database.
Open network connections for PostgreSQL server.
Find listen_addresses and change the line so that the server listens to all network interfaces.
Add a line to allow all incoming IPs to connect.
Restart the PostgreSQL server.
Install and Configure NFS Server
Install the nfs server.
Create a non privileged user called atlassian we will map all created files of the NFS Clients to.
Note down the user-id and group-id because you will need it later in the /etc/exports.
Create the shared folder that is to be exported.
Change the export config to actually export the shared folder to all network members and use the user-id and group-id of the atlassian user.
Start the nfs server.
Just to be safe change permissions of shared folder.
Install and Configure Apache 2 Webserver as Sticky Session Loadbalancer
Ok first of all I normally use nginx for all my things. But sadly the sticky-session-cookie-thingy is something nginx offers only in their pro version which is a little expensive if you don’t need the professional support. And yes I have seen the mod which I could manually compile into my nginx, but we do not do that - and I will not write an essay here about why not. So we are back to good old Apache HTTP Server which does the job fine.
Therefore we first install the server.
Delete the default site.
Create a config file for our loadbalancer config.
And now enable the site.
Lastly restart the http server.
You can watch a video of the complete setup of the node1 which is described below.
Now open the Prallels Desktop Manager and clone the Ubuntu Base System we created earlier. Call the new System jira-cluster-node1 and start it up and configure the IP Address and Hostname and restart.
Static IP Config
Ok now we can connect via SSH from our Host Computer.
Before we install JIRA we need to configure the NFS Client and mount the Shared Directory. Therefore open /etc/fstab and add a line with the mount instructions.
Now we install the NFS Client.
After the installation is done we create the mount point and mount the NFS Shared directory.
Alright. Now the shared dir should be mounted and you should be able to create files in it and see them also appear on the jira-shared instance.
Open another terminal and copy JIRA Software installer to node1 via scp
Now switch back to the previous terminal connected to the shared host via ssh and start the JIRA Installation
You can see the whole installation in the video above. Open http://jira-cluster-node1.home.codeclou.io:8080 and the browser and complete the installation. Here are the important things you need to do during setup wizard:
Complete the installation.
Now we start the actual JIRA Data Center Cluster configuration.
We first need to shutdown JIRA.
Next we create the actual shared JIRA home and change permissions
And we do not need to care about permissions of the shared home since it will all be mapped by the server. You might need to say chmod 777 -R on the jira-shared-cluster on this folder when you get permission problems.
Alright now that everything is setup we need to create the cluster.properties and define the nodename and the shared home directory.
And now we need to copy some folders of the local JIRA home directory to the shared one.
Let’s start JIRA again and see what happens.
Once JIRA has started up and we vist the Dashboard we can see the node-name show up in the footer.
In the JIRA Administration System Info clustering shows as activated.
Alright - since everything works so far we completely shutdown the system to be able to clone it again.
You can watch a video of the complete setup of the node2 which is described below.
Now open the Prallels Desktop Manager and clone jira-cluster-node1 we created earlier. Call the new System jira-cluster-node2 and start it up and configure the IP Address and Hostname.
Change the IP to 192.168.178.13 in /etc/network/interfaces and the hostname in /etc/hostname to jira-cluster-node2 like you did it during the node1 setup but do not restart just yet.
Now change the cluster.properties to
And now restart and stop JIRA once the instance is started up
Now startup jira-cluster-node1 and soon after start JIRA on node2 again.
Now you should be able to open http://jira-cluster.home.codeclou.io/ and see yourself bound to eitehr node1 or node2.
Your JIRA Data Center cluster is working now and you can upload your developed Plugins via the UPM as JAR-files and test them in a real cluster setup.
If you need help with JIRA, Confluence or any other Atlassian product we offer Atlassian Experts Services. We are experienced in the Setup of Atlassian Products in your own datacenter and on AWS. We also offer consulting via webmeeting worldwide. Feel free to contact us via the contact form below.