Method steps for deploying Confluence and jira software in Docker

  • 2021-01-25 08:09:00
  • OfStack

version:


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

Hints before installation:

1. Two databases need to be prepared, because confluence and jira-software have different mysql configuration requirements
2. confluence requires jdk configuration,jira-software comes with jdk

Reasons for choosing to use docker deployment:

1. confluence and jira-software have different environmental requirements and need to be configured separately.
2. If you use physical machines directly, you need to take up more than one.
3. Not using virtual machines is because docker is lighter and easier to migrate.
4. confluence and jira-software are only used as internal employees of the company, which do not require high configuration and complex environment

The deployment process:

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

Container name and IP distribution:

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

The host machine 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 adds a custom bridge to specify 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. Migration ES96en container default directory


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

2. jira - software deployment

Create directory:


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

Shih:

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

1. Deploy and configure MySQL as 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

  #  Entering Container Modification MySQL configuration , And create jira-software Required database 
   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 MySQL Configuration to take effect 
   docker restart jira-mysql

2. The deployment jira - software


  #  The installation jira-software the 4 Is an important option. 
    Installation type  -  Select options 2( The custom ) To gain as much control as possible . 
    The target directory  -  This is to install Jira The place where .
    Home directory   -  This is the storage log , Search indexes and files, etc Jira The place of the data .
   TCP port   -  These are HTTP Connector port and Jira The control port that will run . Unless you're in the same room 1 Port to run other applications , Otherwise, use the default .
    Installation as a Service  -  use "/etc/init.d/jira [stop | start]" Command to control jira service .

  #  Deploy the container and install it 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 be installed on your computer jira software, Press enter to 
     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 here 1 Is the default installation ,2 Is a custom installation ,3 Is the update , choose 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

     >  Choose your jira The installation directory 
     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

     >  Choose your jira The data directory 
     Default location for JIRA Software data
     [/var/atlassian/application-data/jira]
     /usr/local/confluence/data

     >  Service ports can be specified , So this 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 or not to jira Installation as a Service , Use after installation as a service "/etc/init.d/jira [stop | start]" To control the jira To stop and start .
     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

     >  The configuration information you entered earlier is listed here , Ask if you install it , Press enter to 
     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 It has been installed successfully. , Start now or not 
     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 It didn't come with it java The connection mysql The driver of the , So you need to download it yourself , And put into 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

  #  You can access it here "http://10.0.0.25:10010" Initialize your jira-software configuration , Use for now jira The trial license of the ( Normal version )

  #  crack jira-software
   >  Back up 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 the service 
    /etc/init.d/jira stop
    /etc/init.d/jira start

   >  View the license expiration time 
     License Status View http://10.0.0.25:10010/plugins/servlet/applications/versions-licenses

3. jira- Issue handling after software startup.

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 set useSSL=true and provide truststore for server certificate verification.

]

The problem


 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>

Instead of


  <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


  $ 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

0

4. confluence deployment

Create directory:


  $ 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

1

Shih:
/ docker - storage/confluence/wiki/mysql: MySQL container data directory
/ docker - storage/confluence/wiki/etc: wiki container installation directory
/ docker - storage/confluence/wiki/data: wiki container data directory

1. Deploy and configure MySQL as required by wiki


  $ 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

2. wiki deployment


 #  The installation wiki Options and jira Almost the same 

  #  Deploy the container and install it 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 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

  #  The installation 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],      Fast installation 
     Custom Install (recommended for advanced users) [2, Enter],  Custom installation  -
     Upgrade an existing Confluence installation [3]     upgrade 
     2

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

     Default location for Confluence data          confluence The default location of the 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= The default ,2= The custom 
     1

     Confluence can be run in the background.           It can run in the background Confluence . 
     You may choose to run Confluence as a service, which means it will start   You can choose to Confluence Running as a service means it will start 
     automatically whenever the computer restarts.          Automatically whenever the computer is restarted. 
     Install Confluence as Service?             The installation Confluence As a 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        Confluence 6.15.4 The installation is complete 
     Start Confluence now?               Now start Confluence ? ?
     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 and jira1 The sample was not brought with it java The connection mysql The driver of the , So you need to download it yourself , And put into 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

  #  You can access it here "http://10.0.0.25:10020" Initialize your wiki configuration , Do not select the component for now , Directly configured to have server ID the 1 page 

  #  crack wiki and jira Completely different , Take two steps ,1 It's a hack file ,2 Is to obtain the authorization code 
   >  will wiki the /usr/local/confluence/etc/confluence/WEB-INF/lib/atlassian-extras-decoder-v2-3.4.1.jar Download the file locally and rename it to atlassian-extras-2.4.jar
   >  Find the crack software , Right click on the confluence_keygen.jar use java run ( Need to be in windows Installed on the java)
   >  choose ".patch" Find out just from wiki Download down and rename the file to open 
   >  Note that the crack program is not closed for now 
   >  Then open the file directory where you downloaded the cracked package , You can see atlassian-extras-2.4.jar and atlassian-extras-2.4.bak Two files, right here atlassian-extras-2.4.jar It's already cracked 
   >  will atlassian-extras-2.4.jar Let's change the name back to atlassian-extras-decoder-v2-3.4.1.jar And then to wiki the /usr/local/confluence/etc/confluence/WEB-INF/lib/ Under the 

   /etc/init.d/confluence restart

   >  Copy from a web page server ID, Then return your hack program , will server ID Fill in the crack program , And fill in other information ( Optional fill , Make sure your email format is correct )
   >  Click to crack the program ".gen!" button , And then it's going to generate key Fill in the web In the can 

5. confluence problem handling

For console report error 500,atlassian community help reply like this

1. After the confluence configuration is completed, it is found that the css style is not displayed, and the console error is 500

atlassian community help prompts like this:

confluence accounts must be on the directory < confluence_home > and < confluence_install > Have read/write/execute privileges

Solution (without -R):


  $ 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

4

SQL mode health check on the server in your system failed.

Enter the wiki-mysql container and comment the following line


  $ 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

5

out Warning: out Warning:

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

]

The problem


  $ 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

6

Instead of


  $ 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

7

Related articles: