version:
centos==7.2
jdk==1.8
confluence==6.15.4
jira-software==8.2.1
docker==18.09
安装前提示:
- 需要准备2个数据库,因为confluence和jira-software的mysql配置要求不一样
- confluence需要配置jdk,jira-software自带jdk
选择使用docker部署的原因:
- confluence和jira-software环境需求不同,需要分开配置.
- 如果直接使用物理机,需要占用多台.
- 不使用虚拟机是因为docker更轻量,而且更容易迁移.
- confluence和jira-software只是作为公司内部员工使用,不需要太高的配置和复杂的环境
此次部署流程:
- 配置jira-software需要的数据库
- 配置jira-software
- 配置confluence需要的数据库
- 配置confluence
容器名称和IP分布:
因为wiki的账号可以由jira控制,所以我们首先安装jira-software
宿主机IP:10.0.0.25
jira-software
jira-mysql 192.168.0.10
confluence-jira 192.168.0.100
confluence
wiki-mysql 192.168.0.20
confluence-wiki 192.168.0.200
一、docker-ce环境配置
创建目录:
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容器的数据目录
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
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;
docker restart jira-mysql
2. 部署jira-software
安装类型 - 选择选项2(自定义)以获得最多控制权.
目标目录 - 这是安装Jira的地方.
主目录 - 这是存储日志,搜索索引和文件等Jira数据的地方.
TCP端口 - 这些是HTTP连接器端口和Jira将运行的控制端口.除非您在同一端口上运行其他应用程序,否则请使用默认值.
安装为服务 - 使用"/etc/init.d/jira [stop | start]"命令来控制jira服务.
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数据目录
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 http://localhost:8080
Finishing installation …
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
备份原文件
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
查看许可证过期时间
许可证状态查看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
jdbc:mysql://address=(protocol=tcp)(host=192.168.0.10)(port=3306)/jiradb?sessionVariables=default_storage_engine=InnoDB
改为
jdbc:mysql://address=(protocol=tcp)(host=192.168.0.10)(port=3306)/jiradb?useSSL=false&sessionVariables=default_storage_engine=InnoDB
重启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容器的数据目录
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
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;
docker restart wiki-mysql
2. 部署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
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=.:
J
A
V
A
H
O
M
E
/
j
r
e
/
l
i
b
/
r
t
.
j
a
r
:
JAVA_HOME/jre/lib/rt.jar:
JAVAHOME/jre/lib/rt.jar:JAVA_HOME/lib/dt.jar:
J
A
V
A
H
O
M
E
/
l
i
b
/
t
o
o
l
s
.
j
a
r
e
x
p
o
r
t
P
A
T
H
=
JAVA_HOME/lib/tools.jar export PATH=
JAVAHOME/lib/tools.jarexportPATH=PATH:$JAVA_HOME/bin
source /etc/profile
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数据的默认位置
[/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 http://localhost:8090
Finishing installation …
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
将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的社区帮助这样回复
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
jdbc:mysql://192.168.0.20:3306/confluence
改为
jdbc:mysql://192.168.0.20:3306/confluence?useSSL=false
/etc/init.d/confluence restart
竟然都看到最后了,给小编点个关注吧,小编还会持续更新的,只收藏不点关注的都是在耍流氓!