jira8.1部署
https://my.oschina.net/wuweixiang/blog/3014644
Confluence知识库部署与还原
一.部署
1.安装 mysql 5.7,安装docker
配置数据库
mkdir -p /jiraconfluencemysql210/mysql/data_mysql_vol
mkdir -p /jiraconfluencemysql210/mysql/conf_mysql_vol
mkdir -p /jiraconfluencemysql210/mysql/data_backup_vol
MySQL所使用的配置文件my.cnf核心参数:
vim /jiraconfluencemysql210/mysql/conf_mysql_vol/my.cnf
[client]
default-character-set = utf8
[mysql]
default-character-set = utf8
[mysqld]
character_set_server = utf8
collation-server = utf8_bin
transaction_isolation = READ-COMMITTED
需要注意的是,Confluence需要使用utf8_bin,并将事务隔离策略设为READ-COMMITTED。
docker run –name mysql
–restart always
-p 3309:3309
-e MYSQL_ROOT_PASSWORD=shimujiuxia
-v /jiraconfluencemysql210/mysql/data_mysql_vol:/var/lib/mysql
-v /jiraconfluencemysql210/mysql/conf_mysql_vol:/etc/mysql/conf.d
-v /jiraconfluencemysql210/mysql/data_backup_vol:/backup
-d mysql:5.7
2.创建表及用户
–创建jira数据库及用户–
drop database jira; #删除已存在的jira库
create database jira character set ‘UTF8’; #创建jira数据库并设置字符
create user ‘jira’@’%’ identified by ‘shimujiuxia’;
grant all on . to ‘jira’@’%’;
alter user ‘jira’@’%’ identified with mysql_native_password by ‘shimujiuxia’;
flush privileges; #刷新权限
–创建confluence数据库及用户–
drop database confluence;
create database confluence character set utf8 collate utf8_bin;
create user ‘confluence’@’%’ identified by ‘shimujiuxia’;
grant all on . to ‘confluence’@’%’;
alter user ‘confluence’@’%’ identified with mysql_native_password by ‘shimujiuxia’;
flush privileges;
–设置confluence字符集–
alter database confluence character set utf8 collate utf8_bin;
— confluence要求设置事务级别为READ-COMMITTED–
set global tx_isolation=’READ-COMMITTED’;
set session transaction isolation level read committed;
show variables like ‘tx%’;
3.创建jira目录及Dockerfile文件
mkdir -p /jiraconfluencemysql210/jira/data_jira_var
mkdir -p /jiraconfluencemysql210/jira/data_jira_opt
cd /jiraconfluencemysql210/jira
vim Dockerfile #将下列文件写入Dockerfile保存,破解文件及需要的字符见附件,放入jira目录下
FROM cptactionhank/atlassian-jira-software:8.1.0
USER root
COPY “atlassian-agent.jar” /opt/atlassian/jira/
COPY “simsun.ttf” /usr/share/fonts/
RUN chmod 755 /usr/share/fonts/simsun.ttf
RUN echo ‘export CATALINA_OPTS=”-javaagent:/opt/atlassian/jira/atlassian-agent.jar ${CATALINA_OPTS}”‘ >> /opt/atlassian/jira/bin/setenv.sh
4.构建镜像,执行命令
cd /jiraconfluencemysql210/jira
docker build -t jira/jira:v8.1.0 .
5.启动容器,关联mysql
cd /jiraconfluencemysql210/jira
docker run –name jira
–restart always
-p 9005:8080
-v data_jira_var:/var/atlassian/jira
-v data_jira_opt:/opt/atlassian/jira
-d jira/jira:v8.1.0
6.破解confluence操作
打开浏览器访问127.0.0.1:9005,可见jira页面,可切换中文操作,选择手动配置项目(必须),在请指定你的许可证关键字时,把服务器ID记下,使用atlassian-agent.jar破解
操作如下:
复制服务器id,见web页面
在jir目录下执行命令,生成许可证:
java -jar atlassian-agent.jar -d -m test@test.com -n BAT -p jira -o http://127.0.0.1 -s BACN-OTO2-ZDC9-CWVG
将生成的许可证复制到web页面,完成破解
7.安装confluence,安装流程与上方安装一致,只写步骤,不多赘述
mkdir -p /jiraconfluencemysql210/confluence/data_confluence_vol
mkdir -p /jiraconfluencemysql210/confluence/data_confluence_opt
mkdir -p /jiraconfluencemysql210/confluence/data_confluence_var
cd /jiraconfluencemysql210/confluence/
vim /jiraconfluencemysql210/confluence/Dockerfile
编写Dockerfile文件:
FROM cptactionhank/atlassian-confluence:7.4.0
USER root
COPY “atlassian-agent.jar” /opt/atlassian/confluence/
COPY “simsun.ttf” /usr/share/fonts/
RUN chmod 755 /usr/share/fonts/simsun.ttf
RUN echo ‘export CATALINA_OPTS=”-javaagent:/opt/atlassian/confluence/atlassian-agent.jar ${CATALINA_OPTS}”‘ >> /opt/atlassian/confluence/bin/setenv.sh
构建镜像,执行命令
docker build -f Dockerfile -t confluence/confluence:7.4.0 .
启动容器关联mysql,执行命令:
docker run –name confluence
–restart always
-p 9006:8090
-v data_confluence_vol:/home/confluence_data
-v data_confluence_opt:/opt/atlassian/confluence
-v data_confluence_var:/var/atlassian/confluence
-d confluence/confluence:7.4.0
docker container prune #清理缓存
打开浏览器访问127.0.0.1:9006,可见jira页面,可切换中文操作,选择手动配置项目(必须),在请指定你的许可证关键字时,把服务器ID记下,使用atlassian-agent.jar破解
操作如下:
复制服务器id,见web页面
在jir目录下执行命令,生成许可证:
java -jar atlassian-agent.jar -d -m test@test.com -n BAT -p jira -o http://127.0.0.1 -s BACN-OTO2-ZDC9-CWVG
将生成的许可证复制到web页面,完成破解
二.恢复备份
1.公司知识库备份文件在172.168.1.225服务器的/data/zsk/confluence目录下,将备份文件复制到172.168.1.238服务器
2.在web页面执行备份恢复操作,点击右上角头像,选设置项,在备份与恢复子项,输入要恢复的文件名,执行恢复即可
3.需要新建docker容器,请务必按上述步骤操作,否则可能导致配置文件不吻合,恢复备份失败