How to deploy Confluence and jira-software in Docker

How to deploy Confluence and jira-software in Docker

version:

 centos==7.2
 jdk==1.8
 confluence==6.15.4
 jira-software==8.2.1
 docker==18.09

Pre-installation tips:

1. You need to prepare two databases because the MySQL configuration requirements of confluence and jira-software are different
2. Confluence needs to be configured with JDK, and jira-software comes with JDK

Reasons for choosing Docker deployment:

1. Confluence and jira-software have different environment requirements and need to be configured separately.
2. If you use physical machines directly, you will need to occupy multiple machines.
3. Virtual machines are not used because Docker is lighter and easier to migrate.
4. Confluence and Jira-software are only used by internal employees of the company, and do not require high configuration and complex environment

The deployment process:

1. Configure the database required by jira-software
2. Configure jira-software
3. Configure the database required by Confluence
4. Configure Confluence

Container name and IP distribution:

Because the wiki account can be controlled by jira, we first install jira-software

Host IP: 10.0.0.25

1. jira-software
jira-mysql 192.168.0.10
confluence-jira 192.168.0.100

2. Confluence
wiki-mysql 192.168.0.20
confluence-wiki 192.168.0.200

1. Docker-ce environment configuration

1. Install Docker

  $ sudo yum remove docker \
      docker-client \
      docker-client-latest \
      docker-common \
      docker-latest \
      docker-latest-logrotate \
      docker-logrotate \
      docker-engine

  $ sudo yum install -y yum-utils \
  device-mapper-persistent-data \
  lvm2

  $ sudo yum-config-manager \
   --add-repo \
   https://download.docker.com/linux/centos/docker-ce.repo

  $ sudo yum install docker-ce docker-ce-cli containerd.io

  $ sudo systemctl enable docker

  $ sudo systemctl start docker

2. Configure and add a custom bridge to specify the docker container IP

  $ docker network create \
  --driver=bridge \
  --subnet=192.168.0.0/24 \
  --ip-range=192.168.0.0/24 \
  --gateway=192.168.0.254 \
  br-custom

3. Download the official container base image

docker pull centos:7.5.1511
docker pull mysql:5.7.26

4. Migrate the default storage directory of Docker container

systemctl stop docker
mv /var/lib/docker /data/docker
ln -s /data/docker /var/lib/docker
systemctl start docker

2. jira-software deployment

Create a directory:

mkdir -p /docker-storage/confluence/jira/{etc,data,mysql}

release:

/docker-storage/confluence/jira/mysql : the data directory of the MySQL container
/docker-storage/confluence/jira/etc : the installation directory of the jira-software container
/docker-storage/confluence/jira/data : data directory of the jira-software container

1. Deploy and configure MySQL required by jira

  # Start the container docker run --name jira-mysql --network br-custom --ip 192.168.0.10 \
   -v /docker-storage/confluence/jira/mysql:/var/lib/mysql \
   -e MYSQL_ROOT_PASSWORD='123456Qr!' \
   -d mysql:5.7.26

  # Enter the container to modify the MySQL configuration and create the database required by jira-software docker exec -it jira-mysql "/bin/bash"

   apt update
   apt-get install vim

   vim /etc/mysql/mysql.conf.d/mysqld.cnf
    [mysqld]
    default-storage-engine=INNODB
    character_set_server=utf8mb4
    innodb_default_row_format=DYNAMIC
    innodb_large_prefix=ON
    innodb_file_format=Barracuda
    innodb_log_file_size=2G
    sql_mode = NO_AUTO_VALUE_ON_ZERO

   mysql -uroot -p123456Qr!
    CREATE DATABASE jiradb CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
    GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,REFERENCES,ALTER,INDEX on jiradb.* TO 'confluence-jira'@'192.168.0.%' IDENTIFIED BY '123456Qr!';
    flush privileges;

  # Restart the container to make the MySQL configuration take effect docker restart jira-mysql

