在Docker中部署Confluence和jira-software
version:
centos==7.2
jdk==1.8
confluence==6.15.4
jira-software==8.2.1
docker==18.09
安裝前提示:
1. 需要準備2個資料庫,因為confluence和jira-software的mysql配置要求不一樣
2. confluence需要配置jdk,jira-software自帶jdk
選擇使用docker部署的原因:
1. confluence和jira-software環境需求不同,需要分開配置.
2. 如果直接使用物理機,需要佔用多臺.
3. 不使用虛擬機器是因為docker更輕量,而且更容易遷移.
4. confluence和jira-software只是作為公司內部員工使用,不需要太高的配置和複雜的環境
此次部署流程:
1. 配置jira-software需要的資料庫
2. 配置jira-software
3. 配置confluence需要的資料庫
4. 配置confluence
容器名稱和IP分佈:
因為wiki的賬號可以由jira控制,所以我們首先安裝jira-software
宿主機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
一、docker-ce環境配置
1. 安裝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 \
$ sudo yum install docker-ce docker-ce-cli containerd.io
$ sudo systemctl enable docker
$ sudo systemctl start docker
2. 配置新增自定義網橋,用於指定docker容器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. 下載由官方提供的容器基礎映象
docker pull centos:7.5.1511
docker pull mysql:5.7.26
4. 遷移docker容器預設存放目錄
systemctl stop docker
mv /var/lib/docker /data/docker
ln -s /data/docker /var/lib/docker
systemctl start docker
二、jira-software部署
建立目錄:
mkdir -p /docker-storage/confluence/jira/{etc,data,mysql}
釋:
/docker-storage/confluence/jira/mysql : MySQL容器的資料目錄
/docker-storage/confluence/jira/etc : jira-software容器的安裝目錄
/docker-storage/confluence/jira/data : jira-software容器的資料目錄
1. 部署並且配置jira需要的MySQL
# 啟動容器
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
# 進入容器修改MySQL配置,並且建立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;
# 重啟容器使MySQL配置生效
docker restart jira-mysql
2. 部署jira-software
# 安裝jira-software的四個重要選項
安裝型別 - 選擇選項2(自定義)以獲得最多控制權.
目標目錄 - 這是安裝Jira的地方.
主目錄 - 這是儲存日誌,搜尋索引和檔案等Jira資料的地方.
TCP埠 - 這些是HTTP聯結器埠和Jira將執行的控制埠.除非您在同一埠上執行其他應用程式,否則請使用預設值.
安裝為服務 - 使用"/etc/init.d/jira [stop | start]"命令來控制jira服務.
# 部署容器並且安裝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
chmod a+x atlassian-jira-software-8.2.1-x64.bin
./atlassian-jira-software-8.2.1-x64.bin
> 互動式安裝過程:
Unpacking JRE ...
Starting Installer ...
> 這會在你的計算機中安裝jira software,回車即可
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.
> 這裡輸入1是預設安裝,2是自定義安裝,3是更新,選擇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
> 選擇你的jira安裝目錄
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
> 選擇你的jira資料目錄
Default location for JIRA Software data
[/var/atlassian/application-data/jira]
/usr/local/confluence/data
> 可以指定服務埠,這裡是預設
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]
> 是否將jira安裝為服務,安裝為服務後使用"/etc/init.d/jira [stop | start]"來控制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
> 這裡列出了你之前輸入的配置資訊,詢問你否安裝,回車即可
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已經安裝成功,是否現在啟動
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
Finishing installation ...
# 因為jira並沒有自帶java連線mysql的驅動器,所以這裡需要自己下載,並且放入對應目錄.
wget
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
# 到此就可以訪問"初始化你的jira-software配置,暫時先使用jira的試用授權許可(普通版)
# 破解jira-software
> 備份原檔案
mv /usr/local/confluence/etc/atlassian-jira/WEB-INF/lib/atlassian-extras-3.2.jar /root/
> 將破解檔案移動到源位置
cp atlassian-extras-3.2.jar /usr/local/confluence/etc/atlassian-jira/WEB-INF/lib/atlassian-extras-3.2.jar
> 重啟服務
/etc/init.d/jira stop
/etc/init.d/jira start
> 檢視許可證過期時間
許可證狀態檢視
三、jira-software啟動後問題處理.
處理/usr/local/confluence/etc/logs/catalina.out警告:
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.
問題
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>
改為
<url>jdbc:mysql://address=(protocol=tcp)(host=192.168.0.10)(port=3306)/jiradb?useSSL=false&sessionVariables=default_storage_engine=InnoDB</url>
重啟jira
/etc/init.d/jira stop
/etc/init.d/jira start
四、confluence部署
建立目錄:
mkdir -p /docker-storage/confluence/wiki/{etc,data,mysql}
釋:
/docker-storage/confluence/wiki/mysql : MySQL容器的資料目錄
/docker-storage/confluence/wiki/etc : wiki容器的安裝目錄
/docker-storage/confluence/wiki/data : wiki容器的資料目錄
1. 部署並且配置wiki需要的MySQL
# 啟動容器
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
# 進入容器修改MySQL配置,並且建立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;
# 重啟容器使MySQL配置生效
docker restart wiki-mysql
2. 部署wiki
# 安裝wiki的選項和jira幾乎相同
# 部署容器並且安裝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需要手動配置jdk
wget
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
# 安裝wiki
wget
chmod a+x atlassian-confluence-6.15.4-x64.bin
./atlassian-confluence-6.15.4-x64.bin
> 互動式安裝過程:
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], 自定義安裝 -
Upgrade an existing Confluence installation [3] 升級
2
Select the folder where you would like Confluence 6.15.4 to be installed, 選擇要安裝Confluence 6.15.4的資料夾,
then click Next. 然後單擊Next。
Where should Confluence 6.15.4 be installed? 6.15.4應安裝在何處?
[/opt/atlassian/confluence]
/usr/local/confluence/etc
Default location for Confluence data confluence資料的預設位置
[/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=預設,2=自定義
1
Confluence can be run in the background. 可以在後臺執行Confluence。
You may choose to run Confluence as a service, which means it will start 您可以選擇將Confluence作為服務執行,這意味著它將啟動
automatically whenever the computer restarts. 自動每當計算機重新啟動。
Install Confluence as Service? 安裝Confluence作為服務?
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安裝完成
Start Confluence now? 現在啟動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
Finishing installation ...
# wiki和jira一樣並沒有自帶java連線mysql的驅動器,所以這裡需要自己下載,並且放入對應目錄.
wget
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
# 到此就可以訪問"初始化你的wiki配置,暫時不要選擇元件,直接配置到有server ID的那一頁
# 破解wiki和jira完全不同,需要兩步,一是破解檔案,二是獲取授權碼
> 將wiki的/usr/local/confluence/etc/confluence/WEB-INF/lib/atlassian-extras-decoder-v2-3.4.1.jar檔案下載到本地重新命名為atlassian-extras-2.4.jar
> 找到破解軟體,右擊confluence_keygen.jar使用java執行(需要在windows上安裝好java)
> 選擇".patch"找到剛才從wiki上下載下來並且重新命名的檔案開啟
> 注意破解程式暫時別關閉
> 然後開啟你下載的破解包的檔案目錄,可以看到atlassian-extras-2.4.jar和atlassian-extras-2.4.bak兩個檔案,這裡atlassian-extras-2.4.jar已經是破解好的
> 將atlassian-extras-2.4.jar名字改回為atlassian-extras-decoder-v2-3.4.1.jar然後傳到wiki的/usr/local/confluence/etc/confluence/WEB-INF/lib/下
/etc/init.d/confluence restart
> 複製網頁中的server ID,然後返回你的破解程式,將server ID填入到破解程式,並且填入其他資訊(隨意填,郵箱格式要正確)
> 點選破解程式".gen!"按鈕,然後將生成的key填入web中即可
五、confluence問題處理
對於console報錯500,atlassian的社群幫助這樣回覆
1. confluence配置完成後發現css樣式不顯示,並且console報錯500
atlassian的社群幫助這樣提示:
confluence帳戶必對目錄 <confluence_home>和<confluence_install> 擁有讀/寫/執行許可權
解決辦法(不要加-R):
chmod 755 /usr/local/confluence/data
2. wiki登入後提示:在您系統中的伺服器 SQL 模式健康檢查失敗了.
進入wiki-mysql容器註釋如下行
vim /etc/mysql/mysql.conf.d/mysqld.cnf
# sql_mode = NO_AUTO_VALUE_ON_ZERO
docker restart wiki-mysql
3. 處理catalina.out警告:
處理/usr/local/confluence/etc/logs/catalina.out警告:
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.
問題
vim /usr/local/confluence/data/confluence.cfg.xml
<property name="hibernate.connection.url">jdbc:mysql://192.168.0.20:3306/confluence</property>
改為
<property name="hibernate.connection.url">jdbc:mysql://192.168.0.20:3306/confluence?useSSL=false</property>
/etc/init.d/confluence restart
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69976867/viewspace-2706679/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【MySQL】 在Docker中快速部署PXCMySqlDocker
- 使用 Docker 搭建 ConfluenceDocker
- 在Ubuntu中安裝Docker和docker的使用UbuntuDocker
- Asp.Net Core WebAPI+PostgreSQL部署在Docker中ASP.NETWebAPISQLDocker
- FastAPI(62)- FastAPI 部署在 DockerASTAPIDocker
- 在 SAP 雲平臺上部署和執行 Docker 應用Docker
- 在docker容器中部署Web專案DockerWeb
- 『中級篇』在docker-swarm叢集裡透過serivce部署worDockerSwarm
- Centos7搭建部署confluence7.4.6CentOS
- Win10 部署 Confluence 文件管理系統Win10
- 在Docker中部署Spring Boot專案DockerSpring Boot
- 企業級GitLab在Docker部署使用GitlabDocker
- paddleocr 在docker環境下部署Docker
- Linux 中 Docker 的部署安裝LinuxDocker
- 還在寫定時任務進行部署? ---使用Artifactory Webhooks和Docker實現持續部署WebHookDocker
- 【docker巢狀】在docker中的linux中再安裝dockerDocker巢狀Linux
- 在centos8使用Docker部署Django專案CentOSDockerDjango
- 在 Docker 中部署 ASP.NET CORE 應用DockerASP.NET
- 在玩客雲上透過docker部署transmissionDocker
- 【Docker】使用docker部署 mysqlDockerMySql
- 在Docker環境下的kafka部署之一:三種基本部署DockerKafka
- docker安裝部署djanggo和pythonDockerGoPython
- Docker: 現在和未來Docker
- redmine docker部署Docker
- docker 部署 postgresDocker
- docker部署MySQLDockerMySql
- 在Linux系統上部署docker私有倉庫LinuxDocker
- 在WSL2的Ubuntu中安裝和使用Docker/PodmanUbuntuDocker
- 在Linux中,Docker和容器虛擬概念是什麼?LinuxDocker
- 在docker中寫個Hello WorldDocker
- 在linux中安裝DockerLinuxDocker
- 在elementary os中安裝dockerDocker
- 在 Docker 中啟動 JupyterDocker
- Docker:四、Docker進階 Windows Docker IIS 部署DockerWindows
- 資料庫為何不建議部署在Docker容器內資料庫Docker
- 在Docker容器環境中用Let's Encrypt部署HTTPSDockerHTTP
- 在Docker Swarm上部署Apache Storm:第2部分DockerSwarmApacheORM
- 在Docker Swarm上部署Apache Storm:第1部分DockerSwarmApacheORM