DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • How to Run a MySQL Database in a Docker Container
  • Integrating Spring Boot Microservices With MySQL Container Using Docker Desktop
  • Keep Your Application Secrets Secret
  • Using Envoy Proxy’s PostgreSQL and TCP Filters to Collect Yugabyte SQL Statistics

Trending

  • Artificial Intelligence, Real Consequences: Balancing Good vs Evil AI [Infographic]
  • From Zero to Production: Best Practices for Scaling LLMs in the Enterprise
  • Performing and Managing Incremental Backups Using pg_basebackup in PostgreSQL 17
  • MySQL to PostgreSQL Database Migration: A Practical Case Study
  1. DZone
  2. Coding
  3. Tools
  4. Setup Jira With MySQL Docker.

Setup Jira With MySQL Docker.

Learn how to set up Jira with MySQL docker.

By 
Chandra Shekhar Pandey user avatar
Chandra Shekhar Pandey
·
Aug. 21, 22 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
7.1K Views

Join the DZone community and get the full member experience.

Join For Free

Hello Everyone,

I am here again after a long gap. I have something new and interesting. In this article, we are going to set up a Jira DataCenter/Server-based instance on our host machine.

Prerequisite

  1. Install the latest version of Jira. Download Jira Software Server. For this demonstration, I used Jira Software 9.1.0 with tar.gz archive distribution. You can also download zip-based distribution. I prefer these as these are mostly platform-independent. Extract it.
  2. Docker should be installed.

Now let us start the demonstration. I am using a mac for this demo.

We would first create a customized mysql option file my-custom.conf. I created the file the following way.

Shell
 
$ pwd
/Users/cpandey/Docker

$ cat mysql-conf/jiramysql/conf.d/my-custom.conf 
[mysqld]
default-storage-engine=INNODB
character_set_server=utf8mb4
innodb_default_row_format=DYNAMIC
innodb_log_file_size=2G
sql_mode=NO_AUTO_VALUE_ON_ZERO

Now I am going to run the following docker commands to run MySQL docker image.  Here important point is that as volume, I am providing my-custom.conf as a MySQL option file and also providing mysql-data as the folder name in my host machine so that it persists MySQL data. I have set the container name as jiramysql.

Shell
 
$ docker pull mysql
$ sudo docker run --detach --name=jiramysql --env="MYSQL_ROOT_PASSWORD=password" --publish 6603:3306 --volume=/Users/cpandey/Development/Docker/mysql-data:/var/lib/mysql --volume=/Users/cpandey/Development/Docker/mysql-conf/jiramysql/conf.d:/etc/mysql/conf.d mysql
$ sudo docker ps
CONTAINER ID   IMAGE             COMMAND                  CREATED         STATUS          PORTS                                                  NAMES
e16fe72d3be3   mysql             "docker-entrypoint.s…"   9 minutes ago   Up 9 minutes    33060/tcp, 0.0.0.0:6603->3306/tcp, :::6603->3306/tcp   jiramysql
7ecf80fa4caf   postgres:latest   "docker-entrypoint.s…"   4 weeks ago     Up 27 minutes   0.0.0.0:6432->5432/tcp, :::6432->5432/tcp              postgres1

$ sudo docker exec -it jiramysql bash
bash-4.4# mysql -uroot -ppassword
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.30 MySQL Community Server - GPL

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Now I am creating a user and database in MySQL for my Jira setup. Also, I am providing all privileges.

Shell
 
mysql> create database jiradb character set utf8mb4 collate utf8mb4_bin;
Query OK, 1 row affected(0.01sec)
mysql> create user 'jiradbuser' identified by 'jiradbpassword';
Query OK, 0 rows affected (0.07 sec)

mysql> grant all privileges on jiradb.* to 'jiradbuser'@'%' with grant option;
Query OK, 0 rows affected (0.10 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.05 sec)

With the following commands, we can check the details of the MySQL docker container.

Shell
 
$ sudo docker ps|grep jiramysql
35c9714543f9   mysql             "docker-entrypoint.s…"   27 minutes ago   Up 27 minutes      33060/tcp, 0.0.0.0:6603->3306/tcp, :::6603->3306/tcp   jiramysql