2. Deploy jira-software

  # Four important options for installing jira-software Installation Type - Select option 2 (Custom) for the most control. 
   Target Directory - This is where Jira is installed.
   Home Directory − This is where Jira data like logs, search indexes, and files are stored.
   TCP Ports - These are the HTTP connector ports and the control port that Jira will run on. Use the default values ​​unless you have other applications running on the same ports.
   Install as a service - Use the "/etc/init.d/jira [stop | start]" command to control the jira service.

  # Deploy the container and install jira-software
   docker run -dit --name confluence-jira --network br-custom --ip 192.168.0.100 -p 10.0.0.25:10010:8080 \
   -v /docker-storage/confluence/jira/:/usr/local/confluence/ \
   -v /docker-storage/confluence/jira/etc/:/usr/local/confluence/etc/ \
   -v /docker-storage/confluence/jira/data/:/usr/local/confluence/data/ \
   centos:7.2.1511 "/bin/bash"

   docker exec -it confluence-jira "/bin/bash"

   yum -y install epel-release
   yum -y install libffi-devel gcc gcc-c++ make automake zlib zlib-devel openssl-devel wget gcc gcc-c++ make automake zlib zlib-devel openssl-devel dejavu-sans-fonts vim lrzsz

   wget https://product-downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-8.2.1-x64.bin

   chmod a+x atlassian-jira-software-8.2.1-x64.bin

   ./atlassian-jira-software-8.2.1-x64.bin
    > Interactive installation process:
     Unpacking JRE ...
     Starting Installer ...

     > This will install JIRA Software 8.2.1 on your computer.
     OK [o, Enter], Cancel [c]

     Click Next to continue, or Cancel to exit Setup.

     > Enter 1 here for default installation, 2 for custom installation, 3 for update, select 2
     Choose the appropriate installation or upgrade option.
     Please choose one of the following:
     Express Install (use default settings) [1], Custom Install (recommended for advanced users) [2, Enter], Upgrade an existing JIRA installation [3]
     2

     > Select the folder where you would like JIRA Software to be installed.
     Where should JIRA Software be installed?
     [/opt/atlassian/jira]
     /usr/local/confluence/etc

     > Select your jira data directoryDefault location for JIRA Software data
     [/var/atlassian/application-data/jira]
     /usr/local/confluence/data

     > You can specify the service port. Here is the default Configure which ports JIRA Software will use.
     JIRA requires two TCP ports that are not being used by any other
     applications on this machine. The HTTP port is where you will access JIRA
     through your browser. The Control port is used to startup and shutdown JIRA.
     Use default ports (HTTP: 8080, Control: 8005) - Recommended [1, Enter], Set custom value for HTTP and Control ports [2]

     > Whether to install jira as a service. After installing it as a service, use "/etc/init.d/jira [stop | start]" to control the stop and start of jira.
     JIRA can be run in the background.
     You may choose to run JIRA as a service, which means it will start
     automatically whenever the computer restarts.
     Install JIRA as Service?
     Yes [y, Enter], No [n]
     y

     > Here you will see the configuration information you entered earlier. If you are asked whether to install it, just press Enter. Details on where JIRA Software will be installed and the settings that will be used.
     Installation Directory: /usr/local/confluence/etc 
     Home Directory: /usr/local/confluence/data 
     HTTP Port: 8080 
     RMI Port: 8005 
     Install as service: Yes 
     Install [i, Enter], Exit [e]

     Extracting files ...

     Please wait a few moments while JIRA Software is configured.

     > jira software has been installed successfully, do you want to start it now? Installation of JIRA Software 8.2.1 is complete
     Start JIRA Software 8.2.1 now?
     Yes [y, Enter], No [n]
     y

     Please wait a few moments while JIRA Software starts up.
     Launching JIRA Software ...

     Installation of JIRA Software 8.2.1 is complete
     Your installation of JIRA Software 8.2.1 is now ready and can be accessed
     via your browser.
     JIRA Software 8.2.1 can be accessed at http://localhost:8080
     Finishing installation ...

  # Because jira does not come with a driver for connecting java to mysql, you need to download it yourself and put it in the corresponding directory.
    wget https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-5.1.47.tar.gz
    tar zxf mysql-connector-java-5.1.47.tar.gz
    cp mysql-connector-java-5.1.47/mysql-connector-java-5.1.47-bin.jar /usr/local/confluence/etc/lib/
    /etc/init.d/jira stop
    /etc/init.d/jira start

  # Now you can visit "http://10.0.0.25:10010" to initialize your jira-software configuration. For now, use jira's trial license (regular version)

  # Cracking jira-software
   >Backup the original file mv /usr/local/confluence/etc/atlassian-jira/WEB-INF/lib/atlassian-extras-3.2.jar /root/

   > Move the cracked file to the source location cp atlassian-extras-3.2.jar /usr/local/confluence/etc/atlassian-jira/WEB-INF/lib/atlassian-extras-3.2.jar

   > Restart service /etc/init.d/jira stop
    /etc/init.d/jira start

   > Check the license expiration time and license status at http://10.0.0.25:10010/plugins/servlet/applications/versions-licenses

