在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 \
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. 配置添加自定义网桥,用于指定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 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 ...
# 因为jira并没有自带java连接mysql的驱动器,所以这里需要自己下载,并且放入对应目录.
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的试用授权许可(普通版)
# 破解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
> 查看许可证过期时间
许可证状态查看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部署
创建目录:
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 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数据的默认位置
[/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 ...
# wiki和jira一样并没有自带java连接mysql的驱动器,所以这里需要自己下载,并且放入对应目录.
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完全不同,需要两步,一是破解文件,二是获取授权码
> 将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
在Docker中部署Confluence和jira-software的更多相关文章
- 在docker中部署centos7镜像
本篇文章参考自: https://www.cnblogs.com/linjj/p/5606911.html https://blog.csdn.net/u012767761/article/detai ...
- docker 中部署一个springBoot项目
docker 中部署一个springBoot项目 (1)介绍 springBoot项目 1.项目结构 2.pom.xml <?xml version="1.0" encodi ...
- 如果在docker中部署tomcat,并且部署java应用程序
1.先说如何在docker中部署tomcat 第一步:root用户登录在系统根目录下创建文件夹tomcat7,命令如:mkdir tomcat7,并且切换到该目录下:cd tomcat7: 第二步:创 ...
- 在Docker中部署GreatSQL并构建MGR集群
GreatSQL社区原创内容未经授权不得随意使用,转载请联系小编并注明来源. 为了方面社区用户体验GreatSQL,我们同时还提供Docker镜像,本文详细介绍如何在Docker中部署GreatSQL ...
- Docker中部署Kubernetes
Kubernetes为Google开源的容器管理框架,提供了Docker容器的夸主机.集群管理.容器部署.高可用.弹性伸缩等一系列功能:Kubernetes的设计目标包括使容器集群任意时刻都处于用户期 ...
- docker中部署mongodb副本集
1.基本信息如下 服务器地址 192.168.73.129 副本集名称 rs 容器节点及端口映射 m0 37017:27017 m1 47017:27017 ...
- 记一次Docker中部署Asp.Net Core 3.0的踩坑过程
最近公司打算重构目前直销报单系统到微信小程序中,目前的系统只能在PC上面使用,这两年也搞过App端,但是由于人员流动和公司架构调整最后都不了了之,只留下一堆写了一半的接口.以前的接口依然是使用Asp. ...
- docker中部署django项目~~Dockfile方式和compose方式
1. 背景: 本机win10上,后端django框架代码与前端vue框架代码联调通过. 2. 目的: 在centos7系统服务器上使用docker容器部署该项目. 3. 方案一:仅使用基 ...
- 在docker中部署redis主从配置
环境说明: 阿里云服务器 Ubuntu 16.04 docker 1.拉取Redis镜像 docker pull redis 2.配置Redis启动配置文件,此处我创建一个专用目录,存放Redis相关 ...
随机推荐
- Go语言实现:【剑指offer】正则表达式匹配
该题目来源于牛客网<剑指offer>专题. 请实现一个函数用来匹配包括 . 和 * 的正则表达式.模式中的字符.表示任意一个字符,而 * 表示它前面的字符可以出现任意次(包含0次). 在本 ...
- postman批量接口测试/批量导入/批量参数化简要全过程及遇到问题处理方法
简单说明下postman批量接口调用的过程及注意事项: 1.报文调试(建议先调通再批量执行,统筹安排时间) 2.参数化,例如: "address": "{{address ...
- Asp.Net Api+Swagger控制器注释
Swagger注释不显示,只需要进入Startup.cs 找到: c.IncludeXmlComments(Path.Combine(AppDomain.CurrentDomain.BaseDirec ...
- 解决pycharm打开html页面一直刷新
顺序——> File ——>Project:项目名——>project Structure 右侧的 + Add ContentRoot下面只保留本项目路径,其他全删了 方法2(推荐) ...
- Axure实现抽奖转盘(二)
这个小应用主要用到了以下功能: 1.生成一个0-360之间的随机数,保存至变量: 2.旋转转盘到达指定角度,案例中为3-4圈(1080+变量): 3.转盘逐渐停止通过动画(缓慢退出)实现: 4.转盘停 ...
- Windows2008R2搭建共享存储服务器
说明: 为了方便公司个部门软件.项目.文档等资料的归档和保存,实现公司内部资料共享及重要资料备份,防止因个人计算机系统故障或硬件故障导致数据丢失而造成数据无法恢复的损失,特建立共享服务器 1.在共享服 ...
- 【渗透实战】web渗透实战,手动拿学校站点 得到上万人的信息(漏洞已提交)
------------恢复内容开始------------ ’‘’版权tanee转发交流学校请备注漏洞已经提交学校管理员关键过程的截图和脚本代码已经略去.希望大家学习技术和思路就好,切勿进行违法犯罪 ...
- centos 记录所有用户操作命令的脚本
使用history不能看到所有用户的命令记录,如何看所有用户的操作记录. 如下: 在 /etc/profile 最下面加入如下代码即可. PS1="`whoami`@`hostname`:& ...
- jdk-8u241各系统版本
今天下载jdk8的时候汇总了linux/mac/windows操作系统的安装包 链接: https://pan.baidu.com/s/105wtrimc1liThGxsZIv7-A 密码: v8lc ...
- #《H.264和MPEG-4视频压缩》# 一. 色彩空间
多数的数字视频应用需要播放彩色的视频信号,所以需要捕获和重现颜色信息.一幅黑白图像的每一个采样点只需要一个像素表示明暗或亮度,而在彩色图像中至少需要3个像素来表示每个像素的色彩.表示亮度和色彩的不同方 ...