$ sudo docker inspect jiramysql|grep -A 16 -i mounts
             "Mounts": [
            {
                "Type": "bind",
                "Source": "/Users/cpandey/Development/Docker/mysql-data",
                "Destination": "/var/lib/mysql",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/Users/cpandey/Development/Docker/mysql-conf/jiramysql/conf.d",
                "Destination": "/etc/mysql/conf.d",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            }

We have to set jira.home following way. Jira by default create index cache, plugin cache and application logs in this folder.

Shell
 
$ atlassian-jira-software-9.1.0-standalone$ mkdir jira-home
$ atlassian-jira-software-9.1.0-standalone$ cat atlassian-jira/WEB-INF/classes/jira-application.properties

jira.home = /Users/cpandey/Development/JIRA_SOFTWARE/9_JIRA/atlassian-jira-software-9.1.0-standalone/jira-home

Download the MySQL driver jar file from here. I selected the Platform Independent option for download.  

Copy MySQL driver jar to lib folder with Jira installation folder. I used mysql-connector-java-8.0.30.jar driver version.

Shell
 
$ atlassian-jira-software-9.1.0-standalone/lib$ ls -ltr|grep mysql
-rw-r--r-- 1 cpandey cpandey 2513563 Jul  1 03:18 mysql-connector-java-8.0.30.jar

Start Jira. 

Shell
 
$ cd atlassian-jira-software-9.1.0-standalone/bin
$ ./start-jira.sh

Access Jira using URL http://localhost:8080. If the page loads successfully then select "I'll set it up myself". Click on the Next button.


Now we have to set up a database, and select "My Own Database". Check the following screenshot for the host, port, database type, database name, username, and password details. All these configurations are from our earlier steps when we run MySQL as a docker container. Click on Test Connection, which should be a success. Then click the Next button.

Wait for a while as now database scripts are executed to create a complete Jira database in MySQL. Once it is complete, we will get this screen. 

After this, we will be asked for a license. For demonstration purposes, one can use a trial license. Also once the license is set, we would have to next create an Administrator user and finally, we will be requested to Set up email notifications which we can set later. 

We can check the database client configuration of Jira at [JIRA-HOME]/dbconfig.xml file. We can further tune this file for DB pool configurations.

Shell
 
$ cd atlassian-jira-software-9.1.0-standalone/jira-home
$ cat dbconfig.xml
<?xml version="1.0" encoding="UTF-8"?>

<jira-database-config>
  <name>defaultDS</name>
  <delegator-name>default</delegator-name>
  <database-type>mysql8</database-type>
  <jdbc-datasource>
    <url>jdbc:mysql://address=(protocol=tcp)(host=localhost)(port=6603)/jiradb?sessionVariables=default_storage_engine=InnoDB</url>
    <driver-class>com.mysql.cj.jdbc.Driver</driver-class>
    <username>jiradbuser</username>
    <password>jiradbpassword</password>
    <pool-min-size>40</pool-min-size>
    <pool-max-size>40</pool-max-size>
    <pool-max-wait>30000</pool-max-wait>
    <validation-query>select 1</validation-query>
    <min-evictable-idle-time-millis>60000</min-evictable-idle-time-millis>
    <time-between-eviction-runs-millis>300000</time-between-eviction-runs-millis>
    <pool-max-idle>40</pool-max-idle>
    <pool-remove-abandoned>true</pool-remove-abandoned>
    <pool-remove-abandoned-timeout>300</pool-remove-abandoned-timeout>
    <pool-test-on-borrow>false</pool-test-on-borrow>
    <pool-test-while-idle>true</pool-test-while-idle>
    <validation-query-timeout>3</validation-query-timeout>
    <connection-properties>nullDatabaseMeansCurrent=true</connection-properties>
  </jdbc-datasource>
</jira-database-config>

That's it. The setup is finished. I hope you find this article helpful.

MySQL Docker (software) Jira (software)

Opinions expressed by DZone contributors are their own.

Related

  • How to Run a MySQL Database in a Docker Container
  • Integrating Spring Boot Microservices With MySQL Container Using Docker Desktop
  • Keep Your Application Secrets Secret
  • Using Envoy Proxy’s PostgreSQL and TCP Filters to Collect Yugabyte SQL Statistics

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!