3. Problem handling after jira-software is started.

Processing /usr/local/confluence/etc/logs/catalina.out warning:

Fri May 31 12:05:49 UTC 2019 WARN: Establishing SSL connection without server's identity verification is
not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be
established by default if explicit option isn't set. For compliance with existing applications not using
SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by
setting useSSL=false, or setting useSSL=true and provide truststore for server certificate verification.

question

 vim /usr/local/confluence/data/dbconfig.xml
  <url>jdbc:mysql://address=(protocol=tcp)(host=192.168.0.10)(port=3306)/jiradb?sessionVariables=default_storage_engine=InnoDB</url>

Change to

  <url>jdbc:mysql://address=(protocol=tcp)(host=192.168.0.10)(port=3306)/jiradb?useSSL=false&amp;sessionVariables=default_storage_engine=InnoDB</url>

Restart Jira

 /etc/init.d/jira stop
 /etc/init.d/jira start

4. Confluence deployment

Create a directory:

mkdir -p /docker-storage/confluence/wiki/{etc,data,mysql}

release:
/docker-storage/confluence/wiki/mysql : the data directory of the MySQL container
/docker-storage/confluence/wiki/etc : the installation directory of the wiki container
/docker-storage/confluence/wiki/data : data directory of the wiki container

1. Deploy and configure MySQL required by wiki

# Start the container docker run --name wiki-mysql --network br-custom --ip 192.168.0.20 \
   -v /docker-storage/confluence/wiki/mysql:/var/lib/mysql \
   -e MYSQL_ROOT_PASSWORD='123456Qr!' \
   -d mysql:5.7.26

  # Enter the container to modify the MySQL configuration and create the database required by jira-software docker exec -it wiki-mysql "/bin/bash"

   apt update
   apt-get install vim

   vim /etc/mysql/mysql.conf.d/mysqld.cnf
    [mysqld]
    character-set-server=utf8
    collation-server=utf8_bin
    default-storage-engine=INNODB
    max_allowed_packet=256M
    innodb_log_file_size=2GB
    sql_mode = NO_AUTO_VALUE_ON_ZERO
    transaction-isolation=READ-COMMITTED
    binlog_format=row

   mysql -uroot -p123456Qr!
    CREATE DATABASE confluence CHARACTER SET utf8 COLLATE utf8_bin;
    GRANT ALL PRIVILEGES ON confluence.* TO 'confluence_user'@'192.168.0.%' IDENTIFIED BY '123456Qr!';
    flush privileges;

  # Restart the container to make the MySQL configuration take effect docker restart wiki-mysql

