Home
Atom Feed

Installing JIRA on Azure

Aug 10, 2015

Most people I know have a love/hate relationship with JIRA. It is an incredibly advanced tool for project management, but that is also arguably its biggest problem. However, I have not found any better software elsewhere, even with JIRAs UX problems taken into account.

For a long time we have run the JIRA-as-a-service option, but our needs have outgrown what the non-on-premise service can deliver. But we are also in love with Azure, and we would prefer to run all our services there if possible. 

The question remained then, is it possible to run JIRA on Azure? Turns out the answer is yes, but with disclaimers. It appears JIRA does not play nice with SQL Azure, and after 10+ hours of trying to make it work, I abandoned that idea and decided to set up a VM with PostgreSQL instead. The setup is really straightforward, just follow the guide below and you will be set up with an hour.

Setting up the VM

1. Create a new VM on Azure with Ubuntu 14.04 installed. Choose size according to the JIRA Sizing Guide (we are using D3)

2. Attach a new disk called data and size it according to JIRA Sizing Guide (we are using 100GB, you only pay for the GB you actually use)

3. Connect to the new VM using SSH and then enter sudo -i on the command line

4. Configure swap space by editing the /etc/waagent.conf file like this:

ResourceDisk.EnableSwap=y
ResourceDisk.SwapSizeMB=4096

5. Attach the new data disk:

sudo fdisk /dev/sdc

When fdisk has started, press n, and then choose primary partition and use default values for the rest.
When the partition has been created, enter w to store the changes.

6. Format the new partition

sudo mkfs -t ext4 /dev/sdc1

7. Mount the new disk to /data

sudo mkdir /data
sudo mount /dev/sdc1 /data

8. Ensure the partition is re-mounted on every boot

sudo -i blkid # This gets you the UUID of the data disk, note it down
sudo nano /etc/fstab

Add the following line at the bottom:

UUID={your-disk-id} /data ext4 defaults 1 2

9. Verify the configuration with the following commands:

sudo umount /data
sudo mount /data

10. Navigate to the /tmp folder and download JIRA using the following command (Get an updated link from https://www.atlassian.com/software/jira/download):

wget https://www.atlassian.com/software/jira/downloads/binary/atlassian-jira-6.4.9-x64.bin

11. Start the JIRA install using the following command:

chmod 755 ./atlassian-jira-6.4.9-x64.bin
sudo ./atlassian-jira-6.4.9-x64.bin

12. When asked about the installation type, choose Custom Install

13. When asked where JIRA should be installed choose /data/atlassian/jira

14. When asked for the default location for JIRA data choose /data/atlassian/application-data/jira

15. When asked about ports, use the default

16. When asked about whether to run JIRA in the background, use the default

17. Go to the Azure Management Portal and find the VM you created. Go to the Endpoint settings screen and add the following configuration:

Endpoint: JIRA
Protocol: TCP
Public Port: 80
Private Port 8080
Floating IP Address: Disabled

Setting up the database server

1. Create a new VM on Azure with Ubuntu 14.04 installed. (I used a D1 server)

2. Attach a new disk called db and size make it 100GB. (You only pay for the GB you actually use)

3. Connect to the new VM using SSH and then enter sudo -i on the command line

4. Configure swap space by editing the /etc/waagent.conf file like this:

ResourceDisk.EnableSwap=y
ResourceDisk.SwapSizeMB=1024

5. Attach the new data disk in Ubuntu:

fdisk /dev/sdc

When fdisk has started, press n, and then choose primary partition and use default values for the rest.
When the partition has been created, enter w to store the changes.

6. Format the new partition

mkfs -t ext4 /dev/sdc1

7. Mount the new disk to /data

mkdir /data
mount /dev/sdc1 /data

8. Ensure the partition is re-mounted on every boot

blkid # This gets you the UUID of the data disk, note it down
nano /etc/fstab

Add the following line at the bottom:

UUID={your-disk-id} /data ext4 defaults 1 2

9. Verify the configuration with the following commands:

umount /data
mount /data

10. Install PostgreSQL

apt-get install postgresql postgresql-client postgresql-contrib

11. Configure database server

nano /etc/postgresql/9.3/main/postgresql.conf

Set the configuration to the following (remove any # prefixes)

data_directory = '/data/postgresql/9.3/main'
listen_addresses = '*'
password_encryption = on

12. Configure database server access.

Please note that this will allow for connections to from all hosts (as long as they have the correct username/password), if you want to restrict this, use a different IP mask than all. You can also restrict this in the endpoint configuration on the Azure VM.

nano /etc/postgresql/9.3/main/pg_hba.conf

Add the following line to the end of the IPv4 section

host all all all md5

13. Move databases and restart the database server

/etc/init.d/postgresql stop
mkdir -p /data/postgresql/9.3
mv /var/lib/postgresql/9.3/main /data/postgresql/9.3
chown -R postgres:postgres /data/postgresql/9.3/main
/etc/init.d/postgresql start

14. Create machine user

adduser jira

15. Create database user

su - postgres
createuser --interactive -P jira
# Enter a password
# Shall the new role be a superuser? (y/n) n
# Shall the new role be allowed to create databases? (y/n) y
# Shall the new role be allowed to create more new roles? (y/n) n
logout

16. Create database

su - jira
createdb jiradb

Configuring JIRA

1. Navigate to your server at {vm-name}.cloudapp.net using your browser of choice
2. Choose I'll set it up myself and click Next.
3. Choose My Own Server when asked about the DB server, and input the data from the previous steps.
4. After the database is set up, you can input your license and other info like admin user and url prefix. This part is really straightforward, and I'm confident that you will manage on your own from here :-)