Docker-based Confluence installation

Foreword

Confluence is a professional enterprise knowledge management and collaboration software, which can also be used to build enterprise wikis. Simple to use, but its powerful editing and site management features can help team members share information, document collaboration, brainstorming, and information push.

Our laboratory uses Confluence to manage the scientific research process, but the online blog about Confluence installation is very vague, so the entire installation process is organized as follows.

Preparation

  • Configure the docker environment

  • Install Docker Engine | Docker Documentation

  • Configure jdk environment

  • Java Download | Java 8, Java 11, Java 13 – Linux, Windows & amp; macOS (azul.com)

  • Make sure port 8090 3306 of this server is available

  • Of course, you can also choose other ports, these two ports are used to map confluence and MySQL in docker respectively

  • Make sure the experience file exists

  • Link: https://pan.baidu.com/s/1fSuNjk6esgn3J7tdiMSnPg?pwd=u5cs Extraction code: u5cs

  • The content of the experience file is shown in the figure below, here I put it in /home/special/user/AI_Security_Lab/WIKI/creak

Install and configure MySQL

Create configuration file

vim /opt/software/mysql/conf/mysql.cnf
vim /opt/software/mysql/conf/mysqld.cnf

Enter the following respectively

# mysql.cnf

[mysql]
default-character-set=utf8
# mysqld.cnf

[mysqld]
socket= /var/run/mysqld/mysqld.sock
bind-address=0.0.0.0
character-set-server=utf8
default-storage-engine=INNODB
character_set_server = utf8
collation-server=utf8_general_ci
transaction-isolation = READ-COMMITTED
symbolic-links=0
max_allowed_packet = 512M
innodb_log_file_size = 4GB
binlog_format=row
log_bin_trust_function_creators = 1
optimizer_switch = derived_merge = off
skip-grant-tables

Run the MySQL container

You can see that the container has successfully run, and the container ID is 07e

into the container

docker exec -it 07e5 bash

Connect to the MySQL database inside the container

Confirm character set

You can see that the character set is all utf8

create database

create database wiki CHARACTER SET utf8 COLLATE utf8_bin;

Exit the container and enter the exit command twice

Install and configure confluence

cd /opt/software/confluence/creak

I have already created the dockerfile, just build the image directly

You can see that the image has been built successfully

Create a mount point to restore previous data in confluence

If the mount point already exists before, remember to clear the data in the mount point

mkdir /home/special/user/AI_Security_Lab/WIKI/log
mkdir /home/special/user/AI_Security_Lab/WIKI/restore
mkdir /home/special/user/AI_Security_Lab/WIKI/backup

run mirror

docker run -v /home/special/user/AI_Security_Lab/WIKI/log:/var/atlassian/confluence/logs -v /home/special/user/AI_Security_Lab/WIKI/restore:/var/atlassian/confluence/ restore -v /home/special/user/AI_Security_Lab/WIKI/backup:/home/confluence/atlassian/application-data/confluence/backups -d -p 8090:8090 -p 8091:8091 --restart always -e TZ= "Asia/Shanghai" confluence:latest

Use a browser to enter port 8090

Then select the product installation (you don’t need to check anything here), click Next

Copy the displayed server ID, here is BB1W-QWOH-2GIZ-9C6Y, copy this ID, and then switch to the directory where the experience file is located

cd /opt/software/confluence/creak

Then execute the experience file

java -jar atlassian-agent.jar -d -m [email protected] -n BAT -p conf -o http://113.55.126.9 -s BB1W-QWOH-2GIZ-9C6Y

Please note that you need to replace the access address (http://113.55.126.9), server ID (BTW4-2T4Y-9BTK-R0DP) with your information, and other email addresses ([email protected]) and names (BAT) don’t care

Copy the code and paste it on the activation page

Click Next to complete the activation

link to database

Click next and wait patiently

If the prompt here tells you to manually put in the MySQL driver, please go to the maven central warehouse
https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.28/mysql-connector-java-8.0.28.jar Download, and then put it into the corresponding directory

The MySQL driver you need may not be version 8.0.28, the specific version is determined by yourself

When entering this page, if you want to restore from backup, please put your backup compressed package into

/home/special/user/AI_Security_Lab/WIKI/restore

Then click the button on the web page to enter the restoration process

Once the restore process is complete, you can access the

References

[1] Docker deploys Confluence (experimental version) – Hello Hello 111111 – Blog Garden (cnblogs.com)

[2] Install the Docker version of Confluence and experience it – Short Book (jianshu.com)

[3] Install, deploy, and experience Confluence 6.6 graphic tutorials based on Docker – Zhihu (zhihu.com)