2. Deploy the wiki

 # The options for installing wiki are almost the same as jira# Deploy the container and install wiki
   docker run -dit --name confluence-wiki --network br-custom --ip 192.168.0.200 -p 10.0.0.25:10020:8090 \
   -v /docker-storage/confluence/wiki/:/usr/local/confluence/ \
   -v /docker-storage/confluence/wiki/etc/:/usr/local/confluence/etc/ \
   -v /docker-storage/confluence/wiki/data/:/usr/local/confluence/data/ \
   centos:7.2.1511 "/bin/bash"

   docker exec -it confluence-wiki "/bin/bash"

   yum -y install epel-release
   yum -y install libffi-devel gcc gcc-c++ make automake zlib zlib-devel openssl-devel wget gcc gcc-c++ make automake zlib zlib-devel openssl-devel dejavu-sans-fonts vim lrzsz

  # wiki requires manual configuration of jdk
   wget https://download.oracle.com/otn/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jdk-8u202-linux-x64.tar.gz
   tar zxf jdk-8u202-linux-x64.tar.gz 
   mv jdk1.8.0_202 /usr/local/jdk1.8

   vim /etc/profile
    export JAVA_HOME=/usr/local/jdk1.8
    export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
    export PATH=$PATH:$JAVA_HOME/bin

   source /etc/profile

  # Install wiki
   wget https://product-downloads.atlassian.com/software/confluence/downloads/atlassian-confluence-6.15.4-x64.bin

   chmod a+x atlassian-confluence-6.15.4-x64.bin

   ./atlassian-confluence-6.15.4-x64.bin
    > Interactive installation process:
     This will install Confluence 6.15.4 on your computer.
     OK [o, Enter], Cancel [c]         

     Click Next to continue, or Cancel to exit Setup.

     Choose the appropriate installation or upgrade option.
     Please choose one of the following:
     Express Install (uses default settings) [1], Custom Install (recommended for advanced users) [2, Enter], Custom Install -
     Upgrade an existing Confluence installation [3]

     Select the folder where you would like Confluence 6.15.4 to be installed,
     then click Next.
     Where should Confluence 6.15.4 be installed?
     [/opt/atlassian/confluence]
     /usr/local/confluence/etc

     Default location for Confluence data [/var/atlassian/application-data/confluence]
     /usr/local/confluence/data

     Configure which ports Confluence will use.
     Confluence requires two TCP ports that are not being used by any other
     applications on this machine. The HTTP port is where you will access
     Confluence through your browser. The Control port is used to Startup and
     Shutdown Confluence.
     Use default ports (HTTP: 8090, Control: 8000) - Recommended [1, Enter], Set custom value for HTTP and Control ports [2] 1=Default, 2=Custom1

     Confluence can be run in the background.
     You may choose to run Confluence as a service, which means it will start automatically whenever the computer restarts.
     Install Confluence as Service?
     Yes [y, Enter], No [n] Yes [y, Enter], No [n]
     y

     Extracting files ...

     Please wait a few moments while we configure Confluence.

     Installation of Confluence 6.15.4 is complete Start Confluence now?
     Yes [y, Enter], No [n]
     y

     Please wait a few moments while Confluence starts up.
     Launching Confluence ...

     Installation of Confluence 6.15.4 is complete
     Your installation of Confluence 6.15.4 is now ready and can be accessed via
     your browser.
     Confluence 6.15.4 can be accessed at http://localhost:8090
     Finishing installation ...

  # Wiki, like Jira, does not come with a driver for connecting Java to MySQL, so you need to download it yourself and put it in the corresponding directory.
   wget https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-5.1.47.tar.gz
   tar zxf mysql-connector-java-5.1.47.tar.gz
   cp mysql-connector-java-5.1.47/mysql-connector-java-5.1.47-bin.jar /usr/local/confluence/etc/confluence/WEB-INF/lib/
   /etc/init.d/confluence restart

  # Now you can visit "http://10.0.0.25:10020" to initialize your wiki configuration. Do not select components for now, and directly configure to the page with server ID # Cracking wiki is completely different from jira, and requires two steps, one is to crack the file, and the other is to obtain the authorization code > Download the wiki's /usr/local/confluence/etc/confluence/WEB-INF/lib/atlassian-extras-decoder-v2-3.4.1.jar file to the local computer and rename it to atlassian-extras-2.4.jar
   > Find the cracking software, right-click confluence_keygen.jar and run it using java (Java needs to be installed on Windows)
   > Select ".patch" and find the file you just downloaded and renamed from the wiki to open it > Note that the cracking program should not be closed yet > Then open the file directory of the cracked package you downloaded, you can see two files, atlassian-extras-2.4.jar and atlassian-extras-2.4.bak. Here atlassian-extras-2.4.jar has been cracked > Change the name of atlassian-extras-2.4.jar back to atlassian-extras-decoder-v2-3.4.1.jar and transfer it to /usr/local/confluence/etc/confluence/WEB-INF/lib/ of the wiki /etc/init.d/confluence restart

   > Copy the server ID on the web page, then return to your cracking program, fill in the server ID into the cracking program, and fill in other information (fill in as you like, the email format must be correct)
   > Click the ".gen!" button and then fill in the generated key in the web

5. Confluence problem handling

For console error 500, Atlassian community help replies like this

1. After the confluence configuration is completed, the CSS style is not displayed, and the console reports an error 500

Atlassian's community help suggests this:

The confluence account must have read/write/execute permissions on the directories <confluence_home> and <confluence_install>

Solution (do not add -R):

chmod 755 /usr/local/confluence/data

2. After logging in to the wiki, it says: The server SQL mode health check in your system has failed.

Enter the wiki-mysql container and comment the following line

 vim /etc/mysql/mysql.conf.d/mysqld.cnf
   # sql_mode = NO_AUTO_VALUE_ON_ZERO

  docker restart wiki-mysql

3. Dealing with catalina.out warnings:

Processing /usr/local/confluence/etc/logs/catalina.out warning:

Fri May 31 12:16:44 UTC 2019 WARN: Establishing SSL connection without server's identity verification is not recommended.
According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit
option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'.
You need either to explicitly disable SSL by setting useSSL=false,
or set useSSL=true and provide truststore for server certificate verification

question

vim /usr/local/confluence/data/confluence.cfg.xml 
   <property name="hibernate.connection.url">jdbc:mysql://192.168.0.20:3306/confluence</property>

Change to

<property name="hibernate.connection.url">jdbc:mysql://192.168.0.20:3306/confluence?useSSL=false</property>

  /etc/init.d/confluence restart

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Complete steps for deploying confluence with docker
  • Deploy Confluence with Docker

<<:  Detailed explanation of JS ES6 variable destructuring assignment

>>:  18 common commands in MySQL command line

Recommend

How to build Jenkins+Maven+Git continuous integration environment on CentOS7

This article takes the deployment of Spring boot ...

Detailed explanation of the difference between $router and $route in Vue

We usually use routing in vue projects, and vue-r...

Solution to MySQL service 1067 error: modify the mysql executable file path

Today I encountered the MySQL service 1067 error ...

Webpack loads css files and its configuration method

webpack loads css files and its configuration Aft...

Node.js sends emails based on STMP protocol and EWS protocol

Table of contents 1 Node.js method of sending ema...

Tutorial on installing Ceph distributed storage with yum under Centos7

Table of contents Preface Configure yum source, e...

Building an image server with FastDFS under Linux

Table of contents Server Planning 1. Install syst...

Discussion on the problem of garbled characters in iframe page parameters

I encountered a very unusual parameter garbled pro...

Analysis of the process of implementing Nginx+Tomcat cluster under Windwos

Introduction: Nginx (pronounced the same as engin...

Introduction to basic concepts and technologies used in Web development

Today, this article introduces some basic concept...

Solution to secure-file-priv problem when exporting MySQL data

ERROR 1290 (HY000) : The MySQL server is running ...

Docker learning method steps to build ActiveMQ message service

Preface ActiveMQ is the most popular and powerful...

JavaScript implementation of verification code case

This article shares the specific code for JavaScr...