Today I attempted to install JIRA Service Desk 3.1.2 on Linux. There were a few bumps in the road, so this post is intended for my future self, and perhaps you so we don’t have to go searching too far for answers.
I make no assumptions of whether or not your environment is secure, nor do I make any guarantee that the steps I’ve outlined are in themselves the best approach for a secure installation.
Setup a MySQL Docker container
The easiest way to setup MySQL is to run it in a Docker container. I say it’s easy because there’s already an official image on the Docker Hub. I had to repeat this step a few times before getting something that worked properly with JIRA Service Desk.
JIRA Service Desk 3.1.2 doesn’t seem to support MySQL 5.7, so you’ll want to get the MySQL 5.6 image. If you used the latest image (ie: didn’t specify a version tag), you’ll have some MySQL exceptions in the Tomcat logs, something like:
unknown system variable storage_engine
Next, you’ll want to store data outside of the Docker container, so create a data directory.
Finally run the Docker container with this command.
docker run -p 3306:3306 --name mysql -v /var/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=s3cret -d mysql:5.6
Now you have MySQL 5.6 up and running.
Create a database for JIRA Service Desk and setup the MySQL user JIRA will use
Now you’ll need to login to your MySQL instance. Issue the following command to get a bash prompt.
docker exec -it mysql bash
You should now be at the bash prompt and can login to MySQL.
mysql -u root -pmypassword
Next create a database for JIRA. You need to specify a character set and collate value on the create database command, otherwise the default latin1_swedish will be used and JIRA Service Desk will throw exceptions. You can refer to the MySQL docs here, or just follow the next couple steps.
CREATE DATABASE jiradb CHARACTER SET utf8 COLLATE utf8_bin;
And setup a user that JIRA will use to connect to the new database.
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX on jiradb.* TO 'jira'@'%' IDENTIFIED BY 'mypassword'; flush privileges;
This creates a user named “jira” with password “mypassword” and gives him access to all tables in the database named “jiradb” when connecting from any host “%”.
Install JIRA Service Desk
Start by downloading JIRA Service Desk, extract it and run the installer.
cd /opt curl -O https://downloads.atlassian.com/software/jira/downloads/atlassian-servicedesk-3.1.2-jira-7.1.2-x64.bin chmod +x atlassian-servicedesk-3.1.2-jira-7.1.2-x64.bin ./atlassian-servicedesk-3.1.2-jira-7.1.2-x64.bin
Follow the prompts during the installer. When asked which installation option you want, if you’re in a hurry, just use option 1 for Express Install. This part takes a bit of time, but once finished, JIRA Service Desk should be installed.
Before starting the service, we need to install the MySQL JDBC driver. You can download it here. Once downloaded, extract the archive and copy the .jar to the JIRA lib folder.
tar xvzf /opt/mysql-connector-java-5.1.38.tar.gz cp /opt/mysql-connector-java-5.1.38/mysql-connector-java-5.1.38-bin.jar /opt/atlassian/jira/lib
Now we need to ensure JIRA is setup to start at OS boot and then start the service. You can optionally tail the Tomcat logs to see how things go.
chkconfig jira on systemctl start jira tail -f /opt/atlassian/jira/logs/catalina.out
You now have JIRA Service Desk installed and ready to be configured. You can browse to http://yourhost:8080 and start the configuration process. I won’t step through this part since it’s pretty self explanatory.