version:
centos==7.2
jdk==1.8
confluence==6.15.4
jira-software==8.2.1
docker==18.09
安裝前提示:
1. 需要準備2個數(shù)據(jù)庫,因為confluence和jira-software的mysql配置要求不一樣
2. confluence需要配置jdk,jira-software自帶jdk
選擇使用docker部署的原因:
1. confluence和jira-software環(huán)境需求不同,需要分開配置.
2. 如果直接使用物理機,需要占用多臺.
3. 不使用虛擬機是因為docker更輕量,而且更容易遷移.
4. confluence和jira-software只是作為公司內(nèi)部員工使用,不需要太高的配置和復雜的環(huán)境
此次部署流程:
1. 配置jira-software需要的數(shù)據(jù)庫
2. 配置jira-software
3. 配置confluence需要的數(shù)據(jù)庫
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環(huán)境配置
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 \
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. 配置添加自定義網(wǎng)橋,用于指定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部署
創(chuàng)建目錄:
mkdir -p /docker-storage/confluence/jira/{etc,data,mysql}
釋:
/docker-storage/confluence/jira/mysql : MySQL容器的數(shù)據(jù)目錄
/docker-storage/confluence/jira/etc : jira-software容器的安裝目錄
/docker-storage/confluence/jira/data : jira-software容器的數(shù)據(jù)目錄
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配置,并且創(chuàng)建jira-software需要的數(shù)據(jù)庫
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(自定義)以獲得最多控制權(quán).
目標目錄 - 這是安裝Jira的地方.
主目錄 - 這是存儲日志,搜索索引和文件等Jira數(shù)據(jù)的地方.
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 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
> 交互式安裝過程:
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數(shù)據(jù)目錄
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已經(jīng)安裝成功,是否現(xiàn)在啟動
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 ...
# 因為jira并沒有自帶java連接mysql的驅(qū)動器,所以這里需要自己下載,并且放入對應目錄.
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
# 到此就可以訪問"http://10.0.0.25:10010"初始化你的jira-software配置,暫時先使用jira的試用授權(quán)許可(普通版)
# 破解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
> 查看許可證過期時間
許可證狀態(tài)查看http://10.0.0.25:10010/plugins/servlet/applications/versions-licenses
三、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部署
創(chuàng)建目錄:
mkdir -p /docker-storage/confluence/wiki/{etc,data,mysql}
釋:
/docker-storage/confluence/wiki/mysql : MySQL容器的數(shù)據(jù)目錄
/docker-storage/confluence/wiki/etc : wiki容器的安裝目錄
/docker-storage/confluence/wiki/data : wiki容器的數(shù)據(jù)目錄
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配置,并且創(chuàng)建jira-software需要的數(shù)據(jù)庫
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 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
# 安裝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
> 交互式安裝過程:
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數(shù)據(jù)的默認位置
[/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? 現(xiàn)在啟動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和jira一樣并沒有自帶java連接mysql的驅(qū)動器,所以這里需要自己下載,并且放入對應目錄.
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
# 到此就可以訪問"http://10.0.0.25:10020"初始化你的wiki配置,暫時不要選擇組件,直接配置到有server ID的那一頁
# 破解wiki和jira完全不同,需要兩步,一是破解文件,二是獲取授權(quán)碼
> 將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已經(jīng)是破解好的
> 將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
> 復制網(wǎng)頁中的server ID,然后返回你的破解程序,將server ID填入到破解程序,并且填入其他信息(隨意填,郵箱格式要正確)
> 點擊破解程序".gen!"按鈕,然后將生成的key填入web中即可
五、confluence問題處理
對于console報錯500,atlassian的社區(qū)幫助這樣回復
1. confluence配置完成后發(fā)現(xiàn)css樣式不顯示,并且console報錯500
atlassian的社區(qū)幫助這樣提示:
confluence帳戶必對目錄 <confluence_home>和<confluence_install> 擁有讀/寫/執(zhí)行權(quán)限
解決辦法(不要加-R):
chmod 755 /usr/local/confluence/data
2. wiki登錄后提示:在您系統(tǒng)中的服務器 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
以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。